-
Notifications
You must be signed in to change notification settings - Fork 0
/
NewDonnor.cs
31 lines (30 loc) · 1.19 KB
/
NewDonnor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Symulacja_Cyfrowa
{
class NewDonnor : Event
{
private int _eventTime;
private string _type;
public NewDonnor(int eventTime, string type) : base(eventTime, type)
{
_eventTime = eventTime;
_type = type;
}
public override void Execute(List<Event> scheduler, BloodStore bloodStorage, PatientQueue patientQ)
{
Type = "ND";
int time = Rnd.Next(11,21); // Gets this from generator
time = SystemTime + time;
Console.WriteLine("\n### NEW DONNOR ###");
Blood.AddBlood(bloodStorage.BloodStorageList,time); // Adds Blood to the Storage
BloodStore.Sorted(bloodStorage.BloodStorageList);
AddToScheduler(scheduler, new BloodSupply(SystemTime+time,"TR",1,false)); // Adds Transport with Blood which will arrive
AddToScheduler(scheduler, new NewDonnor(SystemTime+time,"ND")); // Planning new Donnor Event
Sorted(scheduler);
}
}
}