GameActions.js 578 B

123456789101112131415161718192021222324
  1. const GameConstants = require('../constants/GameConstants');
  2. const AppDispatcher = require('../dispatcher/AppDispatcher');
  3. const GameActions = {
  4. rematch() {
  5. AppDispatcher.handleViewAction({
  6. actionType: GameConstants.REMATCH
  7. });
  8. },
  9. gameOver(options) {
  10. AppDispatcher.handleViewAction({
  11. actionType: GameConstants.GAME_OVER,
  12. options: options
  13. });
  14. },
  15. changePromotion(promotion) {
  16. AppDispatcher.handleViewAction({
  17. actionType: GameConstants.CHANGE_PROMOTION,
  18. promotion: promotion
  19. });
  20. }
  21. };
  22. module.exports = GameActions;