コード例 #1
0
        private void Start(object sender, RoutedEventArgs e)
        {
            simulateur = SimulateurFourmi.GetInstance();
            var zone   = simulateur.FabriqueZone.Creer();
            var midPos = GetMidPosition(zone);

            reine = simulateur.FabriqueFourmi.Creer(zone, midPos);
            reine.Comportement = new ComportementReine(reine);
            reine.AttacherObs(simulateur);
            RenderTerrain(Terrain, zone.LimitX, zone.LimitY);

            Dessine(zone.LimitX / 2, zone.LimitY / 2, "Content/fourmiRNRN.jpg");
        }
コード例 #2
0
 private void plus(object sender, RoutedEventArgs e)
 {
     if (reine != null)
     {
         fourmi = reine.Comportement.Cast <ComportementReine>().CreerFourmi();
         fourmi.AttacherObs(simulateur);
         fourmi.Position.X = 20 / 2;
         fourmi.Position.Y = 20 / 2 + 1;
         fourmiList.Add(fourmi);
         //if (fourmi.Etat == Oeuf)
         //{
         Dessine(fourmi.Position.X, fourmi.Position.Y, "Content/oeuf.jpg");
         //}
         //Dessine(fourmi.Position.X+1, fourmi.Position.Y+1, "Content/fourmiRN.jpg");
     }
 }