Package megameklab.ui
Interface EntitySource
- All Known Implementing Classes:
ASMainUI,BAMainUI,BMMainUI,CIMainUI,CVMainUI,DSMainUI,GEMainUI,HHWMainUI,MegaMekLabMainUI,PMMainUI,SVMainUI,WSMainUI
public interface EntitySource
In order to track when changes are made to the unit, we will have one ultimate holder of the Entity instance, and
pass that around. That way, when the Entity is accessed, we can set a dirty flag so we know changes were made.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcreateNewUnit(long entityType) Replace the current Entity with a new one of the indicated typedefault voidcreateNewUnit(long entityType, boolean isPrimitive) Replace the current Entity with a new one of the indicated typedefault voidcreateNewUnit(long entityType, boolean isPrimitive, boolean isIndustrial) Replace the current Entity with a new one of the indicated typevoidcreateNewUnit(long entityType, boolean isPrimitive, boolean isIndustrial, megamek.common.units.Entity oldUnit) Replace the current Entity with a new one of the indicated typedefault voidcreateNewUnit(long entityType, megamek.common.units.Entity oldUnit) Replace the current Entity with a new one of the indicated typemegamek.common.units.Entitymegamek.common.interfaces.ITechManager
-
Method Details
-
getEntity
megamek.common.units.Entity getEntity() -
createNewUnit
default void createNewUnit(long entityType) Replace the current Entity with a new one of the indicated type- Parameters:
entityType- An ETYPE flag indicating the type of Entity to create. Rather than the entire bitmask, only the flag that distinguishes the class from its parent is used.
-
createNewUnit
default void createNewUnit(long entityType, boolean isPrimitive) Replace the current Entity with a new one of the indicated type- Parameters:
entityType- An ETYPE flag indicating the type of Entity to create. Rather than the entire bitmask, only the flag that distinguishes the class from its parent is used.isPrimitive- Whether the new Entity should be primitive; not used by all unit types
-
createNewUnit
default void createNewUnit(long entityType, boolean isPrimitive, boolean isIndustrial) Replace the current Entity with a new one of the indicated type- Parameters:
entityType- An ETYPE flag indicating the type of Entity to create. Rather than the entire bitmask, only the flag that distinguishes the class from its parent is used.isPrimitive- Whether the new Entity should be primitive; not used by all unit typesisIndustrial- Whether the new Entity should be an industrial mek; not used by other unit types
-
createNewUnit
default void createNewUnit(long entityType, megamek.common.units.Entity oldUnit) Replace the current Entity with a new one of the indicated type- Parameters:
entityType- An ETYPE flag indicating the type of Entity to create. Rather than the entire bitmask, only the flag that distinguishes the class from its parent is used.oldUnit- If not null, the basic information (name, year, source, tech level, manual bv) will be copied from the old unit.
-
createNewUnit
void createNewUnit(long entityType, boolean isPrimitive, boolean isIndustrial, megamek.common.units.Entity oldUnit) Replace the current Entity with a new one of the indicated type- Parameters:
entityType- An ETYPE flag indicating the type of Entity to create. Rather than the entire bitmask, only the flag that distinguishes the class from its parent is used.isPrimitive- Whether the new Entity should be primitive; not used by all unit typesisIndustrial- Whether the new Entity should be an industrial mek; not used by other unit typesoldUnit- If not null, the basic information (name, year, source, tech level, manual bv) will be copied from the old unit.
-
getTechManager
megamek.common.interfaces.ITechManager getTechManager()- Returns:
- the current TechManager, which provides the means to determine legality of any piece of tech.
-