public IdleState(IGoap _goapData, StateMachine _controller, List <GoapAction> _availableActions, GoapPlanner _planner, GoapAgent _agent) { goapData = _goapData; worldState = goapData.GetWorldState(); goal = goapData.GetGoalState(); controller = _controller; planner = _planner; agent = _agent; availableActions = _availableActions; }
public GoapAgent(List <GoapAction> _availableActions, StateMachine _stateMachine, IGoap _goapData, GameObject __agent) { availableActions = _availableActions; stateMachine = _stateMachine; goapData = _goapData; _agent = __agent; planner = new GoapPlanner(); stateMachine.states.Add("perform_action_state", new PerformActionState(HasPlan, goapData, stateMachine, currentActions, agent)); stateMachine.states.Add("idle", new IdleState(goapData, stateMachine, availableActions, planner, this)); stateMachine.Change("idle"); }