// Token: 0x0600108E RID: 4238 RVA: 0x001543F0 File Offset: 0x001525F0
 public bool isTileOnWall(int x, int y)
 {
     foreach (Microsoft.Xna.Framework.Rectangle r in DecoratableLocation.getWalls())
     {
         if (r.Contains(x, y))
         {
             return(true);
         }
     }
     return(false);
 }
        public override void TransferDataFromSavedLocation(GameLocation l)
        {
            DecoratableLocation decoratable_location = l as DecoratableLocation;

            if (decoratable_location != null)
            {
                wallPaper.Set(decoratable_location.wallPaper);
                floor.Set(decoratable_location.floor);
            }
            setWallpapers();
            setFloors();
            base.TransferDataFromSavedLocation(l);
        }
        // Token: 0x06001094 RID: 4244 RVA: 0x00154794 File Offset: 0x00152994
        public int getFloorAt(Point p)
        {
            List <Microsoft.Xna.Framework.Rectangle> floors = DecoratableLocation.getFloors();

            for (int i = 0; i < floors.Count; i++)
            {
                if (floors[i].Contains(p))
                {
                    return(i);
                }
            }
            return(-1);
        }
        // Token: 0x06001096 RID: 4246 RVA: 0x001547FC File Offset: 0x001529FC
        public int getWallForRoomAt(Point p)
        {
            List <Microsoft.Xna.Framework.Rectangle> walls = DecoratableLocation.getWalls();

            for (int y = 0; y < 16; y++)
            {
                for (int i = 0; i < walls.Count; i++)
                {
                    if (walls[i].Contains(p))
                    {
                        return(i);
                    }
                }
                p.Y--;
            }
            return(-1);
        }
