Example #1
0
        private static string Get(ePhenomCollection phenomList)
        {
            StringBuilder ret = new StringBuilder();

            foreach (var fItem in phenomList)
            {
                ret.Append(Get(fItem) + R.Space);
            }

            return(ret.ToString());
        }
Example #2
0
        private static List <ePhenomCollection> DecodePhenomSets(Match setMatch)
        {
            List <ePhenomCollection> ret  = new List <ePhenomCollection>();
            ePhenomCollection        curr = new ePhenomCollection();

            Match m = Regex.Match(setMatch.Value, R_PHENOM_ITEM);

            while (m.Success)
            {
                string val = m.Value.Trim();
                if (val == "-")
                {
                    curr.Add(ePhenomCollection.ePhenom.Light);
                }
                else if (val == "+")
                {
                    curr.Add(ePhenomCollection.ePhenom.Heavy);
                }
                else if (val == "")
                {
                    if (curr.Count > 0)
                    {
                        ret.Add(curr);
                        curr = new ePhenomCollection();
                    }
                }
                else
                {
                    var ph = (ePhenomCollection.ePhenom)Enum.Parse(typeof(ePhenomCollection.ePhenom), m.Value, false);
                    curr.Add(ph);
                }
                m = m.NextMatch();
            }

            if (curr.Count > 0)
            {
                ret.Add(curr);
            }

            return(ret);
        }