Package framework.component

Examples of framework.component.Component


  }

  public void setCentreOfOrbit(ComponentPath path){
    this.centreOfOrbitPath = path;
    this.isOrbitingPositionComponent = true;
    Component c = ComponentSystem.getInstance().getComponent(path);
    if(c != null && c.isType(PositionComponent.class)){
      centreOfOrbit = ((PositionComponent) c).getVector();
      EventSystem.getInstance().registerEventListener(this, "PositionChanged", new EventSenderComponentFilter(new ComponentPathFilter(path)));
    }
  }
View Full Code Here


  private void alterDescendents(float deltaTheta, SingleTypeComponentList descendents){
    if(descendents != null && shouldUpdateDescendents()){
      for(Component d:descendents){
        ParentComponent p = (ParentComponent) d;
        Component oc = p.getChildByType(getType());

        PositionComponent pos = (PositionComponent) p.getChildByType(PositionComponent.class.getName());
        if(pos != null){
          PositionComponent centrePos = (PositionComponent) getSiblingByType(PositionComponent.class.getName());
          if(centrePos != null){
View Full Code Here

  }

  @Override
  public Component removeComponent(int uniqueID) {
    synchronized (components) {
      Component c = components.remove(uniqueID);
      reusableIDs.add(uniqueID);
      return c;
    }
  }
View Full Code Here

      baseIDs = ComponentSystem.getInstance().getSafeBaseForAllTypes();
    }
    final String typeID = in.readString();
    final byte versionNum = in.readByte();
    final int baseID = baseIDs.get(typeID);
    final Component c = createComponentFromList(typeID, in, baseID, versionNum);
    if(closeAftrerReading){
      in.close();
    }
    return c;
  }
View Full Code Here

  public static void renderCollisionMasks(Graphics g){
    Collection<Component> collisCompsCollection = ComponentSystem.getInstance().getComponentsOfType(CollisionComponent.class.getName());
    if(collisCompsCollection != null){
      ArrayList<Component> collisComps = new ArrayList<Component>(collisCompsCollection);
      for(int i = 0; i < collisComps.size(); i++){
        Component c = collisComps.get(i);
        PositionComponent posComp = (PositionComponent) c.getSiblingByType(PositionComponent.class.getName());
        if(posComp != null){
          Vector2f pos = posComp.getVector();
          if(pos != null){
            CollisionComponent collis = (CollisionComponent) c;
            if(collis.getMask() != null){
View Full Code Here

    return type;
  }

  @Override
  public Component getComponentFrom(MultiTypeComponentList components) {
    Component fromComponent = ComponentSystem.getInstance().getComponent(from);
    if(fromComponent != null){
      for(int i = 0;fromComponent != null && i < stepsUpTree; i++){
        fromComponent = fromComponent.getParent();
      }
      if(fromComponent != null){
        if(branchesDownTree.length > 0){
          ParentComponent p = ((ParentComponent) fromComponent);
          for(int i = 1; i < branchesDownTree.length-1; i++){
View Full Code Here

TOP

Related Classes of framework.component.Component

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.