Esempio n. 1
0
 private void GuestEnter(Puben pub, PubSettings userPubSettings)
 {
     pub.guestsInPub++;
     LogText?.Invoke($"{Name} enters BaBar, and goes to the bar", this);
     TimeToWait(userPubSettings.GuestWalkToBar, userPubSettings.PubSimulationSpeed);
     pub.QueueAtBar.Add(this);
 }
Esempio n. 2
0
 private void GuestLeaves(Puben pub, PubSettings userPubSettings)
 {
     pub.dirtyGlasses.itemCollection.Add(pub.dirtyGlass);
     LogText?.Invoke($"{Name} leaves the bar", this);
     pub.chairs.itemBag.Add(pub.chair);
     pub.guestsInPub--;
 }
Esempio n. 3
0
        private void Log(string text)
        {
            if (LogText.InvokeRequired)
            {
                LogText.Invoke(new Action(() => Log(text)));
                return;
            }

            LogText.AppendText(text + Environment.NewLine);
        }
Esempio n. 4
0
 private void GuestDrinks(Puben pub, PubSettings userPubSettings)
 {
     pub.chairs.itemBag.TryTake(out pub.chair);
     LogText?.Invoke($"{Name} sits down and drinks the beer", this);
     TimeToWait(pub.random.Next(userPubSettings.GuestDrinkBeerMinTime, userPubSettings.GuestDrinkBeerMaxTime), userPubSettings.PubSimulationSpeed);
 }
Esempio n. 5
0
 private void GuestLookingForChair(Puben pub, PubSettings userPubSettings)
 {
     LogText?.Invoke($"{Name} takes the beer and looks for a chair", this);
     TimeToWait(userPubSettings.GuestWalkToChair, userPubSettings.PubSimulationSpeed);
 }
 protected virtual void OnRequestLogUpdated(SpecialEvent e) => LogText?.Invoke(this, e);
Esempio n. 7
0
        //log the correct message
        public void LogMessage(string text)
        {
            LogAppendDelegate la = new LogAppendDelegate(LogAppend);

            LogText.Invoke(la, Color.Black, DateTime.Now.ToString("HH:mm:ss ") + text);
        }
Esempio n. 8
0
        //log the error message
        public void LogError(string text)
        {
            LogAppendDelegate la = new LogAppendDelegate(LogAppend);

            LogText.Invoke(la, Color.Red, DateTime.Now.ToString("HH:mm:ss ") + text);
        }