Example #1
0
        public static LightPoint FromString(string strPoint)
        {
            string[]   parts = strPoint.Split(new string[] { "position=<", " ", ",", "> velocity=<", ">" }, StringSplitOptions.RemoveEmptyEntries);
            LightPoint point = new LightPoint
            {
                X  = Convert.ToInt32(parts[0]),
                Y  = Convert.ToInt32(parts[1]),
                VX = Convert.ToInt32(parts[2]),
                VY = Convert.ToInt32(parts[3]),
            };

            return(point);
        }
Example #2
0
 public LightField(string[] strPoints)
 {
     points = strPoints.Select(strPoint => LightPoint.FromString(strPoint)).ToList();
 }