Ejemplo n.º 1
0
 public Egg(MotherNature.AntTypes t, Point loc, Queen mother)
 {
     id          = ++lastid;
     type        = t;
     name        = mother.Colony.GetType().Name + this.GetType().Name + id;
     location    = loc;
     certificate = mother.Colony.World().GetEggCertificate(name);
     rot         = MotherNature.alea.Next(0, 360);
     this.mother = mother;
 }
Ejemplo n.º 2
0
        protected bool LayEgg(MotherNature.AntTypes typ, System.Drawing.Point loc)
        {
            if (!ActionAllowed())
            {
                return(false);                  // already did something
            }
            if (!Helpers.IsInPolygon(MyColony.Hill, loc))
            {
                return(false);                                          // can't lay an egg outside the hill
            }
            if (Helpers.Distance(SDLocation, loc) > Colony.CRIB_SIZE)
            {
                return(false);                                                      // queen cannot throw an egg !!
            }
            MyColony.StoreEggInNursery(new Egg(typ, loc, this, INITIAL_MATURITY));

            energy -= MotherNature.COST_OF_LAYING_AN_EGG;

            return(true);
        }
Ejemplo n.º 3
0
 public bool LayEgg(MotherNature.AntTypes typ, System.Drawing.Point loc, Queen queen)
 {
     return(LayEgg(typ, loc));
 }
Ejemplo n.º 4
0
 public Egg(MotherNature.AntTypes t, Point location, Queen mother, int mat) : this(t, location, mother)
 {
     maturity = mat;
 }