public override void Execute() { Logger.Info($"Cleaning gamelist in: {Arguments["g"]}"); if (!File.Exists(Arguments["g"])) { throw new Exception($"{Arguments["g"]} could not be found, please verify that the file exists."); } if (!Directory.Exists(Arguments["r"])) { throw new Exception($"{Arguments["r"]} could not be found, please verify that the folder exists."); } var manager = new GameListManager(Logger); var sourceGameList = XDocument.Load(Arguments["g"]); Logger.Info($"Loaded source gameslist from: {Arguments["g"]}"); var newGameList = manager.CleanGameList(sourceGameList, Arguments["r"]); newGameList.Save(Arguments["g"].Replace("gamelist.xml", "gamelist.clean.xml")); Logger.Info($"We cleaned up {sourceGameList.Descendants("game").Count() - newGameList.Descendants("game").Count()} saved in gamelist {Arguments["g"].Replace("gamelist.xml", "gamelist.clean.xml")}"); }
void gameOver(bool win) { this.resultPanel.SetActive(true); if (win) { resultText.text = "Поздравляем, вы победили!"; } else { resultText.text = "К сожалению, вы проиграли... Попробуйте еще раз!"; } // сохранить в рейтинг for (int x = 0; x < this.xSize; x++) { for (int y = 0; y < this.ySize; y++) { tiles[x, y].SetActive(false); } } this.shagCountText.gameObject.SetActive(false); this.totalPointsText.gameObject.SetActive(false); this.surrenderButton.gameObject.SetActive(false); #if UNITY_EDITOR var lstGames = GameListManager.readCsvFile(AssetDatabase.GetAssetPath(csvFile)); GameListManager.writeLine(new GameHistoryModel(lstGames.Count, System.DateTime.Now, this.totalPoints, win), AssetDatabase.GetAssetPath(csvFile)); #endif }
public override void Execute() { Logger.Info($"Listing games by publisher name {Arguments["p"]}, from file {Arguments["g"]}"); var columns = new List <string>(); if (Arguments.Contains("c")) { columns = Arguments["c"].Split(',').ToList(); } var gamelist = XDocument.Load(this.Arguments["g"]); var games = gamelist.Descendants().Where(g => g.Element("publisher") != null && g.Element("publisher").Value == Arguments["p"]); foreach (var game in games) { var info = GameListManager.CreateOutputInfoLine(game, columns); Logger.Info(info); if (Arguments.Contains("o")) { WriteToFile(Arguments["o"], info); } } }
public override void Execute() { Logger.Info($"Moving roms and info found in {Arguments["i"]}"); if (!File.Exists(Arguments["c"])) { throw new Exception($"{Arguments["c"]} could not be found, please verify that the file exists."); } if (!File.Exists(Arguments["g"])) { throw new Exception($"{Arguments["g"]} could not be found, please verify that the file exists."); } if (!Directory.Exists(Arguments["l"])) { throw new Exception($"{Arguments["l"]} could not be found, please verify that the folder exists."); } var currentBaseFolder = Arguments["g"].Substring(0, Arguments["f"].LastIndexOf("\\")); Logger.Info($"Current base folder set to {currentBaseFolder}"); var currentEmulator = currentBaseFolder.Substring(currentBaseFolder.LastIndexOf("\\") + 1); Logger.Info($"Current emulator name set to: {currentEmulator}"); var manager = new GameListManager(Logger); var games = manager.LoadGameIds(Arguments["c"]); Logger.Info($"Found {games.Count} unique games in input file."); var sourceGameList = XDocument.Load(Arguments["g"]); Logger.Info($"Loaded source gameslist from: {Arguments["g"]}"); var newList = manager.MoveGames(currentBaseFolder, currentEmulator, sourceGameList, games, Arguments["l"], Arguments["e"], Arguments.Contains("remove")); if (newList != null) { // save gamelist newList.Save($"{Arguments["l"]}\\gamelists\\{Arguments["e"]}\\gamelist.xml"); if (Arguments.Contains("remove")) { sourceGameList.Element("gameList") .Elements("game") .Where(g => games.Contains(g.Attribute("id").Value)) .Remove(); sourceGameList.Save(Arguments["f"]); } } else { Logger.Info($"No games found in the source gameslist.xml, no work done"); } }
// Start is called before the first frame update void Start() { backButton.onClick.AddListener(back); #if UNITY_EDITOR var lstGames = GameListManager.readCsvFile(AssetDatabase.GetAssetPath(csvFile)); if (lstGames == null) { Debug.LogError("Something go wrong!"); return; } lstGames.ForEach(game => { this.createNewTextObject(game.FormatLineForRecordsList); }); #endif }
public override void Execute() { Logger.Info($"Cleaning images in: {Arguments["i"]}"); if (!File.Exists(Arguments["g"])) { throw new Exception($"{Arguments["g"]} could not be found, please verify that the file exists."); } if (!Directory.Exists(Arguments["i"])) { throw new Exception($"{Arguments["i"]} could not be found, please verify that the folder exists."); } var manager = new GameListManager(Logger); var sourceGameList = XDocument.Load(Arguments["g"]); Logger.Info($"Loaded source gameslist from: {Arguments["g"]}"); var imageList = manager.CleanImages(sourceGameList, Arguments["i"]); Logger.Info($"We removed up {imageList.Count} images"); }
public GameController(GameListManager gameListManager) { Contract.Requires(gameListManager != null); _gameListManager = gameListManager; }