/// <summary>
        /// Creates a Dungeon Room
        /// </summary>
        /// <param name="pFloor"></param>
        /// <param name="pX"></param>
        /// <param name="pY"></param>
        /// <param name="pArea"></param>
        /// <param name="pPuzzle"></param>
        /// <param name="pDoors"></param>
        public DungeonRoom(DungeonFloor pFloor, byte pX, byte pY, short pArea, Puzzle pPuzzle = Puzzle.None, params Door[] pDoors)
        {
            this.Floor  = pFloor;
            this.X      = pX;
            this.Y      = pY;
            this.Area   = pArea;
            this.Puzzle = pPuzzle;

            foreach (var door in pDoors)
            {
                this.Doors |= door;
            }

            _propIndex = _propIndex + ((long)Floor.Region.Id << 32) + ((long)Area << 16);
            var testRegion = (ulong)Floor.Region.Id;
            var testArea   = (ulong)Area;

            //TODO: Spawn Patterns inherited from floor.
            this.Spawns = new SpawnPattern(this);

            if (this.Puzzle != Puzzle.Boss && this.Puzzle != Puzzle.FloorUp && this.Puzzle != Puzzle.FloorDown && this.Puzzle != Puzzle.Reward)
            {
                this.Floor.Rooms[Tuple.Create(this.X, this.Y)] = this;
            }
        }
Exemple #2
0
        /// <summary>
        /// Creates new floor region.
        /// </summary>
        /// <param name="regionId"></param>
        /// <param name="dungeon"></param>
        /// <param name="floorId"></param>
        public DungeonFloorRegion(int regionId, Dungeon dungeon, int floorId)
            : base(regionId, dungeon)
        {
            this.FloorId = floorId;
            this.Floor   = dungeon.Generator.Floors[floorId];

            this.GenerateAreas();
        }