| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- class rotating {
- #sideways;
- #up_down;
- static get top() {
- return 1;
- }
- static get bottom() {
- return -1;
- }
- static get left() {
- return -1;
- }
- static get right() {
- return 1;
- }
- constructor() {
- this.stop();
- }
- stop() {
- this.#sideways = 0;
- this.#up_down = 0;
- }
- add_top() {
- this.#up_down = rotating.top;
- }
- add_bottom() {
- this.#up_down = rotating.bottom;
- }
- add_left() {
- this.#sideways = rotating.left;
- }
- add_right() {
- this.#sideways = rotating.right;
- }
- stop_sideways() {
- this.#sideways = 0;
- }
- stop_up_down() {
- this.#up_down = 0;
- }
- get is_left() {
- return this.#sideways === rotating.left;
- }
- get is_right() {
- return this.#sideways === rotating.right;
- }
- get is_top() {
- return this.#up_down === rotating.top;
- }
- get is_bottom() {
- return this.#up_down === rotating.bottom;
- }
- }
- export { rotating }
|