Esempio n. 1
0
        public void RenderSetPiece(World world, IntPoint pos)
        {
            var t = new int[81, 81];

            for (int x = 0; x < Size; x++) //Flooring
            {
                for (int y = 0; y < Size; y++)
                {
                    double dx = x - (Size / 2.0);
                    double dy = y - (Size / 2.0);
                    double r  = Math.Sqrt(dx * dx + dy * dy) + rand.NextDouble() * 4 - 2;
                    if (r <= 35)
                    {
                        t[x, y] = 1;
                    }
                }
            }

            for (int x = 0; x < 17; x++) //Center
            {
                for (int y = 0; y < 17; y++)
                {
                    if (Center[x, y] != 0)
                    {
                        t[32 + x, 32 + y] = 2;
                    }
                }
            }

            t[36, 36] = t[44, 36] = t[36, 44] = t[44, 44] = 3; //Pillars
            t[30, 30] = t[50, 30] = t[30, 50] = t[50, 50] = 4;

            t[40, 26] = t[40, 27] = t[39, 27] = t[41, 27] = 4;
            t[40, 54] = t[40, 53] = t[39, 53] = t[41, 53] = 4;
            t[26, 40] = t[27, 40] = t[27, 39] = t[27, 41] = 4;
            t[54, 40] = t[53, 40] = t[53, 39] = t[53, 41] = 4;

            XmlData dat = world.Manager.Resources.GameData;

            for (int x = 0; x < Size; x++) //Rendering
            {
                for (int y = 0; y < Size; y++)
                {
                    if (t[x, y] == 1)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = dat.IdToTileType[Floor];
                        tile.ObjType = 0;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (t[x, y] == 2)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = dat.IdToTileType[Central];
                        tile.ObjType = 0;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (t[x, y] == 3)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = dat.IdToTileType[Central];
                        tile.ObjType = dat.IdToObjectType[Pillar];
                        tile.ObjCfg  = ConnectionComputer.GetConnString((_x, _y) => t[x + _x, y + _y] == 3);
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (t[x, y] == 4)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = dat.IdToTileType[Floor];
                        tile.ObjType = dat.IdToObjectType[Pillar];
                        tile.ObjCfg  = ConnectionComputer.GetConnString((_x, _y) => t[x + _x, y + _y] == 4);
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                }
            }

            Entity sphinx = Entity.Resolve(world.Manager, "Grand Sphinx");

            sphinx.Move(pos.X + 40.5f, pos.Y + 40.5f);
            world.EnterWorld(sphinx);
        }
Esempio n. 2
0
        private IEnumerable <ObjectDef> GetNewStatics(int xBase, int yBase)
        {
            var ret = new List <ObjectDef>();

            foreach (var i in Sight.GetSightCircle(Sightradius))
            {
                var x = i.X + xBase;
                var y = i.Y + yBase;
                if (x < 0 || x >= _mapWidth ||
                    y < 0 || y >= _mapHeight)
                {
                    continue;
                }

                var tile = Owner.Map[x, y];

                if (tile.ObjId == 0 || tile.ObjType == 0 || !_clientStatic.Add(new IntPoint(x, y)))
                {
                    continue;
                }
                var def = tile.ToDef(x, y);
                var cls = Manager.GameData.ObjectDescs[tile.ObjType].Class;
                if (cls == "ConnectedWall" || cls == "CaveWall")
                {
                    if (def.Stats.Stats.Count(_ => _.Key == StatsType.ObjectConnection && _.Value != null) == 0)
                    {
                        var stats = def.Stats.Stats.ToList();
                        stats.Add(new KeyValuePair <StatsType, object>(StatsType.ObjectConnection, (int)ConnectionComputer.Compute((xx, yy) => Owner.Map[x + xx, y + yy].ObjType == tile.ObjType).Bits));
                        def.Stats.Stats = stats.ToArray();
                    }
                }
                ret.Add(def);
            }
            return(ret);
        }
