public static PheromoneDigest FromDescriptor(PheromoneDescriptor descriptor) { if (descriptor == null) { return(null); } return(new PheromoneDigest(descriptor.type, descriptor.direction)); }
private Color CheckValidity(PheromoneDescriptor pheromone, int teamId) { foreach (PheromoneDisplayOption option in displayOptions) { if (option.enabled && pheromone.type == option.type && teamId == option.teamId) { return(option.color); } } return(NULL_COLOR); }
private void ResolveDecision(Ant ant) { // No resolution for ants that are just born if (ant.decision == null) { return; } // Placing the pheromones: the pheromones number check is made by the list-converting method pheromoneMaps[ant.team.teamId][ant.gameCoordinates.x][ant.gameCoordinates.y] = PheromoneDescriptor.ListFromDigestList(ant.decision.pheromones); // Displays the pheromones pheromoneMapDisplayer.UpdateCell(pheromoneMaps, ant.gameCoordinates.x, ant.gameCoordinates.y); TurnError error = TreatDecision(ant); ant.pastTurn = new PastTurnDigest(ant.decision, error); ant.mindset = ant.decision.newMindset; }