public void SetUp() { player1 = new Player("Player 1"); player2 = new Player("Player 2"); game = Game.CreateNewGame(10, 10, player1, player2); log = new JsonMessageLog(); }
public static Game CreateNewGame(int x, int y, params Player[] players) { var game = new Game(x, y); foreach (var player in players) game.AddPlayer(player); return game; }
public abstract void Execute(Game game, IMessageLog log);
public void UpdateScores(Game game) { JsonObject obj = BuildGameMessageJson(GameMessageType.ScoresUpdated, msg => { msg.scores = new JsonArray( game.Players.Select(p => { dynamic scoreEntry = new JsonObject(); scoreEntry.name = p.Name; scoreEntry.value = p.Score; return (JsonValue)scoreEntry; }) ); }); Messages.Add(obj); }
public void StartGame(Game game) { JsonObject obj = BuildGameMessageJson(GameMessageType.NewGame, msg => { msg.dimensions = new JsonObject(); msg.dimensions.width = game.Board.Width; msg.dimensions.height = game.Board.Height; }); Messages.Add(obj); }
public void SetUp() { player1 = new Player("Player 1"); player2 = new Player("Player 2"); game = Game.CreateNewGame(10, 10, player1, player2); }
public HostedGame(GameConfiguration config) { this.config = config; clients = new WebSocketCollection<GameWebSocketService>(); game = new PushFrenzy.Rules.Game(config.BoardWidth, config.BoardHeight); }
public HostedGame(GameConfiguration config) { this.config = config; clients = new WebSocketCollection <GameWebSocketService>(); game = new PushFrenzy.Rules.Game(config.BoardWidth, config.BoardHeight); }
public PiecesInARowClearingRule(Game game, int target) { this.game = game; Target = target; }