public void BeltPrePassCheck()
        {
            // Arrange
            List <BeltObject> allBelts = new List <BeltObject>();
            List <BeltPreProcessor.BeltGroup> beltGroups = new List <BeltPreProcessor.BeltGroup>();

            List <BeltItem> allBeltItems = new List <BeltItem>();


            // Act
            BeltPreProcessor beltProc = new BeltPreProcessor(beltGroups, allBeltItems, (int x, int y) => null);

            beltProc.PrepassBelts(allBelts);

            // Assert
        }
Exemple #2
0
    public void SetupBeltSystem()
    {
        allBelts = new List <BeltObject>(FindObjectsOfType <BeltObject>());

        for (int i = 0; i < allBelts.Count; i++)
        {
            BeltObject belt = allBelts[i];
            belt.SetPosBasedOnWorlPos();
            allBeltsCoords[belt.pos] = belt;
        }

        beltPreProc = new BeltPreProcessor(beltGroups, allBeltItems, GetBeltAtLocation);

        beltPreProc.PrepassBelts(allBelts);

        beltItemSlotProc = new BeltItemSlotUpdateProcessor(itemPool, beltGroups);
    }
Exemple #3
0
    public void SetupBeltSystem()
    {
        allBelts = new List <BeltObject>(FindObjectsOfType <BeltObject>());

        foreach (BeltObject belt in allBelts)
        {
            belt.SetPosBasedOnWorlPos();
            belt.GetComponent <BeltGfx>().UpdateGraphics(belt.beltInputs, belt.beltOutputs);
        }

        beltProc = new BeltPreProcessor(allBelts, beltGroups, allBeltItemsSlots, beltItemSlotGroups, allBeltItems, GetBeltAtLocation);

        beltProc.PrepassBelts();

        beltItemSlotProc = new BeltItemSlotUpdateProcessor(allBeltItems, beltItemSlotGroups);

        beltItemGfxProc = new BeltItemGfxUpdateProcessor(allBeltItems);
    }
Exemple #4
0
        public void BeltPrePassCheck()
        {
            // Arrange
            List <BeltObject> allBelts = new List <BeltObject>();

            allBelts.Add(new GameObject().AddComponent <BeltObject>().GetComponent <BeltObject>());
            allBelts.Add(new GameObject().AddComponent <BeltObject>().GetComponent <BeltObject>());
            allBelts[0].pos.x          = 0;
            allBelts[0].beltOutputs[1] = true;
            allBelts[1].pos.x          = 1;
            allBelts[1].beltInputs[3]  = true;
            List <BeltPreProcessor.BeltGroup> beltGroups = new List <BeltPreProcessor.BeltGroup>();

            List <BeltItem> allBeltItems = new List <BeltItem>();


            // Act
            BeltPreProcessor beltProc = new BeltPreProcessor(beltGroups, allBeltItems, (BeltObject.Position pos) => { return(pos.x == 0 ? allBelts[0] : allBelts[1]); });

            beltProc.PrepassBelts(allBelts);

            // Assert
            Assert.IsTrue(allBelts[0].myBeltItemSlots[3, 1].outsideConnections.Count > 0);
        }