UNPKG

@real_one_chess_king/game-logic

Version:
49 lines 1.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MovementRule = exports.Direction = void 0; var Direction; (function (Direction) { Direction["Up"] = "Up"; Direction["UpLeft"] = "UpLeft"; Direction["UpRight"] = "UpRight"; Direction["Down"] = "Down"; Direction["DownLeft"] = "DownLeft"; Direction["DownRight"] = "DownRight"; Direction["Left"] = "Left"; Direction["Right"] = "Right"; })(Direction || (exports.Direction = Direction = {})); class MovementRule { id; name; moveToEmpty; moveToKill; collision; distance; directions; speed; constructor(id, name, moveToEmpty, moveToKill, collision, // true - will move until first enemy, false - will jump like horse distance, directions, speed) { this.id = id; this.name = name; this.moveToEmpty = moveToEmpty; this.moveToKill = moveToKill; this.collision = collision; this.distance = distance; this.directions = directions; this.speed = speed; } getMeta() { return { id: this.id, name: this.name, moveToEmpty: this.moveToEmpty, moveToKill: this.moveToKill, collision: this.collision, distance: this.distance, directions: Array.from(this.directions), speed: this.speed, }; } } exports.MovementRule = MovementRule; //# sourceMappingURL=movement-rule.js.map