Esempio n. 3
0
        public void RenderSetPiece(World world, IntPoint pos)
        {
            int[,] t = new int[81, 81];
            for (int x = 0; x < Size; x++)
            {
                for (int y = 0; y < Size; y++)
                {
                    double dx = x - (Size / 2.0);
                    double dy = y - (Size / 2.0);
                    double r  = Math.Sqrt(dx * dx + dy * dy) + rand.NextDouble() * 4 - 2;
                    if (r <= 35)
                    {
                        t[x, y] = 1;
                    }
                }
            }

            for (int x = 0; x < 17; x++)
            {
                for (int y = 0; y < 17; y++)
                {
                    if (Center[x, y] != 0)
                    {
                        t[32 + x, 32 + y] = 2;
                    }
                }
            }

            t[36, 36] = t[44, 36] = t[36, 44] = t[44, 44] = 3; //Pillars (Solo Standing)

            t[30, 30] = t[50, 30] = t[30, 50] = t[50, 50] = 5; //Pillars (Outer Shape)
            t[29, 33] = t[47, 29] = t[51, 47] = t[33, 51] = 5;
            t[32, 29] = t[48, 51] = t[51, 32] = t[29, 48] = 5; // messy
            t[29, 31] = t[49, 29] = t[51, 49] = t[31, 51] = 5;
            t[30, 31] = t[49, 30] = t[50, 49] = t[31, 50] = 5;
            t[33, 29] = t[51, 33] = t[47, 51] = t[29, 47] = 5;
            t[29, 32] = t[51, 48] = t[48, 29] = t[32, 51] = 5; // messy
            t[31, 29] = t[51, 31] = t[49, 51] = t[29, 49] = 5;
            t[31, 30] = t[50, 31] = t[49, 50] = t[30, 49] = 5;

            t[40, 26] = t[40, 27] = t[39, 27] = t[41, 27] = 4; //Pillars (T Shape)
            t[40, 54] = t[40, 53] = t[39, 53] = t[41, 53] = 4;
            t[26, 40] = t[27, 40] = t[27, 39] = t[27, 41] = 4;
            t[54, 40] = t[53, 40] = t[53, 39] = t[53, 41] = 4;

            for (int x = 0; x < Size; x++)                      //Rendering
            {
                for (int y = 0; y < Size; y++)
                {
                    if (t[x, y] == 1)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId = Floor; tile.ObjType = 0;
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                    else if (t[x, y] == 2)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId = Central; tile.ObjType = 0;
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                    else if (t[x, y] == 3)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = Central;
                        tile.ObjType = Pillar;
                        tile.Name    = ConnectionComputer.GetConnString((_x, _y) => t[x + _x, y + _y] == 3);
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Obstacles[x + pos.X, y + pos.Y] = 2;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                    else if (t[x, y] == 4)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = Floor;
                        tile.ObjType = Pillar;
                        tile.Name    = ConnectionComputer.GetConnString((_x, _y) => t[x + _x, y + _y] == 4);
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Obstacles[x + pos.X, y + pos.Y] = 2;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                    else if (t[x, y] == 5)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = Floor;
                        tile.ObjType = Pillar;
                        tile.Name    = ConnectionComputer.GetConnString((_x, _y) => t[x + _x, y + _y] == 5);
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Obstacles[x + pos.X, y + pos.Y] = 2;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                }
            }

            Entity unknown = Entity.Resolve(0x0f02);

            unknown.Move(pos.X + 40.5f, pos.Y + 40.5f);
            world.EnterWorld(unknown);
        }
