Ejemplo n.º 1
0
 public static Plant RandSpawn <T>(PlantSentry plantSentry)
     where T : Plant
 {
     (int, int)randXY;
     while (true)
     {
         randXY = plantSentry.GetRandCoordsOnMap();
         if (plantSentry.CellIsEmpty(randXY))
         {
             return(SetPlant <T>(randXY, plantSentry));
         }
     }
 }
Ejemplo n.º 2
0
 public MainSentry(
     int apples, int applesGrowth,
     int carrots, int carrotsGrowth,
     int oats, int oatsGrowth,
     int humans, int ticksHumanStutter,
     int deers, int ticksDeerStutter,
     int mice, int ticksMouseStutter,
     int rabbits, int ticksRabbitStutter,
     int bears, int ticksBearStutter,
     int pigs, int ticksPigStutter,
     int raccoons, int ticksRaccoonStutter,
     int foxes, int ticksFoxStutter,
     int lions, int ticksLionStutter,
     int wolves, int ticksWolfStutter,
     int maxOrgVisionRange,
     int maxOrgTicksBeforeReproducing,
     int maxOrgTicksBeforeBecomingGrass,
     int dayNightChange,
     int maxAmountOfMeteoritesFallingSimultaneously,
     int maxTicksMeteoriteFalling,
     int maxTicksMeteoriteCracking,
     int maxTicksMeteoriteBeforeDissolving,
     int chanceOfMeteoriteToFallOnMap,
     int chanceOfHumanToSpawnOnShard,
     int chanceOfPlantToSpawnOnShard,
     Map map)
 {
     Random          = map.Random;
     Map             = map;
     plantSentry     = new PlantSentry(apples, applesGrowth, carrots, carrotsGrowth, oats, oatsGrowth, this);
     organismSentry  = new OrganismSentry(humans, ticksHumanStutter, deers, ticksDeerStutter, mice, ticksMouseStutter, rabbits, ticksRabbitStutter, bears, ticksBearStutter, pigs, ticksPigStutter, raccoons, ticksRaccoonStutter, foxes, ticksFoxStutter, lions, ticksLionStutter, wolves, ticksWolfStutter, maxOrgVisionRange, maxOrgTicksBeforeReproducing, maxOrgTicksBeforeBecomingGrass, this);
     dayNightSentry  = new DayNightSentry(dayNightChange, this);
     meteoriteSentry = new MeteoriteSentry(maxTicksMeteoriteFalling, maxTicksMeteoriteCracking, maxTicksMeteoriteBeforeDissolving, maxAmountOfMeteoritesFallingSimultaneously, chanceOfMeteoriteToFallOnMap, this);
     houseSentry     = new HouseSentry(this);
     barnSentry      = new BarnSentry(this);
     this.chanceOfHumanToSpawnOnShard = chanceOfHumanToSpawnOnShard;
     this.chanceOfPlantToSpawnOnShard = chanceOfPlantToSpawnOnShard;
 }
Ejemplo n.º 3
0
 public Carrot(int _x, int _y, PlantSentry plantSentry) : base(_x, _y, plantSentry)
 {
 }
Ejemplo n.º 4
0
 public Apple(int _x, int _y, PlantSentry plantSentry) : base(_x, _y, plantSentry)
 {
 }
Ejemplo n.º 5
0
 public Plant(int _x, int _y, PlantSentry plantSentry) : base(_x, _y)
 {
     setPlantSentry(plantSentry);
 }
Ejemplo n.º 6
0
 private static void setPlantSentry(PlantSentry _plantSentry)
 {
     plantSentry = _plantSentry;
 }
Ejemplo n.º 7
0
 public Oat(int _x, int _y, PlantSentry plantSentry) : base(_x, _y, plantSentry)
 {
 }