Interface IAssignsCitizen
- All Superinterfaces:
IBuildingModule,IHasDirty
- All Known Subinterfaces:
IAltersBuildingFootprint,IAssignsJob
- All Known Implementing Classes:
AbstractAssignedCitizenModule,ChildrenBuildingModule,CourierAssignmentModule,CraftingWorkerBuildingModule,DeliverymanAssignmentModule,GuardBuildingModule,HospitalAssignmentModule,LivingBuildingModule,LumberjackAssignmentModule,MinerBuildingModule,NoPrivateCrafterWorkerModule,QuarryModule,StableCavalryBuildingModule,TavernLivingBuildingModule,WorkAtHomeBuildingModule,WorkerBuildingModule
Interface for all modules that need special assignment handling.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanassignCitizen(ICitizenData citizen) Specific citizen assignment hook for modules.Get all assigned citizens to this module.Get a list of entities from the assigned citizens.Get the hiring mode of the module.intGet the max number of citizens this module supports.booleanCheck if there are any assigned citizens in the module.booleanhasAssignedCitizen(ICitizenData citizen) Check if a given citizen is assigned to this module.booleanisFull()Check if we can fit additional citizens into the module.booleanremoveCitizen(@NotNull ICitizenData citizen) Specific citizen removal hook for modules.voidsetHiringMode(HiringMode hiringMode) Set the hiring mode (automatic or manual or colony default).Methods inherited from interface com.minecolonies.api.colony.buildings.modules.IBuildingModule
getBuilding, getProducer, serializeToView, serializeToView, setBuilding, setProducerMethods inherited from interface com.minecolonies.api.util.IHasDirty
checkDirty, clearDirty, markDirty
-
Method Details
-
removeCitizen
Specific citizen removal hook for modules.- Parameters:
citizen- the removed citizen.- Returns:
- true if one was removed.
-
assignCitizen
Specific citizen assignment hook for modules.- Parameters:
citizen- the added citizen.- Returns:
- true if one was added.
-
getAssignedCitizen
List<ICitizenData> getAssignedCitizen()Get all assigned citizens to this module.- Returns:
- the list.
-
isFull
boolean isFull()Check if we can fit additional citizens into the module.- Returns:
- true if so.
-
getModuleMax
int getModuleMax()Get the max number of citizens this module supports.- Returns:
- the modules max.
-
hasAssignedCitizen
Check if a given citizen is assigned to this module.- Parameters:
citizen- the citizen to check.- Returns:
- true if so.
-
getAssignedEntities
List<Optional<AbstractEntityCitizen>> getAssignedEntities()Get a list of entities from the assigned citizens.- Returns:
- optional list of entities.
-
hasAssignedCitizen
boolean hasAssignedCitizen()Check if there are any assigned citizens in the module.- Returns:
- true if so.
-
setHiringMode
Set the hiring mode (automatic or manual or colony default).- Parameters:
hiringMode- the mode to set.
-
getHiringMode
HiringMode getHiringMode()Get the hiring mode of the module.- Returns:
- the mode.
-