@real_one_chess_king/game-logic
Version:
R.O.C.K. chess game logic
49 lines • 1.49 kB
JavaScript
"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