forked from External/mage
Added Mage.Tests project. Update server for test operations. Implemented bdd classes.
This commit is contained in:
parent
ddf1866d6e
commit
1b6722f9b2
20 changed files with 546 additions and 2 deletions
|
|
@ -235,6 +235,17 @@ public class GameController implements GameCallback {
|
|||
updateGame();
|
||||
}
|
||||
|
||||
public void cheat(UUID sessionId, UUID playerId, String cardName) {
|
||||
String clazz = Sets.findCard(cardName);
|
||||
if (clazz != null) {
|
||||
Card card = CardImpl.createCard(clazz);
|
||||
Set<Card> cards = new HashSet<Card>();
|
||||
cards.add(card);
|
||||
game.loadCards(cards, playerId);
|
||||
updateGame();
|
||||
}
|
||||
}
|
||||
|
||||
public void kill(UUID sessionId) {
|
||||
if (sessionPlayerMap.containsKey(sessionId)) {
|
||||
gameSessions.get(sessionPlayerMap.get(sessionId)).setKilled();
|
||||
|
|
@ -384,7 +395,7 @@ public class GameController implements GameCallback {
|
|||
return new GameView(game.getState(), game);
|
||||
}
|
||||
|
||||
private GameView getGameView(UUID playerId) {
|
||||
public GameView getGameView(UUID playerId) {
|
||||
GameView gameView = new GameView(game.getState(), game);
|
||||
gameView.setHand(new CardsView(game.getPlayer(playerId).getHand().getCards(game)));
|
||||
return gameView;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue