You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
namespace SObject
|
|
|
|
|
{
|
|
|
|
|
public class Zoo
|
|
|
|
|
{
|
|
|
|
|
private Random _rand;
|
|
|
|
|
public List<DogFamily> Dogs { get; set; }
|
|
|
|
|
|
|
|
|
|
public Zoo()
|
|
|
|
|
{
|
|
|
|
|
_rand = new Random();
|
|
|
|
|
|
|
|
|
|
this.Dogs = new List<DogFamily>()
|
|
|
|
|
{
|
|
|
|
|
GetDog(),
|
|
|
|
|
GetDog(),
|
|
|
|
|
GetDog(),
|
|
|
|
|
GetDog(),
|
|
|
|
|
GetDog(),
|
|
|
|
|
GetDog(),
|
|
|
|
|
GetDog(),
|
|
|
|
|
GetDog(),
|
|
|
|
|
GetDog(),
|
|
|
|
|
GetDog(),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DogFamily GetDog()
|
|
|
|
|
{
|
|
|
|
|
DogFamily dog;
|
|
|
|
|
int seed = _rand.Next(0, 20);
|
|
|
|
|
if (seed % 2 == 0)
|
|
|
|
|
dog = new Wolf($"W{seed % 7}", seed);
|
|
|
|
|
else
|
|
|
|
|
dog = new Coyote($"C{seed % 7}", seed);
|
|
|
|
|
|
|
|
|
|
return dog;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|