public void sellTo(Customer customer) { lock (cookieLock) { if (_cookieBasket.Count() >= 1) { ICookie cookie = _cookieBasket.Last(); SoldCookies ++; LogManager.GetInstance().LogCookiePurchase(customer, cookie, SoldCookies); _cookieBasket.Remove(cookie); } /*else { LogManager.GetInstance().Log("Nope, nothing mr. {0}(debug)", customer.Name); }*/ } }
public void LogCookiePurchase(Customer customer, ICookie cookie, int currentCookie) { Log("{0,80}", string.Format("{0} received {1}", customer.Name, string.Format(cookie.GetCookieDescription(), currentCookie))); }