예제 #1
0
        private List <Point> CreatePlatformsList()
        {
            List <Point> pointList = new List <Point>();

            Microsoft.Xna.Framework.Rectangle topRoom    = this.TopRoom;
            Microsoft.Xna.Framework.Rectangle bottomRoom = this.BottomRoom;
            int exitX;

            if (HouseBuilder.FindVerticalExit(new Microsoft.Xna.Framework.Rectangle(topRoom.X + 2, topRoom.Y, topRoom.Width - 4, 1), true, out exitX))
            {
                pointList.Add(new Point(exitX, topRoom.Y));
            }
            if (HouseBuilder.FindVerticalExit(new Microsoft.Xna.Framework.Rectangle(bottomRoom.X + 2, bottomRoom.Y + bottomRoom.Height - 1, bottomRoom.Width - 4, 1), false, out exitX))
            {
                pointList.Add(new Point(exitX, bottomRoom.Y + bottomRoom.Height - 1));
            }
            return(pointList);
        }
예제 #2
0
        private List <Point> CreateDoorList()
        {
            List <Point> pointList = new List <Point>();

            foreach (Microsoft.Xna.Framework.Rectangle room in this.Rooms)
            {
                int exitY;
                if (HouseBuilder.FindSideExit(new Microsoft.Xna.Framework.Rectangle(room.X + room.Width, room.Y + 1, 1, room.Height - 2), false, out exitY))
                {
                    pointList.Add(new Point(room.X + room.Width - 1, exitY));
                }
                if (HouseBuilder.FindSideExit(new Microsoft.Xna.Framework.Rectangle(room.X, room.Y + 1, 1, room.Height - 2), true, out exitY))
                {
                    pointList.Add(new Point(room.X, exitY));
                }
            }
            return(pointList);
        }