コード例 #1
0
        public MapLearner(SaveGame saveGame)
        {
            xmlServiceClient = XmlServiceClient.Instance;

            index  = saveGame.getIndexOfCurrentState();
            Region = MapLearnerRegionHelper.convertStringToRegion(saveGame.Region);
            States = saveGame.States;
        }
コード例 #2
0
 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;
 }
コード例 #3
0
 private static SaveGame getDataToSave(MapLearner mapLearner, string saveName)
 {
     return(new SaveGame
     {
         Name = saveName,
         CurrentState = mapLearner.CurrentState,
         States = mapLearner.States,
         Region = MapLearnerRegionHelper.convertRegionToString(mapLearner.Region)
     });
 }
コード例 #4
0
        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);
        }