// Получение минимально возможного количества входов элемента // для заданной операции public static int GetMinInputs(Gate.OperationKind operation) { switch (operation) { case Gate.OperationKind.Not: return 1; case Gate.OperationKind.And: case Gate.OperationKind.Or: case Gate.OperationKind.Xor: case Gate.OperationKind.Nand: case Gate.OperationKind.Nor: return 2; default: throw new System.Exception("Unkown operation"); } }
// Получение максимально возможного количества входов элемента // для заданной операции public static int GetMaxInputs(Gate.OperationKind operation) { switch (operation) { case Gate.OperationKind.Not: return 1; case Gate.OperationKind.And: case Gate.OperationKind.Or: case Gate.OperationKind.Xor: case Gate.OperationKind.Nand: case Gate.OperationKind.Nor: return Config.MAX_POSSIBLE_INPUTS; default: throw new System.Exception("Unkown operation"); } }