Beispiel #1
0
        public static Direction FromLine(string line)
        {
            var ret = new Direction
            {
                Order = new List <HexDirection>()
            };

            for (int i = 0; i < line.Length; i++)
            {
                var c = line[i];
                var s = c.ToString();
                if (s == "n" || s == "s")
                {
                    i++;
                    s += line[i];
                }

                HexDirection.TryParse <HexDirection>(s, out var hd);
                ret.Order.Add(hd);
            }

            return(ret);
        }