using System.Collections.Generic; namespace DunGen.LockAndKey { /// /// Parameters for spawning keys /// public sealed class KeySpawnParameters { /// /// The key we're trying to spawn /// public Key Key { get; } /// /// The key manager that owns the key /// public KeyManager KeyManager { get; } /// /// The dungeon generator that is spawning the key /// public DungeonGenerator DungeonGenerator { get; } /// /// An optional list of IKeyLock objects that we created, for which DunGen should assign a key /// public readonly List OutputSpawnedKeys = new List(); public KeySpawnParameters(Key key, KeyManager keyManager, DungeonGenerator dungeonGenerator) { Key = key; KeyManager = keyManager; DungeonGenerator = dungeonGenerator; } } /// /// MonoBehaviours implementing this interface may be chosen by DunGen when deciding where and how to spawn keys /// public interface IKeySpawner { /// /// Can the provided key be spawned by this spawner? /// /// KeyManager that owns the key /// Key to spawn /// True if spawning is possible bool CanSpawnKey(KeyManager keyManager, Key key); /// /// Spawns a key and returns an optional list of IKeyLocks that the key should be assigned to /// /// Spawn parameters /// Any IKeyLock objects that were created, for which DunGen should assign a key void SpawnKey(KeySpawnParameters keySpawnParameters); } }