public static string NextOf(RandomFactoryReturnType kind) { if (!HasMoreOf(kind)) { return(null); } ICollection <string> collection = _getCollectionOfType(kind); string res = collection.Last(); collection.Remove(res); return(res); }
/* * privates */ private static ICollection <string> _getCollectionOfType(RandomFactoryReturnType kind) { switch (kind) { case RandomFactoryReturnType.BASESTATION: return(_basestation_names); case RandomFactoryReturnType.INCIDENT: return(_incident_descriptions); case RandomFactoryReturnType.EMT: default: return(_emt_names); } }
/* * String generation */ public static bool HasMoreOf(RandomFactoryReturnType kind) { ICollection <string> collection = _getCollectionOfType(kind); return(collection.Count > 0); }