Skip to content

Latest commit

 

History

History
68 lines (62 loc) · 15 KB

ModuleContainer.md

File metadata and controls

68 lines (62 loc) · 15 KB

ModuleContainer Class

Contains and encapsulates both solvable and needy modules, in both modded and vanilla forms.

public sealed class ModuleContainer :
System.IEquatable<KeepCoding.ModuleContainer>

Inheritance System.Object 🡒 ModuleContainer

Implements System.IEquatable<ModuleContainer>

Constructors
ModuleContainer(Component) Encapsulates either a modded solvable or modded needy module by using UnityEngine.Component.GetComponent<>. An exception is thrown if KMBombModule and KMNeedyModule are both null or both not null.
ModuleContainer(CacheableBehaviour) Encapsulates either a modded solvable or modded needy module by using Get<T>(bool). An exception is thrown if KMBombModule and KMNeedyModule are both null or both not null.
ModuleContainer(KMBombModule) Encapsulates a modded solvable module.
ModuleContainer(KMBombModule, KMNeedyModule) Encapsulates either a modded solvable or modded needy module. An exception is thrown if KMBombModule and KMNeedyModule are both null or both not null.
ModuleContainer(KMNeedyModule) Encapsulates a modded needy module.
ModuleContainer(MonoBehaviour) Encapsulates either a solvable or needy module. If a BombComponent (or derived) is passed in, the vanilla module component will be stored instead. Uses UnityEngine.Component.GetComponent<>.
Properties
Activate Invoked when the lights turn on. This value is immutable for vanilla modules, and an exception will be thrown when attempted.
Id The identifier for the module as referenced in missions. e.g. "BigButton" Also known as a "Module ID". This value is immutable for vanilla modules, and an exception will be thrown when attempted.
IsEmptyOrTimer Determines whether this instance is a non-module, which are Empty or Timer.
IsModded Determines whether this instance contains a modded module.
IsModule Determines whether this instance isn't a non-module, which are Empty or Timer.
IsNeedy Determines whether this instance contains a needy module.
IsSolvable Determines whether this instance contains a solvable module.
IsVanilla Determines whether this instance contains a vanilla module.
Module Returns KMBombModule, or if null, KMNeedyModule, or if null, BombComponent, or if null, throws.
Name The nice display name shown to players. e.g. "The Button". This value is immutable for vanilla modules, and an exception will be thrown when attempted.
Needy Returns KMNeedyModule, or if null, throws a System.NullReferenceException.
NeedyActivate Modded Needy Only: Invoked when the needy activates.
NeedyDeactivate Modded Needy Only: Invoked when the needy deactivates.
NeedyMaxResetInterval Needy Only: The maximum delay for the needy to activate.
NeedyMinResetInterval Needy Only: The minimum delay for the needy to activate.
NeedyStartingTime Needy Only: The amount of time on the needy timer whenever this module is activated.
NeedyTimerExpired Needy Only: Invoked when the needy timer expires.
NeedyTimerGet Needy Only: An encapsulated System.Func<> that when called, gets the time remaining. This value is immutable for vanilla modules, and an exception will be thrown when attempted.
NeedyTimerSet Needy Only: An encapsulated System.Action<> that when called, sets the time remaining to the parameter passed in. This value is immutable for vanilla modules, and an exception will be thrown when attempted.
NeedyWarnAtFiveSeconds Needy Only: Determines whether NeedyWarning plays when 5 seconds or less remain.
RequiresTimerVisibility Set to true to only allow this module to be placed on the same face as the timer. Useful when the rules involve the timer in some way (like the Big Button), but should be used sparingly as it limits generation possibilities.
RuleGeneration Modded Only: Returns the random seed used to generate the rules for this game. Not currently used.
Solvable Returns KMBombModule, or if null, throws a System.NullReferenceException.
Solve Call this when the entire module has been solved.
Strike Call this on any mistake that you want to cause a bomb strike.
Vanilla Returns BombComponent boxed as System.Object, or if null, throws a System.NullReferenceException.
Methods
Append(Action, Action, Action, Action, Action, Action, Action<float>, Func<int>, Func<float>) Appends events to this instance, preserving their existing values.
Assign(Action, Action, Action, Action, Action, Action, Action<float>, Func<int>, Func<float>) Assigns events to this instance, replacing their existing values.
Equals(ModuleContainer) Determines if both ModuleContainer variables are equal.
Equals(object) Determines if both ModuleContainer variables are equal.
GetHashCode() Gets the current hash code.
GetIgnoredModules() Retrieves the ignore list from the Boss Module Manager mod used primarily by boss modules.
GetRuleSeedId(int) Gets the rule seed number, or a default value.
ToString() Gets the Name and Id of the module.
Operators
explicit operator KMBombModule(ModuleContainer) Returns the instance of KMBombModule from Solvable.
explicit operator KMNeedyModule(ModuleContainer) Returns the instance of KMNeedyModule from Needy.
implicit operator ModuleContainer(KMBombModule) Creates a new instance of ModuleContainer where Solvable is defined.
implicit operator ModuleContainer(KMNeedyModule) Creates a new instance of ModuleContainer where Needy is defined.