public void TellInformationToOthers(IAInformation.InformationType type, float length, string parameters, bool order = false) { infoToTell = new IAInformation(brain.unitID, type, length, parameters, order); informationToCommunicate.Add(infoToTell); if (order) { if (infoToTell.NeedConfirmation()) { brain.SetOrderConfirmation(infoToTell); } } else { brain.memory.RegisterMemory(infoToTell, true); } }
public bool ExistInformation(IAInformation.InformationType type, string parameters = "") { return(informationToCommunicate.Exists(c => c.type == type && (string.IsNullOrEmpty(parameters) || c.parameters == parameters))); }
public void RemoveInformation(IAInformation.InformationType type, string parameters = "") { informationToCommunicate.RemoveAll(c => c.type == type && (string.IsNullOrEmpty(parameters) || c.parameters == parameters)); }
public void CleanOrders(IAInformation.InformationType type, string parameters = "") { hardMemory.RemoveAll(c => c.toDo && c.type == type && (string.IsNullOrEmpty(parameters) || c.parameters == parameters)); }
public List <IAInformation> GetOrdersOfType(IAInformation.InformationType type) { return(hardMemory.FindAll(c => c.toDo && c.type == type)); }