Exemplo n.º 5
0
        public int getWallForRoomAt(Point p)
        {
            List <Microsoft.Xna.Framework.Rectangle> walls = DecoratableLocation.getWalls();

            for (int index1 = 0; index1 < 16; ++index1)
            {
                for (int index2 = 0; index2 < walls.Count; ++index2)
                {
                    if (walls[index2].Contains(p))
                    {
                        return(index2);
                    }
                }
                --p.Y;
            }
            return(-1);
        }
        // Token: 0x06001097 RID: 4247 RVA: 0x00154850 File Offset: 0x00152A50
        public virtual void setFloor(int which, int whichRoom = -1, bool persist = false)
        {
            List <Microsoft.Xna.Framework.Rectangle> rooms = DecoratableLocation.getFloors();

            if (persist)
            {
                while (this.floor.Count < rooms.Count)
                {
                    this.floor.Add(0);
                }
                if (whichRoom == -1)
                {
                    for (int i = 0; i < this.floor.Count; i++)
                    {
                        this.floor[i] = which;
                    }
                }
                else
                {
                    if (whichRoom > this.floor.Count - 1)
                    {
                        return;
                    }
                    this.floor[whichRoom] = which;
                }
            }
            int tileSheetIndex = 336 + which % 8 * 2 + which / 8 * 32;

            if (whichRoom == -1)
            {
                using (List <Microsoft.Xna.Framework.Rectangle> .Enumerator enumerator = rooms.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Microsoft.Xna.Framework.Rectangle r = enumerator.Current;
                        for (int x = r.X; x < r.Right; x += 2)
                        {
                            for (int y = r.Y; y < r.Bottom; y += 2)
                            {
                                if (r.Contains(x, y))
                                {
                                    base.setMapTileIndex(x, y, tileSheetIndex, "Back", 0);
                                }
                                if (r.Contains(x + 1, y))
                                {
                                    base.setMapTileIndex(x + 1, y, tileSheetIndex + 1, "Back", 0);
                                }
                                if (r.Contains(x, y + 1))
                                {
                                    base.setMapTileIndex(x, y + 1, tileSheetIndex + 16, "Back", 0);
                                }
                                if (r.Contains(x + 1, y + 1))
                                {
                                    base.setMapTileIndex(x + 1, y + 1, tileSheetIndex + 17, "Back", 0);
                                }
                            }
                        }
                    }
                    return;
                }
            }
            Microsoft.Xna.Framework.Rectangle r2 = rooms[whichRoom];
            for (int x2 = r2.X; x2 < r2.Right; x2 += 2)
            {
                for (int y2 = r2.Y; y2 < r2.Bottom; y2 += 2)
                {
                    if (r2.Contains(x2, y2))
                    {
                        base.setMapTileIndex(x2, y2, tileSheetIndex, "Back", 0);
                    }
                    if (r2.Contains(x2 + 1, y2))
                    {
                        base.setMapTileIndex(x2 + 1, y2, tileSheetIndex + 1, "Back", 0);
                    }
                    if (r2.Contains(x2, y2 + 1))
                    {
                        base.setMapTileIndex(x2, y2 + 1, tileSheetIndex + 16, "Back", 0);
                    }
                    if (r2.Contains(x2 + 1, y2 + 1))
                    {
                        base.setMapTileIndex(x2 + 1, y2 + 1, tileSheetIndex + 17, "Back", 0);
                    }
                }
            }
        }
        // Token: 0x06001092 RID: 4242 RVA: 0x001544D8 File Offset: 0x001526D8
        public virtual void setWallpaper(int which, int whichRoom = -1, bool persist = false)
        {
            List <Microsoft.Xna.Framework.Rectangle> rooms = DecoratableLocation.getWalls();

            if (persist)
            {
                while (this.wallPaper.Count < rooms.Count)
                {
                    this.wallPaper.Add(0);
                }
                if (whichRoom == -1)
                {
                    for (int i = 0; i < this.wallPaper.Count; i++)
                    {
                        this.wallPaper[i] = which;
                    }
                }
                else if (whichRoom <= this.wallPaper.Count - 1)
                {
                    this.wallPaper[whichRoom] = which;
                }
            }
            int tileSheetIndex = which % 16 + which / 16 * 48;

            if (whichRoom == -1)
            {
                using (List <Microsoft.Xna.Framework.Rectangle> .Enumerator enumerator = rooms.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Microsoft.Xna.Framework.Rectangle r = enumerator.Current;
                        for (int x = r.X; x < r.Right; x++)
                        {
                            base.setMapTileIndex(x, r.Y, tileSheetIndex, "Back", 0);
                            base.setMapTileIndex(x, r.Y + 1, tileSheetIndex + 16, "Back", 0);
                            if (r.Height >= 3)
                            {
                                if (this.map.GetLayer("Buildings").Tiles[x, r.Y + 2].TileSheet.Equals(this.map.TileSheets[2]))
                                {
                                    base.setMapTileIndex(x, r.Y + 2, tileSheetIndex + 32, "Buildings", 0);
                                }
                                else
                                {
                                    base.setMapTileIndex(x, r.Y + 2, tileSheetIndex + 32, "Back", 0);
                                }
                            }
                        }
                    }
                    return;
                }
            }
            Microsoft.Xna.Framework.Rectangle r2 = rooms[Math.Min(rooms.Count - 1, whichRoom)];
            for (int x2 = r2.X; x2 < r2.Right; x2++)
            {
                base.setMapTileIndex(x2, r2.Y, tileSheetIndex, "Back", 0);
                base.setMapTileIndex(x2, r2.Y + 1, tileSheetIndex + 16, "Back", 0);
                if (r2.Height >= 3)
                {
                    if (this.map.GetLayer("Buildings").Tiles[x2, r2.Y + 2].TileSheet.Equals(this.map.TileSheets[2]))
                    {
                        base.setMapTileIndex(x2, r2.Y + 2, tileSheetIndex + 32, "Buildings", 0);
                    }
                    else
                    {
                        base.setMapTileIndex(x2, r2.Y + 2, tileSheetIndex + 32, "Back", 0);
                    }
                }
            }
        }
