GameMachine.test.js 685 B

123456789101112131415161718192021222324252627282930313233343536
  1. let GameMachine = require('./GameMachine').GameMachine;
  2. let Moves = require('./GameMoves');
  3. let Card = require('./Card');
  4. var mac = new GameMachine();
  5. let card = new Card();
  6. card.setAttack([4,2,3,1]);
  7. card.setOwner(666);
  8. let ncard = new Card();
  9. ncard.setAttack([4,3,3,10]);
  10. ncard.setOwner(666);
  11. let nncard = new Card();
  12. nncard.setAttack([8,5,6,9]);
  13. nncard.setOwner(665);
  14. let move = new Moves.PlaceMove(card, 4, 666);
  15. mac.runMove(move);
  16. let nmove = new Moves.PlaceMove(card, 3, 665);
  17. mac.runMove(nmove);
  18. let nnmove = new Moves.PlaceMove(ncard, 1, 666);
  19. mac.runMove(nnmove);
  20. let nnnmove = new Moves.PlaceMove(nncard, 0, 665);
  21. mac.runMove(nnnmove);
  22. mac.state.board.debug();