Aura.Channel.World.Dungeons.Puzzles.PuzzlePlace.GetLockDoor C# (CSharp) Méthode

GetLockDoor() public méthode

Returns locked door of this place.
Thrown if there is no lock or no door.
public GetLockDoor ( ) : Door
Résultat Aura.Channel.World.Dungeons.Props.Door
		public Door GetLockDoor()
		{
			var door = this.Doors[this.DoorDirection];

			if (!this.IsLock)
				throw new PuzzleException("Place isn't a lock.");
			if (door == null)
				throw new PuzzleException("No door found.");

			return door;
		}

Usage Example

Exemple #1
0
        /// <summary>
        /// Locks place and creates and returns a key for it.
        /// </summary>
        /// <param name="place"></param>
        /// <param name="keyName"></param>
        /// <returns></returns>
        public Item LockPlace(PuzzlePlace place, string keyName)
        {
            if (!place.IsLock)
            {
                throw new PuzzleException("Tried to lock a place that isn't a Lock");
            }

            var doorName = place.GetLockDoor().Name;

            Item key;

            if (place.IsBossLock)
            {
                key             = Item.CreateKey(70030, doorName); // Boss Room Key
                key.Info.Color1 = 0xFF0000;                        // Red
            }
            else
            {
                key             = Item.CreateKey(70029, doorName);     // Dungeon Room Key
                key.Info.Color1 = place.LockColor;
            }

            place.LockPlace(key);
            this.Keys[keyName] = key;

            return(key);
        }
All Usage Examples Of Aura.Channel.World.Dungeons.Puzzles.PuzzlePlace::GetLockDoor