public MapLearner(SaveGame saveGame) { xmlServiceClient = XmlServiceClient.Instance; index = saveGame.getIndexOfCurrentState(); Region = MapLearnerRegionHelper.convertStringToRegion(saveGame.Region); States = saveGame.States; }
private void initializeBoard() { TimedModeOn = false; setDefaultColors(); textInputBox.Text = ""; speechOutputBox.Text = ""; mapImage.Source = mapLearner.CurrentState.getImage(); regionLabel.Text = MapLearnerRegionHelper.convertRegionToString(mapLearner.Region, true); scoreOutputLabel.Text = mapLearner.foundStates().Count + " / " + mapLearner.States.Count; }
private static SaveGame getDataToSave(MapLearner mapLearner, string saveName) { return(new SaveGame { Name = saveName, CurrentState = mapLearner.CurrentState, States = mapLearner.States, Region = MapLearnerRegionHelper.convertRegionToString(mapLearner.Region) }); }
private Dictionary <MapLearnerRegion, string> getFileLocationsDictionary() { Dictionary <MapLearnerRegion, string> flieLocationsDictionary = new Dictionary <MapLearnerRegion, string>(); XPathDocument fileLocaitonsDocument = getXPathDocument(fileLocationsPath); XPathNavigator navigator = fileLocaitonsDocument.CreateNavigator(); XPathNodeIterator iterator = navigator.Select("/fileLocations/fileLocation"); foreach (XPathNavigator value in iterator) { string strCurrentType = value.SelectSingleNode(navigator.Compile("type")).Value; MapLearnerRegion type = MapLearnerRegionHelper.convertStringToRegion(strCurrentType); string fileLocation = value.SelectSingleNode(navigator.Compile("filePath")).Value; flieLocationsDictionary.Add(type, fileLocation); } return(flieLocationsDictionary); }