Package megamek.ai.dataset
Class EntityDataMap<F extends Enum<F>>
java.lang.Object
megamek.ai.dataset.EntityDataMap<F>
- Type Parameters:
- F- The enum type representing field names
- Direct Known Subclasses:
- BoardData,- GameData,- MapSettingsData,- PlanetaryConditionsData,- UnitAction,- UnitAttack,- UnitEnrichment,- UnitState
Abstract base class for data maps that use enum fields.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedEntityDataMap(Class<F> fieldEnumClass) Creates an empty EntityDataMap.
- 
Method SummaryModifier and TypeMethodDescriptionGets a field value from the data map.<T> TGets a field value with type casting.Gets all fields and values in the map.Gets the class of the field enum.Gets the ordered list of field enums.Gets the versioned class name for this data map.Adds a field to the data map.
- 
Constructor Details- 
EntityDataMapCreates an empty EntityDataMap.- Parameters:
- fieldEnumClass- The class of the enum type F
 
 
- 
- 
Method Details- 
putAdds a field to the data map.- Parameters:
- field- The field enum
- value- The field value
- Returns:
- This EntityDataMap for method chaining
 
- 
getGets a field value from the data map.- Parameters:
- field- The field enum
- Returns:
- The field value, or null if not present
 
- 
getGets a field value with type casting.- Type Parameters:
- T- The expected type
- Parameters:
- field- The field enum
- type- The class of the expected type
- Returns:
- The field value cast to the expected type, or null if not present
 
- 
getAllFieldsGets all fields and values in the map.- Returns:
- The underlying map of data
 
- 
getFieldOrderGets the ordered list of field enums.- Returns:
- List of fields in insertion order
 
- 
getFieldEnumClassGets the class of the field enum.- Returns:
- The enum class
 
- 
getVersionedClassNameGets the versioned class name for this data map.- Returns:
- The class name with version appended
 
 
-