Exemple #1
0
 internal void saveAction(AIAction action, Submarine sub)
 {
     sw.WriteLine("Action");
     sw.WriteLine("Type");
     if (action is PlaceMine)
         sw.WriteLine("PlaceMine");
     if (action is LaunchTorpedo)
         sw.WriteLine("LaunchTorpedo");
     if (action is Move)
         sw.WriteLine("Move");
     sw.WriteLine("End type");
     sw.WriteLine("Path");
     foreach (Cell cell in action.path)
         sw.WriteLine(cell.I + " " + cell.J);
     sw.WriteLine("End path");
     sw.WriteLine("Submarine");
     sw.WriteLine(sub.Number);
     sw.WriteLine("End submarine");
     sw.WriteLine("End action");
     sw.Flush();
 }
Exemple #2
0
 internal void saveStep(EntityCollection collection, AIAction action, Submarine sub)
 {
     sw.WriteLine("Step {0}", LogicService.stepCount);
     saveCollection(collection);
     saveAction(action, sub);
     sw.WriteLine("End step {0}", LogicService.stepCount);
     sw.Flush();
 }
Exemple #3
0
 public ReplayAction(AIAction action, int subNumb)
 {
     this.action = action;
     this.subNumb = subNumb;
 }