Beispiel #1
0
 public void LoadState(string pathOfFileToOpen)
 {
     if (File.Exists(pathOfFileToOpen))
     {
         State tempState;
         using (Stream input = File.OpenRead(pathOfFileToOpen))
         {
             BinaryFormatter formatter = new BinaryFormatter();
             tempState = (State)formatter.Deserialize(input);
         }
         Locations      = tempState.Locations;
         name           = tempState.Name;
         distanceKeeper = tempState.distanceKeeper;
     }
 }
Beispiel #2
0
 public State(string stateName)
 {
     name           = stateName;
     distanceKeeper = new DistanceKeeper(stateName);
     createStateFilePaths(stateName);
 }