Package org.jdesktop.mtgame

Examples of org.jdesktop.mtgame.ProcessorCollectionComponent


  pcc.addProcessor(pc);
    }

    /** Remove the given processor component from the given entity. */
    private static void removeProcessorCompFromEntity (ProcessorComponent pc, Entity entity) {
  ProcessorCollectionComponent pcc = (ProcessorCollectionComponent) entity.getComponent(ProcessorCollectionComponent.class);
  if (pcc == null) return;
  pcc.removeProcessor(pc);
  ProcessorComponent[] pcAry = pcc.getProcessors();
  if (pcAry == null || pcAry.length <= 0) {
      entity.removeComponent(ProcessorCollectionComponent.class);
  }
    }
View Full Code Here


  setArmingCondition(null);
    }

    /** Add the given processor component to the given entity. */
    private static void addProcessorCompToEntity (ProcessorComponent pc, Entity entity) {
  ProcessorCollectionComponent pcc = (ProcessorCollectionComponent) entity.getComponent(ProcessorCollectionComponent.class);
  if (pcc == null) {
      pcc = new ProcessorCollectionComponent();
      entity.addComponent(ProcessorCollectionComponent.class, pcc);
  }
  pcc.addProcessor(pc);
    }
View Full Code Here

                controlScheme.setCharacter(avatarCharacter);

                // Chain the camera processor to the avatar motion processor for
                // smooth animation. For animated avatars we use CharacterAnimationProcessor for the simple
                // avatar CharacterProcessor
                ProcessorCollectionComponent pcc = avatarCharacter.getComponent(ProcessorCollectionComponent.class);
                ProcessorComponent characterProcessor = null;
                ProcessorComponent characterAnimationProcessor = null;
                for(ProcessorComponent pc : pcc.getProcessors()) {
                    if (pc instanceof CharacterProcessor)
                        characterProcessor = pc;
                    else if (pc instanceof CharacterAnimationProcessor) {
                        characterAnimationProcessor = pc;
                        break;
View Full Code Here

    /**
     * Add this processor to the entity
     * @param entity
     */
    void addToEntity(Entity entity) {
        ProcessorCollectionComponent coll = (ProcessorCollectionComponent) entity.getComponent(ProcessorCollectionComponent.class);
        if (coll==null) {
            coll = new ProcessorCollectionComponent();
            entity.addComponent(ProcessorCollectionComponent.class, coll);
        }
        coll.addProcessor(this);
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.mtgame.ProcessorCollectionComponent

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.