private void DoUpdateGeometry(Organism orgamism) { var radius = orgamism.Health / 4; this.geometry.RadiusX = radius; this.geometry.RadiusY = radius; this.frozenGeometry = this.geometry.Clone(); this.frozenGeometry.Freeze(); }
public override void UpdateGeometry(Organism orgamism) { var animal = (Animal)orgamism; if (this.isFirstUpdate) { this.isFirstUpdate = false; this.SetupScale(animal); this.SetupCentrePoint(); } this.translateTransform.X = animal.Position.X; this.translateTransform.Y = animal.Position.Y; this.rotateTransform.Angle = animal.Direction + 90; }
private static OrganismVisual CreatePlantElement(Organism organism) { return new PlantVisual(organism); }
private static OrganismVisual CreateHerbivoreCVisual(Organism animal) { return new HerbivoreCVisual((Animal)animal); }
private static OrganismVisual CreateHerbivoreBVisual(Organism organism) { return new HerbivoreBVisual((Animal)organism); }
private static OrganismVisual CreateCanivoreCVisual(Organism animal) { return new CarnivoreCVisual((Animal)animal); }
private static OrganismVisual CreateCanivoreBVisual(Organism organism) { return new CarnivoreBVisual((Animal)organism); }
public abstract void UpdateGeometry(Organism orgamism);
public override void UpdateGeometry(Organism orgamism) { this.DoUpdateGeometry(orgamism); }
public PlantVisual(Organism plant) : base(PlantBrush, null) { this.geometry = new EllipseGeometry { Center = new Point(plant.Position.X, plant.Position.Y) }; this.DoUpdateGeometry(plant); }