CabinGame/Program/src/Components/position.ts

18 lines
450 B
TypeScript
Raw Normal View History

import { Point } from "../Datatypes/MathTypes/point"
2020-02-06 11:02:44 +00:00
import { Component } from "ecsy"
// Position component
2020-02-06 11:02:44 +00:00
export class Position extends Component {
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
copy(values: any) {
2020-02-17 11:56:41 +00:00
this.value = values.value
}
reset() {
this.value = new Point(0, 0)
}
}