123456789101112131415161718192021222324252627282930313233 |
- import GameConstants from '../constants/GameConstants';
- import AppDispatcher from '../dispatcher/AppDispatcher';
- const GameActions = {
- makeMove(from, to, capture, emitMove) {
- AppDispatcher.handleViewAction({
- actionType: GameConstants.MAKE_MOVE,
- from: from,
- to: to,
- capture: capture,
- emitMove: emitMove
- });
- },
- rematch() {
- AppDispatcher.handleViewAction({
- actionType: GameConstants.REMATCH
- });
- },
- gameOver(options) {
- AppDispatcher.handleViewAction({
- actionType: GameConstants.GAME_OVER,
- options: options
- });
- },
- changePromotion(promotion) {
- AppDispatcher.handleViewAction({
- actionType: GameConstants.CHANGE_PROMOTION,
- promotion: promotion
- });
- }
- };
- export default GameActions;
|