faction-deck-building-scene.js 984 B

123456789101112131415161718192021222324252627282930313233343536
  1. 'use strict';
  2. import DeckBuildingScene from './deck-building-scene';
  3. import { Faction } from '../../common/utils/const/faction-enum';
  4. import * as Utils from '../../common/utils/prompt-renderer';
  5. export default class FactionDeckBuildingScene extends DeckBuildingScene {
  6. constructor(gameEventListener) {
  7. super();
  8. this.gameEventListener = gameEventListener;
  9. }
  10. preload() {
  11. console.log('Preload');
  12. }
  13. create() {
  14. console.log('create');
  15. setTimeout(() => {
  16. let factionOptions = Object.values(Faction).filter(faction => faction !== Faction.NONE);
  17. let pBlueFaction = Utils.promptSelectAmongOptions("Select Player Blue Faction", factionOptions);
  18. factionOptions = factionOptions.filter(faction => faction !== pBlueFaction);
  19. let pRedFaction = Utils.promptSelectAmongOptions("Select Player Red Faction", factionOptions);
  20. this.gameEventListener.onFactionsSelected(pBlueFaction, pRedFaction );
  21. }, 100);
  22. }
  23. update() {
  24. }
  25. }