public Fowl(ICoopSimulation _coop) { ID = Guid.NewGuid(); Coop = _coop; Coop.CouplingNotify += MatingBegins; Coop.DeathNotify += DeathBegins; BirthDate = Coop.Time; IsAlive = true; }
public ConsoleApplication(ICoopSimulation coopSimulation) { IConfiguration config = new ConfigurationBuilder().SetBasePath(Path.Combine(AppContext.BaseDirectory)) .AddJsonFile("appsettings.json", true, true) .Build(); SimulationCyclesInMonth = Convert.ToInt32(config.GetSection("SimulationCyclesInMonth").Value); _coopSimulation = coopSimulation; _coopSimulation.Time = StartDate; _coopSimulation.Population = new HashSet <IFowl>() { new FemaleRabbit(_coopSimulation) { BirthDate = StartDate.AddYears(-1) }, new MaleRabbit(_coopSimulation) { BirthDate = StartDate.AddYears(-1) }, }; EndDate = StartDate.AddMonths(SimulationCyclesInMonth); }
public Rabbit(ICoopSimulation coop) : base(coop) { }
public MaleRabbit(ICoopSimulation _coop) : base(_coop) { Coop = _coop; }
public FemaleRabbit(ICoopSimulation _coop) : base(_coop) { Coop = _coop; Coop.BirthNotify += BirthBegins; }