コード例 #1
0
        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;
        }
コード例 #2
0
        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);
        }