コード例 #1
0
ファイル: GameService.cs プロジェクト: angels2it/VirtualRisks
        private async Task AddSoldierForAcceptStep(Guid gameId)
        {
            var gameStream = await Build(gameId, string.Empty, -1);

            var userFirstSoldier = _gameDomainService.GetCreateSoldierEvent(gameId, Army.Blue, gameStream.UserProducedTroopTypes.First(),
                                                                            gameStream.UserId, true);
            var userCreateSoldier = _gameDomainService.GetCreateSoldierEvent(gameId, Army.Blue, gameStream.UserProducedTroopTypes.First(),
                                                                             gameStream.UserId);
            var opponentFirstSoldier = _gameDomainService.GetCreateSoldierEvent(gameId, Army.Red, gameStream.UserProducedTroopTypes.First(),
                                                                                gameStream.OpponentId, true);
            var opponentCreateSoldier = _gameDomainService.GetCreateSoldierEvent(gameId, Army.Red, gameStream.UserProducedTroopTypes.First(),
                                                                                 gameStream.OpponentId);

            _domain.AddEvent(gameId, userFirstSoldier, userCreateSoldier, opponentFirstSoldier, opponentCreateSoldier);
        }