public ShopInventoryEntry(String id) { MatchCollection matches = Regex.Matches(id, @"\w+"); shipPartType = MathFunctions.ParseEnum <ShipPartType>(matches[0].ToString()); availability = MathFunctions.ParseEnum <ShipPartAvailability>(matches[1].ToString()); itemVariety = MathFunctions.ParseEnum <ItemVariety>(matches[2].ToString()); this.id = id; }
private void LoadLevelObjective(String loadPattern) { Match objectiveModeMatch = Regex.Match(loadPattern, @"^(\w+)|"); objective = MathFunctions.ParseEnum <LevelObjective>(objectiveModeMatch.Value); Match objectiveValMatch = Regex.Match(loadPattern, @"([A-Z])(\d+)"); objectiveValue = Convert.ToInt32(objectiveValMatch.Groups[2].Value); }