Esempio n. 1
0
        public async Task <RoundResult> PerformNextRoundAsync()
        {
            _roundNumber++;

            _movementService.ExpiryExplosions();
            await DelayHelper.DelayAsync(_delayTime);

            _movementService.PerformMissilesMove();
            await DelayHelper.DelayAsync(_delayTime);

            //call winner
            if (_antWarsViewModel.MovableObjectsCollection.OfType <AntModel>().Count() <= 1)
            {
                return(new RoundResult
                {
                    FinalResult = _botService.GetBotResults(),
                    IsFinished = true,
                    History = new List <RoundPartialHistory>()
                });
            }

            var partialResults = await _movementService.PlayAntsMoveAsync(200, _roundNumber);

            return(new RoundResult
            {
                FinalResult = null,
                IsFinished = false,
                History = partialResults,
            });
        }