Beispiel #1
0
        /// <summary>
        /// TileDictionnaries and names are serialized in a region wide list, not directly in the list.
        /// So when deserializing, SaveExtra needs to be called to save for later use.
        /// </summary>
        public void SaveExtra()
        {
            extras = new List <TileExtra> ();

            for (int i = 0; i < _size; i++)
            {
                for (int j = 0; j < _size; j++)
                {
                    Tile tile = Get(i, j);

                    if (tile != null && (tile.dictionary != null || !string.IsNullOrEmpty(tile.name)))
                    {
                        TileExtra extra = tile.GetExtra();
                        extra.x = i;
                        extra.y = j;
                        extras.Add(extra);
                    }
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// Load extra information (dictionary and name).
 /// </summary>
 public void ApplyExtra(TileExtra extra)
 {
     dictionary = extra.dictionary;
     name       = extra.name;
 }