Esempio n. 1
0
        public void loadRoomLinkers()
        {
            foreach (RoomLinker roomLinker in mGen.roomLinkers)
            {
                MapBound botMapBound = new MapBound();
                MapBound topMapBound = new MapBound();
                if (roomLinker.botWallList.Count > 0)
                {
                    foreach (Wall wall in roomLinker.botWallList)
                    {
                        // Debug.WriteLine("OH {0}/{1} - {2}/{3}", wall.ptA.X, wall.ptA.Y, wall.ptB.X, wall.ptB.Y);
                        botMapBound.addVertex(wall.ptA, wall.ptB);
                    }
                    botMapBound.finilizeMap();
                }

                if (roomLinker.topWallList.Count > 0)
                {
                    foreach (Wall wall in roomLinker.topWallList)
                    {
                        // Debug.WriteLine("AH {0}/{1} - {2}/{3}", wall.ptA.X, wall.ptA.Y, wall.ptB.X, wall.ptB.Y);
                        topMapBound.addVertex(wall.ptA, wall.ptB);
                    }
                    topMapBound.finilizeMap();
                }
            }
        }
Esempio n. 2
0
        public void loadRoomWalls()
        {
            foreach (Room room in mGen.rooms)
            {
                int      indexWall = 0;
                int      objIndex  = 0;
                MapBound mapBound  = new MapBound();

                MapBoundDict.Add(new KeyValuePair <Room, MapBound>(room, mapBound));
                foreach (Wall wall in room.wallList)
                {
                    // Debug.WriteLine("{0}/{1} - {2}/{3} => {4}", wall.ptA.X, wall.ptA.Y, wall.ptB.X, wall.ptB.Y, objIndex);
                    this.updateMinMaxMap(wall);
                    this.updateMinMaxRoom(room, wall, indexWall == 0);
                    if (wall.objIndex != objIndex)
                    {
                        mapBound.finilizeMap();
                        if (wall.objIndex != objIndex)
                        {
                            mapBound = new MapBound();
                            MapBoundDict.Add(new KeyValuePair <Room, MapBound>(room, mapBound));
                        }
                        objIndex++;
                    }
                    mapBound.addVertex(wall.ptA, wall.ptB);
                    indexWall++;
                }
                mapBound.finilizeMap();
                // Debug.WriteLine("ROOM {0}/{1} - {2}/{3}", room.minX, room.minY, room.maxX, room.maxY);
            }
            // Debug.WriteLine("MAP {0}/{1} - {2}/{3}", minX, minY, maxX, maxY);
        }