A supermarket checkout. Used by customers to pay for goods.
Inheritance: UnityEngine.MonoBehaviour, ISelectable
 public virtual void CheckoutCommand(Checkout checkout)
 {
     if (checkout.AssignedStaff == null)
     {
         staff.SetState(new WorkCheckout(staff, checkout));
     }
     //
     // TODO: else have an error thought bubble/action, eg, shakes head, gets an x in thoughts
     //
 }
        public Queue(Customer customer, Checkout checkout)
            : base(customer)
        {
            this.checkout = checkout;
            interactionZone = checkout.ClosestInteractionZone(customer.transform.position);

            // Move to closest checkout interaction zone
            moveControl.SetDestination(interactionZone.transform.position);

            // Clear thought bubble
            customer.Think(null);
        }
        /**
         * Quickly demonstrate supermarket functionality.
         */
        static void Main(string[] args)
        {
            Item itemA = new Item("A", 50, 3, 130);
            Item itemB = new Item("B", 30, 2, 45);
            Item itemC = new Item("C", 20);
            Item itemD = new Item("D", 15);

            ItemRepository itemRepository = new ItemRepository();

            itemRepository.SaveItem(itemA);
            itemRepository.SaveItem(itemB);
            itemRepository.SaveItem(itemC);
            itemRepository.SaveItem(itemD);

            Checkout checkout = new Checkout(itemRepository);

            Console.WriteLine("************************************************");
            Console.WriteLine("****** Andy Hutchinson - Supermarket Demo ******");
            Console.WriteLine("************************************************");
            Console.WriteLine();
            Console.WriteLine("*** Example Items: ***");
            Console.WriteLine();
            Console.WriteLine(itemRepository);
            Console.WriteLine("*** Scanning Items at the checkout: ***");
            Console.WriteLine();

            checkout.Scan("B");
            Console.WriteLine("Scanned Item 'B' " + checkout);
            checkout.Scan("A");
            Console.WriteLine("Scanned Item 'A' " + checkout);
            checkout.Scan("B");
            Console.WriteLine("Scanned Item 'B' " + checkout);

            Console.WriteLine();
            Console.WriteLine("*** (See the unit tests for further examples) ***");
            Console.WriteLine();
            Console.WriteLine("*** Press <Enter> to exit ***");
            Console.ReadLine();
        }
 /// <summary>
 /// Makes the customer give money to the given checkout. The money is subtracted from the customers wallet
 /// </summary>
 /// <param name="checkout">The checkout to pay the money to</param>
 public void Pay(Checkout checkout)
 {
     checkout.Pay(inventory.TotalCost);
 }
 public WorkCheckout(Staff staff, Checkout checkout)
     : base(staff)
 {
     this.checkout = checkout;
 }
 public void DisplayCheckout(Checkout checkout)
 {
 }