Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
 public void Move()
 {
     if (Floor == _minFloor)
     {
         _up = true;
     }
     else if (Floor == _maxFloor)
     {
         _up = false;
     }
     Floor += (_up ? 1 : -1);
     Arrival?.Invoke(this);
 }
Exemplo n.º 3
0
        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);
            });
        }
Exemplo n.º 4
0
 public void Arrived()
 {
     Arrival?.Invoke($"Train is arriving: ", new Arrival_Info(trainName, arrivalTime, wagonNum, seatNum));
 }