コード例 #1
0
    public bool AddToConstruction(ID.Specification spec, ID.Type type, int var)
    {
        for (int i = 0; i < IO.Inputs.Length; i++)
        {
            if (IO.Inputs[i].GetComponent <ID>().Compare(spec, type, var))
            {
                if (IO.InputCheck[i] == false)
                {
                    IO.InputCheck[i] = true;

                    /*
                     * bool requirementsComplete = true;
                     * for (int j = 0; j < IO.InputCheck.Length; j++)
                     * {
                     *  if (IO.InputCheck[j] == false) requirementsComplete = false;
                     * }
                     *
                     * if(requirementsComplete)
                     * {
                     *  Construct();
                     * }*/
                    Construct();

                    return(true);
                }
            }
        }


        return(false);
    }
コード例 #2
0
    // Updates last-ID variable and returns its value.
    public int NewID(ID.Type type)
    {
        switch (type)
        {
        case ID.Type.Customer:
            lastCustomerID++;
            return(lastCustomerID);

        case ID.Type.Vendor:
            lastVendorID++;
            return(lastVendorID);

        case ID.Type.Product:
            lastProductID++;
            return(lastProductID);

        case ID.Type.Transaction:
            lastTransactionID++;
            return(lastTransactionID);

        default:
            throw new ArgumentException("An invalid type was passed: " + type);
        }
    }