Пример #1
0
    public void Switch(LeverGateType type)
    {
        foreach (var gate in gates)
        {
            if (gate.LeverGateType == type)
            {
                if (!gate.CanSwitch())
                {
                    return;
                }
            }
        }

        foreach (var lever in levers)
        {
            if (lever.LeverGateType == type)
            {
                lever.SwitchState();
            }
        }

        foreach (var gate in gates)
        {
            if (gate.LeverGateType == type)
            {
                gate.SwitchState();
            }
        }
    }
Пример #2
0
    static Color GetColorOf(LeverGateType type)
    {
        switch (type)
        {
        case LeverGateType.Type1:
            return(new Color(1, 0.85f, 0.85f));

        case LeverGateType.Type2:
            return(new Color(0.85f, 1, 0.85f));;

        case LeverGateType.Type3:
            return(new Color(0.85f, 0.85f, 1));;

        default:
            return(Color.white);
        }
    }
Пример #3
0
    public static Color GetColorOf(LeverGateType type)
    {
        switch (type)
        {
        case LeverGateType.Type1:
            return(Color1);

        case LeverGateType.Type2:
            return(Color2);

        case LeverGateType.Type3:
            return(Color3);

        default:
            return(Color.white);
        }
    }