public void OnChunkArrival(Chunk chunk) { var id = chunk.id; var data = chunk.data; var type = GetType(id); var obj = DataToObject(data, type); if (Arrival != null) { Arrival.Invoke(obj); } }
public void Move() { if (Floor == _minFloor) { _up = true; } else if (Floor == _maxFloor) { _up = false; } Floor += (_up ? 1 : -1); Arrival?.Invoke(this); }
public void EnteringBar(WaitingParameters wp) { Patron patron = new Patron(); patron.LeavingThePub += mw.LeavingPub; patron.OrderABeer += mw.BartenderInteraction; patron.DrinkingBeer += mw.SittingAndDrinking; patron.patronName = GetRandomName(); Arrival?.Invoke(patron.patronName); Task BeingPatron = Task.Run(() => { Thread.Sleep(wp.getTimeForPatronToGoToTheBar()); // mw.FindingEmptyChair += patron.LookingForTable; // patron.patronAct(patron); }); }
public void Arrived() { Arrival?.Invoke($"Train is arriving: ", new Arrival_Info(trainName, arrivalTime, wagonNum, seatNum)); }