LynnaLab.Dungeon.GetRoom C# (CSharp) Method

GetRoom() public method

public GetRoom ( int x, int y, int floor ) : Room
x int
y int
floor int
return Room
        public override Room GetRoom(int x, int y, int floor=0)
        {
            int i = FirstLayoutIndex + floor;
            Stream file = Project.GetBinaryFile("rooms/dungeonLayouts.bin");
            file.Position = i*64+y*8+x;
            int roomIndex = file.ReadByte();
            int group = GetDataIndex(0)-0xc9+4;
            Room room = Project.GetIndexedDataType<Room>(roomIndex + group*0x100);
            return room;
        }

Usage Example

コード例 #1
0
ファイル: Project.cs プロジェクト: resonancellc/LynnaLab
        // Get a set of all rooms used in the dungeons. Used by
        // HighlightingMinimap.
        public HashSet <int> GetRoomsUsedInDungeons()
        {
            var rooms = new HashSet <int>();

            for (int i = 0; i < GetNumDungeons(); i++)
            {
                Dungeon d = GetIndexedDataType <Dungeon>(i);
                for (int f = 0; f < d.NumFloors; f++)
                {
                    for (int x = 0; x < d.MapWidth; x++)
                    {
                        for (int y = 0; y < d.MapHeight; y++)
                        {
                            rooms.Add(d.GetRoom(x, y, f).Index);
                        }
                    }
                }
            }

            return(rooms);
        }