Class SystemManager


  • public class SystemManager
    extends Object
    Manages system-focused aspects, such as ensuring a system has the correct list of current entities. Manages registration of new systems
    • Constructor Detail

      • SystemManager

        public SystemManager()
    • Method Detail

      • entityDestroyed

        protected void entityDestroyed​(Entity entity)
        Signals the SystemManager that an entity was destroyed. Removes the entity from each system's tracked entities
        Parameters:
        entity - the destroyed entity
      • entityRegistrationsChanged

        public void entityRegistrationsChanged​(Entity entity,
                                               BitSet entityRegistrations)
        Signals the SystemManager that an entity had its registrations changed, so evaluate if the entity is still relevant to each system.
        Parameters:
        entity - the entity that was modified
        entityRegistrations - the new registrations of the entity
      • registerSystem

        public boolean registerSystem​(Type systemType,
                                      ECSSystem system)
        Registers the specified system name and system reference
        Parameters:
        systemType - the class type of the system
        system - the instance of the system
        Returns:
        true if the system was added successfully. False if it was already registered; with an error message written to the log
      • setSystemRegistraions

        public void setSystemRegistraions​(Type systemType,
                                          BitSet registrations)
        Sets the registrations the system requires
        Parameters:
        systemType - the class type of the system
        registrations - the BitSet containing the required registrations set to true