Ejemplo n.º 1
0
        public Game(GameVariantModel model)
        {
            Id = model.Id;
            Name = model.Name;
            MovesPerTurn = model.MovesPerTurn;
            ScoreToWin = model.ScoreToWin;

            TileGrid = model.TileGrid;

            Height = model.Height;
            Width = model.Width;

            AddTilesToBoard(model.Width, model.Height);
        }
Ejemplo n.º 2
0
 public void SaveGameVariant(GameVariantModel gameVariant)
 {
     _client.CreateDocumentAsync(_gameVariantsCollectionUri, gameVariant as GameVariantModel);
 }
Ejemplo n.º 3
0
        // this should handle setting up everything on the board; board, tiles, pieces.
        public static void SetUpBoard(Match match, int boardId)
        {
            if (boardId == 567)
            {
                var chess = new GameVariantModel(
                    modelId: Guid.NewGuid(),
                    modelMovesPerTurn: 1,
                    modelName: "Griddy Chess",
                    modelScoreToWin: 1,
                    modelWidth: 8,
                    modelHeight: 8,
                    modelTileGrid: new Tile[8, 8]);

                match.Game = new Game(chess);

                SetUpChessPieces(match);
            }

            if (boardId == 111)
            {
                var griddyWarfare = new GameVariantModel(
                modelId: Guid.NewGuid(),
                modelMovesPerTurn: 3,
                modelName: "Griddy Warfare",
                modelScoreToWin: 5,
                modelWidth: 20,
                modelHeight: 8,
                modelTileGrid: new Tile[20, 8]);

                match.Game = new Game(griddyWarfare);

                SetUpGriddyWarfarePieces(match);
            }

            if (boardId == 211)
            {
                var fishyGrid = new GameVariantModel(
                modelId: Guid.NewGuid(),
                modelMovesPerTurn: 2,
                modelName: "Fishy Grid",
                modelScoreToWin: 1,
                modelWidth: 20,
                modelHeight: 10,
                modelTileGrid: new Tile[20, 10]);

                match.Game = new Game(fishyGrid);

                SetupFishyGridPieces(match);
            }
        }