コード例 #1
0
 public Wire(string definition)
 {
     directions = definition.Split(',')
                  .Select(V2.Parse).ToArray();
     corners    = new V2[directions.Length + 1];
     corners[0] = new V2(0, 0);
     for (int i = 1; i < directions.Length; i++)
     {
         corners[i] = corners[i - 1] + directions[i];
         width      = Math.Max(Math.Abs(corners[i].x), width);
         height     = Math.Max(Math.Abs(corners[i].y), height);
     }
 }
コード例 #2
0
        void Fill(Wire wire)
        {
            V2 offset = new V2();

            foreach (var v in wire.Directions)
            {
                for (int i = 0; i < v.Magnitude; i++)
                {
                    offset += v.Normalized;
                    panel.Add(offset);
                }
            }
        }
コード例 #3
0
 public bool Equals(V2 other)
 {
     return(x == other.x && y == other.y);
 }