Esempio n. 1
0
        public async Task<ActionResult> NewSinglePlayer()
        {
            var player = ApplicationUser.GetCurrentPlayer(this.HttpContext);
            var bounds = new DomainModel.Bounds(8, 8);
            var properties = new DomainModel.GameProperties(bounds, 3, 2);

            var game = await this.gameService.CreateSinglePlayerGameAsync(player, properties);
            return RedirectToAction("Play", new { id = game.ID });
        }
Esempio n. 2
0
        public async Task <ActionResult> NewSinglePlayer()
        {
            var player     = ApplicationUser.GetCurrentPlayer(this.HttpContext);
            var bounds     = new DomainModel.Bounds(8, 8);
            var properties = new DomainModel.GameProperties(bounds, 3, 2);

            var game = await this.gameService.CreateSinglePlayerGameAsync(player, properties);

            return(RedirectToAction("Play", new { id = game.ID }));
        }
Esempio n. 3
0
        public GameBoard(GameProperties properties, IEnumerable <Token> tokens)
        {
            this.properties = properties;
            this.tokens     = new Token[properties.Bounds.Rows, properties.Bounds.Cols];

            foreach (var token in tokens)
            {
                this.tokens[token.Row, token.Col] = token;
            }
        }