Esempio n. 1
0
 public void PlotFloorPlan(int x, int y, MoveHelper m)
 {
     Console.Clear();
     for (var i = 0; i < x; i++)
     {
         Console.Write(i.ToString("00") + " : ");
         for (var j = 0; j < y; j++)
         {
             Console.Write(i == 1 && j == 1 ? 'X' :
                           IsOffice(j, i) ? m != null && m.Path.Contains(new Point(j, i, Point.EpointType.Office)) ? 'O' :
                           '.' : '#');
         }
         Console.WriteLine();
     }
 }
Esempio n. 2
0
        private static void Main(string[] args)
        {
            //var o = new Office(10);
            var o = new Office(1358);

            o.PlotFloorPlan(50, 50, null);
            var m = new MoveHelper(o);

            //m.GoTo(7, 4);
            m.GoTo(31, 39);
            o.PlotFloorPlan(50, 50, m);
            Console.WriteLine(m.Path.Count);
            Console.WriteLine(m.Plot());
            //refine path to find shortest path
            Console.ReadKey();
        }