Esempio n. 4
0
        public void RenderSetPiece(World world, IntPoint pos)
        {
            var t = new int[81, 81];

            for (var x = 0; x < Size; x++) //Flooring
            {
                for (var y = 0; y < Size; y++)
                {
                    var dx = x - (Size / 2.0);
                    var dy = y - (Size / 2.0);
                    var r  = Math.Sqrt(dx * dx + dy * dy) + rand.NextDouble() * 4 - 2;
                    if (r <= 35)
                    {
                        t[x, y] = 1;
                    }
                }
            }

            for (var x = 0; x < 17; x++) //Center
            {
                for (var y = 0; y < 17; y++)
                {
                    if (Center[x, y] != 0)
                    {
                        t[32 + x, 32 + y] = 2;
                    }
                }
            }

            t[36, 36] = t[44, 36] = t[36, 44] = t[44, 44] = 3; //Pillars
            t[30, 30] = t[50, 30] = t[30, 50] = t[50, 50] = 4;

            t[40, 26] = t[40, 27] = t[39, 27] = t[41, 27] = 4;
            t[40, 54] = t[40, 53] = t[39, 53] = t[41, 53] = 4;
            t[26, 40] = t[27, 40] = t[27, 39] = t[27, 41] = 4;
            t[54, 40] = t[53, 40] = t[53, 39] = t[53, 41] = 4;


            for (var x = 0; x < Size; x++) //Rendering
            {
                for (var y = 0; y < Size; y++)
                {
                    if (t[x, y] == 1)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = Floor;
                        tile.ObjType = 0;
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                    else if (t[x, y] == 2)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = Central;
                        tile.ObjType = 0;
                        world.Obstacles[x + pos.X, y + pos.Y] = 0;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                    else if (t[x, y] == 3)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = Central;
                        tile.ObjType = Pillar;
                        tile.Name    = ConnectionComputer.GetConnString((_x, _y) => t[x + _x, y + _y] == 3);
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Obstacles[x + pos.X, y + pos.Y] = 2;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                    else if (t[x, y] == 4)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = Floor;
                        tile.ObjType = Pillar;
                        tile.Name    = ConnectionComputer.GetConnString((_x, _y) => t[x + _x, y + _y] == 4);
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Obstacles[x + pos.X, y + pos.Y] = 2;
                        world.Map[x + pos.X, y + pos.Y]       = tile;
                    }
                }
            }

            var sphinx = Entity.Resolve(0x0d54);

            sphinx.Move(pos.X + 40.5f, pos.Y + 40.5f);
            world.EnterWorld(sphinx);
        }
