/** Creates a {@code PathFinderRequest} with the given arguments. */ public PathFinderRequest (N startNode, N endNode, Heuristic<N> heuristic, GraphPath<N> resultPath, MessageDispatcher dispatcher) { this.startNode = startNode; this.endNode = endNode; this.heuristic = heuristic; this.resultPath = resultPath; this.dispatcher = dispatcher; this.executionFrames = 0; this.pathFound = false; this.status = SEARCH_NEW; this.statusChanged = false; }
public void broadcast(float delay, State<Human> requestedState, Object... params) { Array<Object> array = new Array<Object>(params); array.insert(0, this); if (!requestedHumanStates.contains(requestedState, true)) requestedHumanStates.add(requestedState); MessageDispatcher.getInstance().dispatchMessage(delay, this, null, MessageType.STRUCTURE_BROADCAST.ordinal(), new BroadcastPayload(requestedState, array.items)); }
public Human(float x, float y, float z) { super(x, y, z, "creature/humanblend/humanblend.g3db"); name = "Helper"; speed = 0.025f; climbHeight = 1; tool = new ItemStack(); carryingItemStack = new ItemStack(); stateMachine = new SyncedStateMachine<Human>(this); stateMachine.setInitialState(HelperState.IDLE); MessageDispatcher.getInstance().addListener(this, MessageType.STRUCTURE_BROADCAST.ordinal()); }
@Override public void dispose() { super.dispose(); MessageDispatcher.getInstance().removeListener(this, MessageType.STRUCTURE_BROADCAST.ordinal()); }
@Override public void onEnd() { super.onEnd(); MessageDispatcher.getInstance().dispatchMessage(human, target, MessageType.YOU_ARE_DISMANTLED.ordinal()); }