Java 类com.badlogic.gdx.ai.fsm.DefaultStateMachine 实例源码

项目:nhglib    文件:Assets.java   
public void init(Nhg nhg) {
    this.nhg = nhg;
    fsm = new DefaultStateMachine<>(this, AssetsStates.IDLE);

    assetManager = new AssetManager();
    syncAssetManager = new AssetManager();

    FileHandleResolver resolver = assetManager.getFileHandleResolver();
    FileHandleResolver syncResolver = syncAssetManager.getFileHandleResolver();

    assetManager.setLoader(Scene.class, new SceneLoader(nhg, resolver));
    assetManager.setLoader(InputProxy.class, new InputLoader(resolver));
    assetManager.setLoader(JsonValue.class, new JsonLoader(resolver));
    assetManager.setLoader(HDRData2.class, new HDRLoader(resolver));
    assetManager.setLoader(Model.class, ".g3db", new NhgG3dModelLoader(this,
            new UBJsonReader(), resolver));

    syncAssetManager.setLoader(Scene.class, new SceneLoader(nhg, syncResolver));
    syncAssetManager.setLoader(InputProxy.class, new InputLoader(syncResolver));
    syncAssetManager.setLoader(JsonValue.class, new JsonLoader(syncResolver));
    syncAssetManager.setLoader(HDRData2.class, new HDRLoader(syncResolver));
    syncAssetManager.setLoader(Model.class, ".g3db", new NhgG3dModelLoader(this,
            new UBJsonReader(), syncResolver));

    assetManager.setErrorListener(this);
    syncAssetManager.setErrorListener(this);

    assetQueue = new Array<>();
    assetCache = new ArrayMap<>();

    Texture.setAssetManager(assetManager);
}
项目:GdxDemo3D    文件:HumanCharacter.java   
public HumanCharacter(Model model,
                      String name,
                      Vector3 location,
                      Vector3 rotation,
                      Vector3 scale,
                      btCollisionShape shape,
                      float mass,
                      short belongsToFlag,
                      short collidesWithFlag,
                      boolean callback,
                      boolean noDeactivate,
                      Array<BlenderEmpty> ragdollEmpties,
                      String armatureNodeId) {

    super(model, name, location, rotation, scale,
            shape, mass, belongsToFlag, collidesWithFlag,
            callback, noDeactivate, ragdollEmpties, armatureNodeId,
            new HumanSteerSettings());

    // Create path follower
    followPathSteerer = new FollowPathSteerer(this);

    // Create the animation controllers
    animations = new AnimationController(modelInstance);
    // Create animation listeners for states that need one
    stateAnimationListeners = new EnumMap<HumanState, AnimationListener>(HumanState.class);
    stateAnimationListeners.put(HumanState.THROW, new AnimationListener());

    // Create the state machine
    stateMachine = new DefaultStateMachine<HumanCharacter, HumanState>(this);
    // Set the steering variables associated with default move state (walking)
    stateMachine.changeState(moveState);
    // Then make the character idle
    stateMachine.changeState(moveState.idleState);
}
项目:ninja-rabbit    文件:Entity.java   
public Entity(final GraphicsProcessor graphics, final PhysicsProcessor physics, final AudioProcessor audio,
        final State<Entity> initialState) {
    this.graphics = graphics;
    this.physics = physics;
    this.audio = audio;
    stateMachine = new DefaultStateMachine<Entity>(this, initialState);
}
项目:gdx-ai    文件:Bob.java   
public Bob (Elsa elsa) {
    this.elsa = elsa;
    location = Location.SHACK;
    goldCarried = 0;
    moneyInBank = 0;
    thirst = 0;
    fatigue = 0;

    stateMachine = new DefaultStateMachine<Bob, BobState>(this, BobState.GO_HOME_AND_SLEEP_TILL_RESTED);
}
项目:nhglib    文件:BaseGame.java   
void init(NhgEntry nhgEntry) {
    fsm = new DefaultStateMachine<>(nhgEntry, EngineStates.START);
}
项目:Pacman_libGdx    文件:GhostAgent.java   
public GhostAgent(GhostComponent ghostComponent) {
    this.ghostComponent = ghostComponent;
    stateMachine = new DefaultStateMachine<>(this);

    timer = 0;
}
项目:Pacman_libGdx    文件:PlayerAgent.java   
public PlayerAgent(PlayerComponent playerComponent) {
    this.playerComponent = playerComponent;
    stateMachine = new DefaultStateMachine<>(this);
    timer = 0;
}
项目:GDXJam    文件:FSMComponent.java   
public FSMComponent init (Entity entity) {
    stateMachine = new DefaultStateMachine<Entity>(entity);
    return this;
}
项目:gdx-ai    文件:Elsa.java   
public Elsa (Bob bob) {
    stateMachine = new DefaultStateMachine<Elsa, ElsaState>(this, ElsaState.DO_HOUSE_WORK, ElsaState.GLOBAL_STATE);
    this.bob = bob;
}