Esempio n. 5
0
        private IEnumerable<ObjectDef> GetNewStaticsComented () {
            // create a new variable to store all hashes of type 'ObjectDef'
            var RETURN_VAL = new HashSet<ObjectDef> ();

            // if 'Sigh' is null then return an empty hash
            if (Sight == null)
                return RETURN_VAL;
            /*
                ^^^ [!][Hint][!] ^^^

                // Variation for this could be (using C# 7.1+):

                if (Sight == null)
                    return default;
             */

            // create a new variable to store all entries of 'Sight' throught method 'GetSighCircle'
            // without repeated / duplicated entries (looks like 'HashSet' type in fact) to an
            // array type ('List' from LINQ for easy data manipulation)
            var CurrentCircle = Sight.GetSightCircle (0).Distinct ().ToList ();

            /*
                ^^^ [!][Hint][!] ^^^

                // Variation for this could be:

                if (CurrentTiles == null || _map == null)
                    return default;
             */

            // [Tip #1]: I recommend to avoid a possible 'Deadlock' mistake here adding this
            /*
                private var object _getNewStaticsLock = new object();

                private IEnumerable<ObjectDef> GetNewStatics () {
                    // previous code

                    lock (_getNewStaticsLock) 
                    {
                        // your code goes here such as loops checks etc to avoid override callbacks
                        // and a possible unsafe thread issue
                    }
                }
             */

            // do a loop throught 'CurrentCircle'
            foreach (var p in CurrentCircle) {
                // start validating throught loop statement

                // [Tip #2]: this check could be removed and validated outside loop
                // check if 'ClientTiles' or '_map' is null to ignore loop and try next entry
                if (ClientTiles == null || _map == null)
                    continue;

                // check if client tile updated amount is same than current map updated amount,
                // this also receive player positions X / Y to verify integrity of positions and
                // if invalid ignore loop and try next entry
                // [Warning!] Also check 'Tip #3'.
                if (ClientTiles[p.X, p.Y] != _map[p.X, p.Y].UpdateCount)
                    continue;

                // [Tip #3]: this check along '_clientStatics' could be removed and validated outside loop
                // using LINQ along 'Where' clausure
                /*
                    private IEnumerable<ObjectDef> GetNewStatics () {
                        // previous code

                        // using anti-deadlock statement
                        lock (_getNewStaticsLock) {
                            // other validations and such

                            foreach (var p in CurrentCircle.Where(plyr => !_clientStatics.Contains (plyr)
                                && ClientTiles[plyr.X, plyr.Y] != _map[plyr.X, plyr.Y].UpdateCount)) {
                                    // your code goes here
                                }
                        }
                    }
                 */
                // check if player contains in '_clientStatics' or via method 'DistPos' based on player position X / Y
                // is greater than '_sightRadius', if so then ignore loop and try next entry
                if (_clientStatics.Contains (p) || this.DistPos (new WorldPosition { X = p.X, Y = p.Y }) > _sightRadius)
                    continue;

                // create variables for player position X / Y
                /*
                    ^^^ [!][Hint][!] ^^^

                    // Variation for this could be (using C# 7.1+):
                    
                    var (pX, pY) = (p.X, p.Y); // this type does use anonymous method very similar than tuples
                */
                var pointX = p.X;
                var pointY = p.Y;

                // [Tip #4]: this check could be removed and validated inside loop conditions (already
                // validating a valid array for loop using LINQ along 'Where' clausure)
                /*
                    private IEnumerable<ObjectDef> GetNewStatics () {
                        // previous code

                        // using anti-deadlock statement
                        lock (_getNewStaticsLock) {
                            // other validations and such

                            foreach (var p in CurrentCircle.Where(plyr => !_clientStatics.Contains (plyr)
                                && ClientTiles[plyr.X, plyr.Y] != _map[plyr.X, plyr.Y].UpdateCount) &&
                                plyr.X < _mW && plyr.X >= 0 && plyr.Y < _mH && plyr.Y >= 0) {
                                    // your code goes here
                                }
                        }
                    }
                 */
                // check if player position X / Y isn't out of map bounds, if so then ignore loop and try next entry
                if (pointX >= _mW || pointX < 0 || pointY >= _mH || pointY < 0)
                    continue;

                // create a variable to get tile data based on player position on map instance
                var tile = _map[pointX, pointY];

                // verify if tile isn't invalid and player position X / Y doesn't contains already in
                // static elements
                if (tile.ObjectType == 0 || !_clientStatics.Add (new IntPoint (pointX, pointY)))
                    continue;

                // [Tip #5]: method 'ToDefinition' should be simplified along implementation, regarding variable of type
                // 'WorldTile' received along input from '_map' 2 arguments (X / Y) and could be stored internally
                /*
                    public class WorldTile {
                        // first option
                        public float X { get; set; }
                        public float Y { get; set; }

                        public ObjectDef ToDefinition() {
                            var x = X;
                            var y = Y;

                            // your code goes here
                        }
                    }

                    public class WorldTile {
                        // second option (using C# 7.1+)
                        public (float X, float Y) Position { get; set; }
                        
                        public ObjectDef ToDefinition() {
                            var x = Position.X;
                            var y = Position.Y;

                            // your code goes here
                        }
                    }
                 */
                // get definition of tile based on object 'tile' via method 'ToDefinition' based on player position
                var _tileDef = tile.ToDefinition (pointX, pointY);

                // get class ('string' type) based on dictionary 'ObjectDescs'
                string Object_Class = Program.GameData.ObjectDescs[tile.ObjectType].Class;

                // if 'Object_Class' is equal than 'ConnectedWall' or 'CaveWall' then go inside this statement
                if (Object_Class == "ConnectedWall" || Object_Class == "CaveWall") {
                    bool Has_Connection_StatData = false;

                    // do a loop through all stats and validate if stat key is equals than definition 'ObjectConnection' and
                    // stat value property isn't null, if so set 'Has_Connection_StatData'.
                    // [Warning!] variable 'Has_Connection_StatData' could be overrided!
                    // [Tip #6]: this statement could be simplified
                    /*
                        // previous code

                        foreach (var stat in _tileDef.ObjectStats.Stats)
                            if (stat.Key == StatsType.ObjectConnection && stat.Value != null) {
                                Has_Connection_StatData = true; // set this variable to true once, because
                                // only one entry in this loop is enough to check
                                break;
                            }

                        // rest of code
                    */
                    foreach (var STAT in _tileDef.ObjStats.Stats)
                        if (STAT.Key == StatsType.ObjectConnection && STAT.Value != null)
                            Has_Connection_StatData = true;

                    // once variable 'Has_Connection_StatData' is true, execute this statement below
                    if (!Has_Connection_StatData) {
                        // create a variable to store all stats to an array
                        var stats = _tileDef.ObjStats.Stats.ToList ();

                        // add stat (using statements with conditions) to array 'stats'
                        stats.Add (new KeyValuePair<StatsType, object> (StatsType.ObjectConnection, (int) ConnectionComputer.Compute ((xx, yy) => Owner?.GameMap[pointX + xx, pointY + yy].ObjectType == tile.ObjectType).Bits));

                        // override variable '_tileDef' after validation and convert if from 'List<T>' to 'Array<T>'
                        _tileDef.ObjStats.Stats = stats.ToArray ();

                        // clean array 'stats'
                        stats.Clear ();
                    }
                }
            }
        }