Exemplo n.º 8
0
        public virtual void setFloor(int which, int whichRoom = -1, bool persist = false)
        {
            List <Microsoft.Xna.Framework.Rectangle> floors = DecoratableLocation.getFloors();

            if (persist)
            {
                while (this.floor.Count < floors.Count)
                {
                    this.floor.Add(0);
                }
                if (whichRoom == -1)
                {
                    for (int index = 0; index < this.floor.Count; ++index)
                    {
                        this.floor[index] = which;
                    }
                }
                else
                {
                    if (whichRoom > this.floor.Count - 1)
                    {
                        return;
                    }
                    this.floor[whichRoom] = which;
                }
            }
            int index1 = 336 + which % 8 * 2 + which / 8 * 32;

            if (whichRoom == -1)
            {
                foreach (Microsoft.Xna.Framework.Rectangle rectangle in floors)
                {
                    int x = rectangle.X;
                    while (x < rectangle.Right)
                    {
                        int y = rectangle.Y;
                        while (y < rectangle.Bottom)
                        {
                            if (rectangle.Contains(x, y))
                            {
                                this.setMapTileIndex(x, y, index1, "Back", 0);
                            }
                            if (rectangle.Contains(x + 1, y))
                            {
                                this.setMapTileIndex(x + 1, y, index1 + 1, "Back", 0);
                            }
                            if (rectangle.Contains(x, y + 1))
                            {
                                this.setMapTileIndex(x, y + 1, index1 + 16, "Back", 0);
                            }
                            if (rectangle.Contains(x + 1, y + 1))
                            {
                                this.setMapTileIndex(x + 1, y + 1, index1 + 17, "Back", 0);
                            }
                            y += 2;
                        }
                        x += 2;
                    }
                }
            }
            else
            {
                Microsoft.Xna.Framework.Rectangle rectangle = floors[whichRoom];
                int x = rectangle.X;
                while (x < rectangle.Right)
                {
                    int y = rectangle.Y;
                    while (y < rectangle.Bottom)
                    {
                        if (rectangle.Contains(x, y))
                        {
                            this.setMapTileIndex(x, y, index1, "Back", 0);
                        }
                        if (rectangle.Contains(x + 1, y))
                        {
                            this.setMapTileIndex(x + 1, y, index1 + 1, "Back", 0);
                        }
                        if (rectangle.Contains(x, y + 1))
                        {
                            this.setMapTileIndex(x, y + 1, index1 + 16, "Back", 0);
                        }
                        if (rectangle.Contains(x + 1, y + 1))
                        {
                            this.setMapTileIndex(x + 1, y + 1, index1 + 17, "Back", 0);
                        }
                        y += 2;
                    }
                    x += 2;
                }
            }
        }
Exemplo n.º 9
0
        public virtual void setWallpaper(int which, int whichRoom = -1, bool persist = false)
        {
            List <Microsoft.Xna.Framework.Rectangle> walls = DecoratableLocation.getWalls();

            if (persist)
            {
                while (this.wallPaper.Count < walls.Count)
                {
                    this.wallPaper.Add(0);
                }
                if (whichRoom == -1)
                {
                    for (int index = 0; index < this.wallPaper.Count; ++index)
                    {
                        this.wallPaper[index] = which;
                    }
                }
                else if (whichRoom <= this.wallPaper.Count - 1)
                {
                    this.wallPaper[whichRoom] = which;
                }
            }
            int index1 = which % 16 + which / 16 * 48;

            if (whichRoom == -1)
            {
                foreach (Microsoft.Xna.Framework.Rectangle rectangle in walls)
                {
                    for (int x = rectangle.X; x < rectangle.Right; ++x)
                    {
                        this.setMapTileIndex(x, rectangle.Y, index1, "Back", 0);
                        this.setMapTileIndex(x, rectangle.Y + 1, index1 + 16, "Back", 0);
                        if (rectangle.Height >= 3)
                        {
                            if (this.map.GetLayer("Buildings").Tiles[x, rectangle.Y + 2].TileSheet.Equals((object)this.map.TileSheets[2]))
                            {
                                this.setMapTileIndex(x, rectangle.Y + 2, index1 + 32, "Buildings", 0);
                            }
                            else
                            {
                                this.setMapTileIndex(x, rectangle.Y + 2, index1 + 32, "Back", 0);
                            }
                        }
                    }
                }
            }
            else
            {
                Microsoft.Xna.Framework.Rectangle rectangle = walls[Math.Min(walls.Count - 1, whichRoom)];
                for (int x = rectangle.X; x < rectangle.Right; ++x)
                {
                    this.setMapTileIndex(x, rectangle.Y, index1, "Back", 0);
                    this.setMapTileIndex(x, rectangle.Y + 1, index1 + 16, "Back", 0);
                    if (rectangle.Height >= 3)
                    {
                        if (this.map.GetLayer("Buildings").Tiles[x, rectangle.Y + 2].TileSheet.Equals((object)this.map.TileSheets[2]))
                        {
                            this.setMapTileIndex(x, rectangle.Y + 2, index1 + 32, "Buildings", 0);
                        }
                        else
                        {
                            this.setMapTileIndex(x, rectangle.Y + 2, index1 + 32, "Back", 0);
                        }
                    }
                }
            }
        }
