private void onCollectingCompleted(GatheredMaterialConcept gatheredConcept, AgentMessage message) { AgentMessage reply = message.Reply(AgentMessage.PerformativeType.INFORM); reply.Content = gatheredConcept; Send(reply); }
private void processGetMaterialActionRequest(AgentMessage message) { Action <GatheredMaterialConcept> actionOnCollectingCompleted = getActionOnCollectingCompleted(message); RPGAgentToolkit.Core.Behaviour behaviour = getCollectingBehaviour(message, actionOnCollectingCompleted); AddBehaviour(behaviour); AgentMessage reply = message.Reply(AgentMessage.PerformativeType.AGREE); Send(reply); }
private void processCancelMaterialActionRequest(AgentMessage message) { GetMaterialAction action = message.Content as GetMaterialAction; MaterialConcept.MaterialType materialType = action.GetMaterial().GetMaterialType(); if (materialType == MaterialConcept.MaterialType.Wood) { behaviours.FindAll(it => it.GetType() == typeof(CollectWoodBehaviour)).ForEach(it => it.Stop()); } else if (materialType == MaterialConcept.MaterialType.Stone) { behaviours.FindAll(it => it.GetType() == typeof(CollectStoneBehaviour)).ForEach(it => it.Stop()); } AgentMessage reply = message.Reply(AgentMessage.PerformativeType.INFORM); reply.Content = new CancelledJobConcept(); Send(reply); }