Esempio n. 6
0
    private IEnumerable<ObjectDef> GetNewStaticsV1 () {
        if (Sight == null)
            return default;

        var currentCircle = Sight.GetSightCircle (0).Distinct ().ToList ();

        foreach (var elem in currentCircle) {
            if (ClientTiles == null || _map == null)
                continue;

            if (ClientTiles[elem.X, elem.Y] != _map[elem.X, elem.Y].UpdateCount)
                continue;

            if (_clientStatics.Contains (elem) || this.DistPos (new WorldPosition { X = elem.X, Y = elem.Y }) > _sightRadius)
                continue;

            var (x, y) = (elem.X, elem.Y);

            if (x >= _mW || x < 0 || y >= _mH || y < 0)
                continue;

            var tile = _map[x, y];

            if (tile.ObjectType == 0 || !_clientStatics.Add (new IntPoint (x, y)))
                continue;

            var tileDef = tile.ToDefinition (x, y);

            var oClass = Program.GameData.ObjectDescs[tile.ObjectType].Class.ToString ();

            if (oClass == "ConnectedWall" || oClass == "CaveWall") {
                var hasConnStatData = false;
                foreach (var STAT in tileDef.ObjStats.Stats)
                    if (STAT.Key == StatsType.ObjectConnection && STAT.Value != null)
                        hasConnStatData = true;

                if (!hasConnStatData) {
                    var stats = _tileDef.ObjStats.Stats.ToList ();
                    stats.Add (new KeyValuePair<StatsType, object> (StatsType.ObjectConnection, (int) ConnectionComputer.Compute ((xx, yy) => Owner?.GameMap[x + xx, y + yy].ObjectType == tile.ObjectType).Bits));
                    tileDef.ObjStats.Stats = stats.ToArray ();
                    stats.Clear ();
                }
            }
        }
Esempio n. 7
0
        private IEnumerable <ObjectDef> GetNewStatics(int xBase, int yBase)
        {
            World world = GameServer.Manager.GetWorld(Owner.Id);

            blocksight = (world.Dungeon ? Sight.RayCast(this, 15) : Sight.GetSightCircle(SIGHTRADIUS)).ToList();
            List <ObjectDef> ret = new List <ObjectDef>();

            foreach (IntPoint i in blocksight.ToList())
            {
                var x = i.X + xBase;
                var y = i.Y + yBase;
                if (x < 0 || x >= mapWidth ||
                    y < 0 || y >= mapHeight)
                {
                    continue;
                }

                var tile = Owner.Map[x, y];

                if (tile.ObjId == 0 || tile.ObjType == 0 || !clientStatic.Add(new IntPoint(x, y)))
                {
                    continue;
                }
                var def = tile.ToDef(x, y);
                var cls = GameServer.Manager.GameData.ObjectDescs[tile.ObjType].Class;
                if (cls == "ConnectedWall" || cls == "CaveWall")
                {
                    if (def.Stats.Stats.Count(_ => _.Key == StatsType.CONNECT_STAT && _.Value != null) == 0)
                    {
                        var stats = def.Stats.Stats.ToList();
                        stats.Add(new KeyValuePair <StatsType, object>(StatsType.CONNECT_STAT, (int)ConnectionComputer.Compute((xx, yy) => Owner.Map[x + xx, y + yy].ObjType == tile.ObjType).Bits));
                        def.Stats.Stats = stats.ToArray();
                    }
                }
                ret?.Add(def);
            }
            return(ret);
        }
Esempio n. 8
0
        public void RenderSetPiece(World world, IntPoint pos)
        {
            var     t   = new int[41, 41];
            XmlData dat = world.Manager.Resources.GameData;

            for (int x = 0; x < Size; x++) //Flooring
            {
                for (int y = 0; y < Size; y++)
                {
                    double dx = x - (Size / 2.0);
                    double dy = y - (Size / 2.0);
                    double rr = Math.Sqrt(dx * dx + dy * dy) + rand.NextDouble() * 4 - 2;
                    var    r  = rand.NextDouble();
                    if (rr <= 37)
                    {
                        t[x, y] = 2;
                    }
                    else if (r <= 0.6 && rr <= 38)
                    {
                        t[x, y] = 0;
                    }
                }
            }

            for (int x = 0; x < 33; x++) //Center
            {
                for (int y = 0; y < 33; y++)
                {
                    if (Center[x, y] == 2)
                    {
                        t[4 + x, 4 + y] = 2;
                    }
                    if (Center[x, y] == 1)
                    {
                        t[4 + x, 4 + y] = 1;
                    }
                    if (Center[x, y] == 3)
                    {
                        t[4 + x, 4 + y] = 3;
                    }
                    if (Center[x, y] == 4)
                    {
                        t[4 + x, 4 + y] = 4;
                    }
                }
            }
            for (int x = 0; x < Size; x++) //Rendering
            {
                for (int y = 0; y < Size; y++)
                {
                    if (t[x, y] == 1)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = dat.IdToTileType[Central];
                        tile.ObjType = 0;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (t[x, y] == 2)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = dat.IdToTileType[Floor];
                        tile.ObjType = 0;
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (t[x, y] == 3)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = dat.IdToTileType[CFloor];
                        tile.ObjType = 0;

                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                    else if (t[x, y] == 4)
                    {
                        var tile = world.Map[x + pos.X, y + pos.Y].Clone();
                        tile.TileId  = dat.IdToTileType[Floor];
                        tile.ObjType = dat.IdToObjectType[Pillar];
                        tile.ObjCfg  = ConnectionComputer.GetConnString((_x, _y) => t[x + _x, y + _y] == 4);
                        if (tile.ObjId == 0)
                        {
                            tile.ObjId = world.GetNextEntityId();
                        }
                        world.Map[x + pos.X, y + pos.Y] = tile;
                    }
                }
            }

            Entity rockdrag = Entity.Resolve(world.Manager, "Dragon Head");

            rockdrag.Move(pos.X + 20.5f, pos.Y + 20.5f);
            world.EnterWorld(rockdrag);
        }