예제 #1
0
        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();
        }
예제 #2
0
        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);
 }
예제 #8
0
 public abstract void UpdateGeometry(Organism orgamism);
예제 #9
0
 public override void UpdateGeometry(Organism orgamism)
 {
     this.DoUpdateGeometry(orgamism);
 }
예제 #10
0
 public PlantVisual(Organism plant)
     : base(PlantBrush, null)
 {
     this.geometry = new EllipseGeometry { Center = new Point(plant.Position.X, plant.Position.Y) };
     this.DoUpdateGeometry(plant);
 }