Exemplo n.º 1
0
        public static void __Resize(int x, int y, int z)
        {
            var old_map = __Map;

            __Map = new Game.Tile[x, y, z];

            // LOOKS LIKE THE WHOLE ZONE SINGLETON THING ISNT HANDLED IN A FUCKY WAY -- HOORAY! (still need to investigate!)
            Game.Zone zone_instance = __GetZoneInstance(Game13.default_zone);

            for (int ix = 0; ix < x; ix++)
            {
                for (int iy = 0; iy < y; iy++)
                {
                    for (int iz = 0; iz < z; iz++)
                    {
                        if (ix < old_map.GetLength(0) && iy < old_map.GetLength(1) && iz < old_map.GetLength(2))
                        {
                            __Map[ix, iy, iz] = old_map[ix, iy, iz];
                        }
                        else
                        {
                            Game.Tile tile_instance = Base_Tile.RawCreate(Game13.default_tile, ix + 1, iy + 1, iz + 1);

                            zone_instance.contents.Add(tile_instance);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
 public Base_Tile(dynamic loc)
 {
     if (loc != null)
     {
         if (loc is Base_Tile)
         {
             Base_Tile old_tile = (Base_Tile)loc;
             _x          = old_tile._x;
             _y          = old_tile._y;
             _z          = old_tile._z;
             old_tile._x = -1;
             old_tile._y = -1;
             old_tile._z = -1;
             _contents   = new EntContentsTable(this, (EntContentsTable)old_tile.contents);
             if (old_tile._loc != null)
             {
                 old_tile._loc.contents.Add(this);
                 old_tile._loc.contents.Remove(old_tile);
             }
             Map13.__Map[_x - 1, _y - 1, _z - 1] = (Game.Tile) this;
         }
         else
         {
             throw new Exception("BAD LOC FOR TILE!");
         }
     }
     else
     {
         _contents = new EntContentsTable(this);
         if (use_next)
         {
             _x = next_x;
             _y = next_y;
             _z = next_z;
             Map13.__Map[_x - 1, _y - 1, _z - 1] = (Game.Tile) this;
         }
     }
 }