Exemplo n.º 1
0
 internal override VisibleObject Copy(VisibleObject parent)
 {
     Marker marker = new Circle(Cell);
     marker.Parent = (EntityCollection)parent;
     return marker;
 }
Exemplo n.º 2
0
 internal Marker ReadMarker(GameField field)
 {
     String str = sr.ReadLine();
     Marker marker = null;
     while (!str.Contains("End marker"))
     {
         String type = str;
         str = sr.ReadLine();
         switch (type)
         {
             case "Aim":
                 marker = new Aim(field.Field[Int32.Parse(str.Split(' ').ElementAt(0)), Int32.Parse(str.Split(' ').ElementAt(1))]);
                 break;
             case "Circle":
                 marker = new Circle(field.Field[Int32.Parse(str.Split(' ').ElementAt(0)), Int32.Parse(str.Split(' ').ElementAt(1))]);
                 break;
             case "Check":
                 marker = new Check(field.Field[Int32.Parse(str.Split(' ').ElementAt(0)), Int32.Parse(str.Split(' ').ElementAt(1))]);
                 break;
             case "Flag":
                 marker = new Flag(field.Field[Int32.Parse(str.Split(' ').ElementAt(0)), Int32.Parse(str.Split(' ').ElementAt(1))]);
                 break;
             case "XMark":
                 marker = new XMark(field.Field[Int32.Parse(str.Split(' ').ElementAt(0)), Int32.Parse(str.Split(' ').ElementAt(1))]);
                 break;
         }
         str = sr.ReadLine();
     }
     return marker;
 }