Game Development Reference
In-Depth Information
Transitions
Transitions encapsulate the state to be transitioned to as well as the evaluator that determ-
ines whether the transition should be taken. The responsibility for evaluating transitions is
left to the finite state machine itself:
FiniteStateTransition.lua :
FiniteStateTransition = {};
function FiniteStateTransition.new(toStateName, evaluator)
local transition = {};
-- The FiniteStateTransition's data members.
transition.evaluator_ = evaluator;
transition.toStateName_ = toStateName;
return transition;
end
Search WWH ::




Custom Search