Class appliesto

java.lang.Object
name.moore.kevin.ze.components.appliesto
All Implemented Interfaces:
com.simsilica.es.EntityComponent

public class appliesto extends Object implements com.simsilica.es.EntityComponent
Added to specification entities, this component indicates what the spec entity is meant to build to eg a planetSpec has an appliesto = planet.class, an engineSpec has appliesto = engine.class

It has no XML representation, an entity creates and sets this explicitly. A specification has (by definition?) no specification component of its own. The component also indicates some logistics of where something built with this spec should be delivered to. Since some entities can't be built (eg a planet) their spec doesn't require logistics info - it has a DELIVER.NOP

Author:
Kevin Moore <dev@kevin.moore.name>
  • Field Details

    • appliesTo

      private final Class appliesTo
      the type of target entity this specification entity is going to describe.
    • isComposite

      private boolean isComposite
      Internal flag set for spec entities that are collections of other specs.
  • Constructor Details

    • appliesto

      public appliesto(Class aClass)
      Defaults to builder and deliver as NOP
      Parameters:
      aClass - target entity to be described eg engine.class
  • Method Details

    • getAppliesTo

      public Class getAppliesTo()
      Returns:
      The class of entity (eg engine.class) that this applies to.
    • isIsComposite

      public boolean isIsComposite()
      Returns:
      true if has multiple parts.
    • setIsComposite

      public void setIsComposite(boolean isComposite)
      Parameters:
      isComposite - mark this specification as a composite ie with multiple parts
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns: