Difference between revisions of "API:KSPModule"

From Kerbal Space Program Wiki
Jump to: navigation, search
Line 1: Line 1:
'''KSPModule''' is a mostly unused class for listing names of [[API:PartModule|PartModules]]. Do not use KSPModule, instead simply extend [[API:PartModule|PartModule]] and use [[API:PartModule|PartModule]].moduleName to get the name.
+
'''KSPModule''' is a mostly unused attribute class for listing names of [[API:PartModule|PartModules]]. Do not use KSPModule; extending [[API:PartModule|PartModule]] gives the field [[API:PartModule|PartModule]].moduleName.
  
 
<syntaxhighlight>
 
<syntaxhighlight>
Line 10: Line 10:
  
 
     public KSPModule(string guiName);
 
     public KSPModule(string guiName);
}</syntaxhighlight>
+
}
 +
</syntaxhighlight>

Revision as of 15:57, 11 October 2015

KSPModule is a mostly unused attribute class for listing names of PartModules. Do not use KSPModule; extending PartModule gives the field PartModule.moduleName.

// From KSP 1.04 "Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp.dll"
 
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class KSPModule : Attribute
{
    public string guiName;
 
    public KSPModule(string guiName);
}