Example #1
0
    //function to search for specific products
    protected override List <Product> SearchForProduct(ShopTest data)
    {
        //setup return value
        List <Product> returnVal = new List <Product> ();

        //loop through all products
        foreach (HousingProduct prod in houses)
        {
            if (prod.type == data.productType)
            {
                //check if product is equal to item type
                if (prod.data.occupants.Count == 0)
                {
                    //test if the house is active
                    if (prod.data.obj.activeSelf)
                    {
                        if (CompareProduct(prod, data.person))
                        {
                            if (prod.data.rooms.Count >= data.person.stats.accomodation.requiredRooms)
                            {
                                returnVal.Add(prod);
                            }
                        }
                    }
                }
            }
        }
        ArrangeProduct(returnVal);
        return(returnVal);
    }
Example #2
0
    //function to search for specific products
    protected override List <Product> SearchForProduct(ShopTest data)
    {
        //setup return value
        List <Product> returnVal = new List <Product> ();

        //loop through all products
        foreach (ItemProduct prod in products)
        {
            //check if product is equal to item type
            if (prod.type == data.productType)
            {
                if (prod.cost <= data.person.cash)
                {
                    //check if item name is null
                    if (data.productName == "")
                    {
                        returnVal.Add(prod);
                    }
                    else
                    {
                        //check if item name is equal to product name
                        if (string.Equals(prod.data.name, data.productName, System.StringComparison.OrdinalIgnoreCase))
                        {
                            returnVal.Add(prod);
                        }
                    }
                }
            }
        }
        ArrangeProduct(returnVal);
        return(returnVal);
    }
Example #3
0
    public virtual List <Product> SearchProducts(ShopTest data)
    {
        List <Product> returnVal = SearchForProduct(data);

        if (returnVal == null)
        {
            returnVal = new List <Product> ();
        }
        return(returnVal);
    }
Example #4
0
    private void AddItems()
    {
        for (int i = 0; i < SeedList.Count; i++)
        {
            SeedPacketItem packet  = SeedList[i];
            GameObject     newItem = ItemPool.GetObject();
            newItem.transform.SetParent(contentPanel, false);

            ShopTest itemHolder = newItem.GetComponent <ShopTest> ();
            itemHolder.SetUp(packet, this);
        }
    }
        static void Main(string[] args)
        {
            TestAbstractFactory testAbstractFactory = new TestAbstractFactory();

            testAbstractFactory.Test();

            TestContinentFactory testContinentFactory = new TestContinentFactory();

            testContinentFactory.Test();

            BuilderTest builderTest = new BuilderTest();

            builderTest.Test();

            ShopTest shopTest = new ShopTest();

            shopTest.Test();

            FactoryTest factoryTest = new FactoryTest();

            factoryTest.Test();

            PageFactoryTest pageFactoryTest = new PageFactoryTest();

            pageFactoryTest.Test();

            PrototypeTest prototypeTest = new PrototypeTest();

            prototypeTest.Test();

            ColorPrototypeTest colorPrototypeTest = new ColorPrototypeTest();

            colorPrototypeTest.Test();

            SingletonTest singletonTest = new SingletonTest();

            singletonTest.Test();

            LoadBalancerTest loadBalancerTest = new LoadBalancerTest();

            loadBalancerTest.Test();

            AdapterTest adapterTest = new AdapterTest();

            adapterTest.Test();

            CompoundTest compoundTest = new CompoundTest();

            compoundTest.Test();

            BridgeTest bridgeTest = new BridgeTest();

            bridgeTest.Test();

            CustomersTest customersTest = new CustomersTest();

            customersTest.Test();

            ComponentTest componentTest = new ComponentTest();

            componentTest.Test();

            DrawingElementTest drawingElementTest = new DrawingElementTest();

            drawingElementTest.Test();

            AbstractComponentTest abstractComponentTest = new AbstractComponentTest();

            abstractComponentTest.Test();

            LibraryItemTest libraryItemTest = new LibraryItemTest();

            libraryItemTest.Test();

            FacadeTest facadeTest = new FacadeTest();

            facadeTest.Test();

            MortgageTest mortgageTest = new MortgageTest();

            mortgageTest.Test();

            FlyweightFactoryTest flyweightFactoryTest = new FlyweightFactoryTest();

            flyweightFactoryTest.Test();

            HandlerTest handlerTest = new HandlerTest();

            handlerTest.Test();

            ApproverTest approverTest = new ApproverTest();

            approverTest.Test();

            CommandTest commandTest = new CommandTest();

            commandTest.Test();

            UserTest userTest = new UserTest();

            userTest.Test();

            Console.ReadKey();
        }
Example #6
0
 protected abstract List <Product> SearchForProduct(ShopTest data);
Example #7
0
 protected override List <Product> SearchForProduct(ShopTest data)
 {
     return(new List <Product> ());
 }