Exemplo n.º 10
0
        public virtual void setFloor(int which, int whichRoom = -1, bool persist = false)
        {
            List <Microsoft.Xna.Framework.Rectangle> floors = DecoratableLocation.getFloors();

            if (persist)
            {
                while (this.floor.Count < floors.Count)
                {
                    this.floor.Add(0);
                }
                if (whichRoom == -1)
                {
                    for (int i = 0; i < this.floor.Count; i++)
                    {
                        this.floor[i] = which;
                    }
                }
                else
                {
                    if (whichRoom > this.floor.Count - 1)
                    {
                        return;
                    }
                    this.floor[whichRoom] = which;
                }
            }
            int num = 336 + which % 8 * 2 + which / 8 * 32;

            if (whichRoom == -1)
            {
                using (List <Microsoft.Xna.Framework.Rectangle> .Enumerator enumerator = floors.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Microsoft.Xna.Framework.Rectangle current = enumerator.Current;
                        for (int j = current.X; j < current.Right; j += 2)
                        {
                            for (int k = current.Y; k < current.Bottom; k += 2)
                            {
                                if (current.Contains(j, k))
                                {
                                    base.setMapTileIndex(j, k, num, "Back", 0);
                                }
                                if (current.Contains(j + 1, k))
                                {
                                    base.setMapTileIndex(j + 1, k, num + 1, "Back", 0);
                                }
                                if (current.Contains(j, k + 1))
                                {
                                    base.setMapTileIndex(j, k + 1, num + 16, "Back", 0);
                                }
                                if (current.Contains(j + 1, k + 1))
                                {
                                    base.setMapTileIndex(j + 1, k + 1, num + 17, "Back", 0);
                                }
                            }
                        }
                    }
                    return;
                }
            }
            Microsoft.Xna.Framework.Rectangle rectangle = floors[whichRoom];
            for (int l = rectangle.X; l < rectangle.Right; l += 2)
            {
                for (int m = rectangle.Y; m < rectangle.Bottom; m += 2)
                {
                    if (rectangle.Contains(l, m))
                    {
                        base.setMapTileIndex(l, m, num, "Back", 0);
                    }
                    if (rectangle.Contains(l + 1, m))
                    {
                        base.setMapTileIndex(l + 1, m, num + 1, "Back", 0);
                    }
                    if (rectangle.Contains(l, m + 1))
                    {
                        base.setMapTileIndex(l, m + 1, num + 16, "Back", 0);
                    }
                    if (rectangle.Contains(l + 1, m + 1))
                    {
                        base.setMapTileIndex(l + 1, m + 1, num + 17, "Back", 0);
                    }
                }
            }
        }
Exemplo n.º 11
0
        public virtual void setWallpaper(int which, int whichRoom = -1, bool persist = false)
        {
            List <Microsoft.Xna.Framework.Rectangle> walls = DecoratableLocation.getWalls();

            if (persist)
            {
                while (this.wallPaper.Count < walls.Count)
                {
                    this.wallPaper.Add(0);
                }
                if (whichRoom == -1)
                {
                    for (int i = 0; i < this.wallPaper.Count; i++)
                    {
                        this.wallPaper[i] = which;
                    }
                }
                else if (whichRoom <= this.wallPaper.Count - 1)
                {
                    this.wallPaper[whichRoom] = which;
                }
            }
            int num = which % 16 + which / 16 * 48;

            if (whichRoom == -1)
            {
                using (List <Microsoft.Xna.Framework.Rectangle> .Enumerator enumerator = walls.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Microsoft.Xna.Framework.Rectangle current = enumerator.Current;
                        for (int j = current.X; j < current.Right; j++)
                        {
                            base.setMapTileIndex(j, current.Y, num, "Back", 0);
                            base.setMapTileIndex(j, current.Y + 1, num + 16, "Back", 0);
                            if (current.Height >= 3)
                            {
                                if (this.map.GetLayer("Buildings").Tiles[j, current.Y + 2].TileSheet.Equals(this.map.TileSheets[2]))
                                {
                                    base.setMapTileIndex(j, current.Y + 2, num + 32, "Buildings", 0);
                                }
                                else
                                {
                                    base.setMapTileIndex(j, current.Y + 2, num + 32, "Back", 0);
                                }
                            }
                        }
                    }
                    return;
                }
            }
            Microsoft.Xna.Framework.Rectangle rectangle = walls[Math.Min(walls.Count - 1, whichRoom)];
            for (int k = rectangle.X; k < rectangle.Right; k++)
            {
                base.setMapTileIndex(k, rectangle.Y, num, "Back", 0);
                base.setMapTileIndex(k, rectangle.Y + 1, num + 16, "Back", 0);
                if (rectangle.Height >= 3)
                {
                    if (this.map.GetLayer("Buildings").Tiles[k, rectangle.Y + 2].TileSheet.Equals(this.map.TileSheets[2]))
                    {
                        base.setMapTileIndex(k, rectangle.Y + 2, num + 32, "Buildings", 0);
                    }
                    else
                    {
                        base.setMapTileIndex(k, rectangle.Y + 2, num + 32, "Back", 0);
                    }
                }
            }
        }