Ejemplo n.º 1
0
		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
		}
Ejemplo n.º 2
0
		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;
				});
		}