Beispiel #1
0
 public override CommonInterfaces.GameState Copy()
 {
     lock (this) {
         var gameState = new GameState();
         gameState.Players = Players.ConvertAll((p) => p.Copy());
         gameState.Coins   = Coins.ConvertAll((c) => c.Copy());
         gameState.Ghosts  = Ghosts.ConvertAll((g) => g.Copy());
         gameState.Walls   = Walls.ConvertAll((w) => w.Copy());
         gameState.Board   = Board.Copy();
         //last_inputs
         foreach (var input in lastInputs)
         {
             gameState.lastInputs.Add(input.Key, input.Value);
         }
         return(gameState);
     }
 }