示例#1
0
        public async Task CreateShips(string coordinates)
        {
            var shipsCoordinates = _coordinatesParser.Parse(coordinates).ToList();
            var battle           = await _battleRepository.GetBattle();

            battle.CreateShips(shipsCoordinates);
            await _battleRepository.UpdateBattle(battle);
        }
示例#2
0
        public async Task ClearBattle()
        {
            var battle = await _battleRepository.GetBattle();

            battle.Clear();
            await _battleRepository.UpdateBattle(battle);
        }
示例#3
0
        public async Task <BattleStatistics> GetStatistics()
        {
            var battle = await _battleRepository.GetBattle();

            return(battle.GetStatistics());
        }