public Abiotic.Abiotic GetNewAbiotic(Type abioticType) { var x = RandomHolder.GetInstance().Random.Next(1, World.XMax); var y = RandomHolder.GetInstance().Random.Next(1, World.XMax); var newAbiotic = Activator.CreateInstance(abioticType, x, y); return(newAbiotic as Abiotic.Abiotic); }
public Plant.Plant GetNewPlant(Type plantType) { var x = RandomHolder.GetInstance().Random.Next(1, World.XMax); var y = RandomHolder.GetInstance().Random.Next(1, World.XMax); var health = RandomHolder.GetInstance().Random.Next(1, Plant.Plant.MaxHealth); var newPlant = Activator.CreateInstance(plantType, x, y, health); return(newPlant as Plant.Plant); }
public Animal.Animal GetNewAnimal(Type animalType) { var x = RandomHolder.GetInstance().Random.Next(1, World.XMax); var y = RandomHolder.GetInstance().Random.Next(1, World.XMax); var gender = (Gender)RandomHolder.GetInstance().Random.Next(0, 1); var consumptionType = RandomHolder.GetInstance().Random.Next(0, 1) == 0 ? ConsumptionType.Vegan : ConsumptionType.Predator; var newAnimal = Activator.CreateInstance(animalType, x, y, gender, consumptionType); return(newAnimal as Animal.Animal); }
public override Intention RequestIntention() { RandomDelta = RandomHolder.GetInstance().Random.Next(-1, 2); while (RandomDelta == 0) { RandomDelta = RandomHolder.GetInstance().Random.Next(-1, 2); } var rand = RandomHolder.GetInstance().Random.Next(2); if (rand == 0) { return(new Intention { DeltaX = 0, DeltaY = (RandomDelta * Speed) }); } return(new Intention { DeltaX = (RandomDelta * Speed), DeltaY = 0 }); }
public void SetHealth() { Health = RandomHolder.GetInstance().Random.Next(1, 10); }
public int GetRandomHealth() { return(RandomHolder.GetInstance().Random.Next(1, 10)); }
public int GetRandom() { return(RandomHolder.GetInstance().Random.Next(1, World.XMax)); }
public void SetGender() { Gender = RandomHolder.GetInstance().Random.Next(0, 2) == 0 ? Gender.Male : Gender.Female; }