2020-04-24 13:01:39 +00:00
|
|
|
import { Point } from "../Datatypes/MathTypes/point"
|
2020-02-06 11:02:44 +00:00
|
|
|
import { Component } from "ecsy"
|
2020-02-06 10:57:43 +00:00
|
|
|
|
|
|
|
|
// Position component
|
2020-02-06 11:02:44 +00:00
|
|
|
export class Position extends Component {
|
2020-02-06 10:57:43 +00:00
|
|
|
value: Point
|
|
|
|
|
|
2020-02-17 11:56:41 +00:00
|
|
|
//position is used so often copy is performance sensitive I assume???
|
|
|
|
|
//this can crash with wrong values, but I trust my code enough to pass ONE variable
|
2020-04-24 13:01:39 +00:00
|
|
|
copy(values: any) {
|
2020-02-17 11:56:41 +00:00
|
|
|
this.value = values.value
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-06 10:57:43 +00:00
|
|
|
reset() {
|
|
|
|
|
this.value = new Point(0, 0)
|
|
|
|
|
}
|
2020-04-24 13:01:39 +00:00
|
|
|
}
|