Beispiel #1
0
        internal void OnDeserializedMethod(StreamingContext context)
        {
            //DiagManager.Instance.LogInfo(String.Format("GroundMap.OnDeserializedMethod(): Map {0} deserialized!", AssetName));

            //recompute the grid
            grid = new AABB.Grid(Width, Height, GraphicsManager.TileSize);

            //Because we clear those on save, we'll need to assign a new array here

            if (Spawners == null)
            {
                Spawners = new List <GroundSpawner>();
            }

            //Make sure the temp char array is instantiated
            TemporaryChars = new List <GroundChar>();

            //reconnect characters and objects references
            foreach (GroundChar player in IterateCharacters())
            {
                if (player != null)
                {
                    player.OnDeserializeMap(this);
                    signCharToMap(player);
                }
            }
            foreach (GroundObject groundObj in GroundObjects)
            {
                groundObj.OnDeserializeMap(this);
                grid.Add(groundObj);
            }
        }
Beispiel #2
0
 private void signCharToMap(GroundChar groundChar)
 {
     groundChar.Map = this;
     grid.Add(groundChar);
 }