public Critter(BoundingBox boundingBox, int critterSize) { decider = new Decider(); this.BoundingBox = boundingBox; this.speed = 1; this.Sprite = "critter-left"; this.critterSize = critterSize; this.health = 10 * critterSize; this.awarenessMod = 1; this.needs = new Attributes(critterSize); this.assignChromosomes(critterSize); }
public Direction decide(Attributes attributes, List<Thing> nearbyThings) { switch (MostImportantConcern(attributes, nearbyThings)) { case Concern.food: foreach (Thing thing in nearbyThings) if (thing is Terrain) //if ((thing as Terrain).Type == water) break; break; case Concern.water: break; case Concern.sex: break; case Concern.fear: break; case Concern.agression: break; } return (Direction)rand.Next(8) + 1; }
private Concern MostImportantConcern(Attributes attributes, List<Thing> nearbyThings) { return Concern.sex; }