Beispiel #1
0
        public async Task StartGame(OsianOperationProvider operationProvider)
        {
            var op = await operationProvider.NextOperation();

            if (!(op is EndTurnOperation))
            {
                throw new InvalidGameOperationException("Launch! expected at game start.");
            }
        }
Beispiel #2
0
        public async Task PlayerMove(OsianPlayer player, OsianPlayer opponent, OsianOperationProvider operationProvider)
        {
            await operationProvider.UpdateGameData(player, opponent, Map);

            while (true)
            {
                var op = await operationProvider.NextOperation();

                if (op is EndTurnOperation)
                {
                    break;
                }
                op.Invoke(player, Map);
            }
        }