using System; using System.Reflection; using Sandbox; namespace Editor; // // Technically the GameData classes aren't limited to maps, we can derive this from a base class in the future. // But do it like this for now to keep the API simple. // // We're not exposing everything on purpose, lots of stuff is redundant or doesn't make sense in managed context. // /// /// Represents an entity class used by the map editor /// public partial class MapClass { /// /// Class name e.g prop_physics /// public string Name { get; internal set; } /// /// Display name e.g Physics Prop /// public string DisplayName { get; internal set; } /// /// Human readable name e.g Physics Prop /// public string Description { get; internal set; } /// /// Icon ( Material ) /// public string Icon { get; internal set; } /// /// Category /// public string Category { get; internal set; } /// /// C# Type of this class /// public Type Type { get; internal set; } /// /// Point, Solid, etc.. /// internal GameDataClassType ClassType { get; set; } // Maybe stupid accessors /// /// A point entity, i.e. a model entity, etc. /// public bool IsPointClass => ClassType == GameDataClassType.GenericPointClass; /// /// A solid class entity, triggers, etc., entities that are tied to from a mesh in Hammer /// public bool IsSolidClass => ClassType == GameDataClassType.GenericSolidClass; /// /// A path entity, will appear in the Path Tool. /// public bool IsPathClass => ClassType == GameDataClassType.PathClass; /// /// A cable entity, will appear in the Path Tool. /// public bool IsCableClass => ClassType == GameDataClassType.CableClass; /// /// List of properties exposed to tools for this class. /// public List Variables { get; internal set; } = new(); /// /// List of inputs for this class. /// public List Inputs { get; internal set; } = new(); /// /// List of outputs for this class. /// public List Outputs { get; internal set; } = new(); /// /// General purpose tags, some with special meanings within Hammer and map compilers. /// public List Tags { get; internal set; } = new(); /// /// In-editor helpers for this class, such as box visualizers for certain properties, etc. /// public List> EditorHelpers { get; internal set; } = new(); /// /// General purpose key-value store to alter functionality of UI, map compilation, editor helpers, etc. /// public Dictionary Metadata { get; internal set; } = new(); /// /// What game does this belong to? ( TODO: Might not be best place for this? ) /// public string GameIdent { get; internal set; } /// /// What package did this entity come from? /// public Package Package { get; internal set; } /// /// What Assembly did this entity come from? /// internal Assembly Assembly { get; set; } public MapClass( string name ) { Name = name; } public override string ToString() { return $"MapClass( {Name} )"; } }