public Thingy TryForType(TypeOfThingy tot)
    {
        for (int i = 0; i < instantiableObjects.Count; ++i)
        {
            if (instantiableObjects[i].tot == tot)
            {
                return(Instantiate(instantiableObjects[i]));
            }
        }

        return(null);
    }
    public Thingy GetThingyOfType(TypeOfThingy tot)
    {
        for (int i = 0; i < Controls.Count; i++)
        {
            Thingy thing = Controls[i].TryForType(tot);
            if (thing != null)
            {
                return(thing);
            }
        }

        return(null);
    }
Exemple #3
0
    public Thingy RequestThing(TypeOfThingy tot)
    {
        for (int i = 0; i < IQS.Count; i++)
        {
            if (IQS[i].ttype == tot)
            {
                int I = i;
                i = IQS.Count;
                return(RequestFromSlot(tot, I));
            }
        }

        IQS.Add(new IndividualQueue(tot));
        return(RequestFromSlot(tot, IQS.Count - 1));
    }
Exemple #4
0
    Thingy RequestFromSlot(TypeOfThingy tot, int i)
    {
        for (int j = 0; j < IQS[i].things.Count; j++)
        {
            if (!IQS[i].things[j].gameObject.activeSelf)
            {
                IQS[i].things[j].PseudoAwake();
                return(IQS[i].things[j]);
            }
        }

        Thingy thing = TheManager.TM.GetThingyOfType(IQS[i].ttype);

        return(thing);
    }
Exemple #5
0
 public IndividualQueue(TypeOfThingy thingType)
 {
     ttype  = thingType;
     things = new List <Thingy>();
 }