public void DeliverComplete()
        {
            Pickupable pickupable = base.sm.deliveryObject.Get <Pickupable>(base.smi);

            if ((UnityEngine.Object)pickupable == (UnityEngine.Object)null || pickupable.TotalAmount <= 0f)
            {
                if (deliveries.Count > 0 && deliveries[0].chore.amount < PICKUPABLETUNING.MINIMUM_PICKABLE_AMOUNT)
                {
                    Delivery delivery = deliveries[0];
                    Chore    chore    = delivery.chore;
                    delivery.Complete(deliverables);
                    delivery.Cleanup();
                    if (deliveries.Count > 0 && deliveries[0].chore == chore)
                    {
                        deliveries.RemoveAt(0);
                    }
                    GoTo(base.sm.delivering.next);
                }
                else
                {
                    base.smi.GoTo(base.sm.delivering.deliverfail);
                }
            }
            else
            {
                if (deliveries.Count > 0)
                {
                    Delivery delivery2 = deliveries[0];
                    Chore    chore2    = delivery2.chore;
                    delivery2.Complete(deliverables);
                    delivery2.Cleanup();
                    if (deliveries.Count > 0 && deliveries[0].chore == chore2)
                    {
                        deliveries.RemoveAt(0);
                    }
                }
                GoTo(base.sm.delivering.next);
            }
        }
Exemple #2
0
        static void Main(string[] args)
        {
            #region Transport
            Cargo cargo = new Cargo()
            {
                Name   = "Sheets",
                Weight = 5,
            };
            Order order = new Order(cargo, "SSU");
            var   car   = new Car()
            {
                Speed           = 90,
                PersonnelCount  = 1,
                PassengersCount = 3,
            };

            var delivery = new Delivery(car, order);
            delivery.Complete();
            #endregion

            #region ITcompany
            Customer customer = new Customer("John");

            List <Programmer> programmers = new List <Programmer>();
            programmers.Add(new BackendProgrammer());
            programmers.Add(new FrontendProgrammer());

            List <Tester> testers = new List <Tester>();
            testers.Add(new ManualTester());
            testers.Add(new AutoTester());

            List <Code> code = new List <Code>();
            code.Add(new BackendCode());
            code.Add(new FrontendCode());

            Project project = new Project(programmers, testers, code, "Example", customer);
            #endregion
        }