public List <IRig> GetRigsOfType(ERigType rigType) { var ret = new List <IRig>(); foreach (var rig in addressRigLookup.Values) { if (rig.rigType == rigType) { ret.Add(rig); } } return(ret); }
/// <summary> /// Attempts to get the rig type from the identifier. Type is set to uknown is the identifier is not valid. /// </summary> /// <returns><c>true</c>, if get rig type was tryed, <c>false</c> otherwise.</returns> /// <param name="identifier">Identifier.</param> /// <param name="type">Type.</param> public static bool TryGetRigType(this string identifier, out ERigType type) { if (RIG_VACUUM.Equals(identifier)) { type = ERigType.Vacuum; return(true); } else if (RIG_PRESSURE.Equals(identifier)) { type = ERigType.Pressure; return(true); } else { type = ERigType.Unknown; return(false); } }