Пример #1
0
    public bool ContainsLinesOfType(CutLineType type)
    {
        bool doesContain = false;

        for (int i = 0; i < LinesToCut.Count && !doesContain; i++)
        {
            if (LinesToCut[i].CutType == type)
            {
                doesContain = true;
            }
        }
        return(doesContain);
    }
Пример #2
0
    public List <CutLine> RetrieveLines(CutLineType cutType, int stepNumber)
    {
        List <CutLine> lines = new List <CutLine>();

        foreach (CutLine cl in LinesToCut)
        {
            StepID step = cl.GetComponent <StepID>();
            if (step.UsedInStep(stepNumber) && cl.CutType == cutType)
            {
                lines.Add(cl);
            }
        }
        return(lines);
    }
Пример #3
0
    public List <GameObject> GetPiecesByLine(CutLineType line)
    {
        List <GameObject> materials = new List <GameObject>();

        foreach (GameObject go in WoodMaterials)
        {
            WoodMaterialObject wood = go.GetComponent <WoodMaterialObject>();
            if (wood != null)
            {
                if (wood.ContainsLinesOfType(line))
                {
                    materials.Add(go);
                }
            }
        }
        return(materials);
    }