Modding:Active Parts: Difference between revisions

Jump to navigation Jump to search
→‎Status-determining configuration points: IPoweredPart particularly relevant here
(→‎Status-determining configuration points: oh this is where we keep it)
(→‎Status-determining configuration points: IPoweredPart particularly relevant here)
Line 42: Line 42:
==Status-determining configuration points==
==Status-determining configuration points==


The following configuration points control the determination of an active part's status. Defaults indicated are at the <code>IActivePart</code> level. Many individual parts set different defaults.
The following configuration points control the determination of an active part's status. Defaults indicated are at the <code>IActivePart</code> level. Many individual parts set different defaults, and in particular see [[#IPoweredPart|IPoweredPart]].


Individual parts can also override the method <code>public virtual bool GetActivePartLocallyDefinedFailure()</code> to implement their own failure modes; if this method returns true, the part's status will be LocallyDefinedFailure. Generally <code>public virtual string GetActivePartLocallyDefinedFailureDescription()</code> should also be overridden; its return value will be used instead of "LocallyDefinedFailure" for status display (see below).
Individual parts can also override the method <code>public virtual bool GetActivePartLocallyDefinedFailure()</code> to implement their own failure modes; if this method returns true, the part's status will be LocallyDefinedFailure. Generally <code>public virtual string GetActivePartLocallyDefinedFailureDescription()</code> should also be overridden; its return value will be used instead of "LocallyDefinedFailure" for status display (see below).
671

edits

Navigation menu