Package com.csse3200.game.components
Class ComponentType
java.lang.Object
com.csse3200.game.components.ComponentType
Internal type system for components. Used to generate unique IDs for each component type at
runtime, allowing entities to get components by type.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentType
Gets or creates a ComponentType for the specified component class.int
getId()
Gets the unique ID of this component type.
-
Method Details
-
getFrom
Gets or creates a ComponentType for the specified component class.- Parameters:
type
- the component class- Returns:
- the ComponentType for the class
-
getId
public int getId()Gets the unique ID of this component type.- Returns:
- the component type ID
-