public virtual void OnReconfigured() { // For now, the resource disappears magically... Resource = null; _currentRole = default(Role); _hasRole = false; _requests.Clear(); _stateMachine.ChangeState(State.Idle); // Todo: This is a bit of a hack }
private void TransferResource(Agent agent) { _stateMachine.Transition( from: State.Output, to: State.ResourceGiven, guard: Resource != null, action: () => { PlaceResource(agent); agent.TakeResource(this); agent.Resource = Resource; Resource = null; }); }