@real_one_chess_king/game-logic
Version:
R.O.C.K. chess game logic
19 lines • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HorizontalMovementRule = void 0;
const affect_utils_1 = require("../../affect/affect.utils");
const movement_rule_1 = require("./movement-rule");
const straight_movement_rule_1 = require("./straight-movement.rule");
class HorizontalMovementRule extends straight_movement_rule_1.StraightMovementRule {
constructor({ id, name, moveToEmpty, moveToKill, collision, distance, directions, speed, }) {
super(id, name, moveToEmpty, moveToKill, collision, distance, directions, speed);
}
possibleDirrections = [movement_rule_1.Direction.Left, movement_rule_1.Direction.Right];
calculateNewCoord = (x, y, diff, dirrection) => {
return [
(0, affect_utils_1.markAsUserSelected)((0, affect_utils_1.buildMoveAffect)([x, y], (0, straight_movement_rule_1.directionToVector)(dirrection, x, y, diff))),
];
};
}
exports.HorizontalMovementRule = HorizontalMovementRule;
//# sourceMappingURL=horizontal-movement.rule.js.map