Example #1
0
    public void reinforce(bool selected)
    {
        if (conduit == null)
        {
            return;
        }
        if (!selected || !isReceivingPower())
        {
            conduit.reinforcement--;                                   //What to do if not receiving power?
        }
        else
        {
            if (conduit.reinforcement == conduit.max_reinforcement - 1)
            {
                foreach (Option option in gm.room.options)
                {
                    if (option.isPowered())
                    {
                        option.conduit.resetPower();                     //Resets all other powered conduit options. This will eventually need to be reworked, I think. Want to power connectors instead of conduits maybe?
                    }
                }
            }
            conduit.reinforcement++;
        }

        for (int i = 0; i < 3; i++)
        {
            if (getChildren()[i] != null)
            {
                getChildren()[i].conduit.incomingPower[2 - i] = conduit.getOutput(i); //Some redundancy here with multiple function calls.
            }
        }
    }