예제 #1
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);
            }
        }
예제 #2
0
 public OsianLogic(MapObjectBase[,] gameMap, ReplayOrganizer organizer, params OsianOperationProvider[] operationProviders)
 {
     if (operationProviders.Length != 2)
     {
         throw new NotSupportedException();
     }
     Map     = new MapData();
     Map.Map = gameMap;
     organizer.Bind(this);
     ReplayOrganizer = organizer;
     Array.Copy(operationProviders, OperationProviders, operationProviders.Length);
     Players[0] = new OsianPlayer()
     {
         Direction = 1
     };
     Players[1] = new OsianPlayer()
     {
         Direction = -1
     };
 }
 public abstract Task UpdateGameData(OsianPlayer you, OsianPlayer opponent, MapData mapData);