// パーティー分析 private async Task PartyAnalysisAsync( CaptureImageManegementModel captureImageManegementModel, PartyManegementModel partyManegementModel, PartyWaitStateModel partyWaitStateModel) { // ポケモンIDコンバーター PokemonIdConverterModel pokemonIdConverterModel = new PokemonIdConverterModel(); // パーティー初期化 partyManegementModel.PartyReset(); for (int i = PartyConst.FIRST; i <= PartyConst.SIXTH; i++) { // 待機演出開始 partyWaitStateModel.Start(i); // 画像切り取り Bitmap myBitmap = await Task.Run(() => captureImageManegementModel.PartyPokemonImage(i)); // 画像分析 int pokemonId = Analysis(myBitmap); // ポケモンIDをオリジナルに変換 int originalPokemonId = pokemonIdConverterModel.ToOriginalPokemonId(pokemonId); // 待機演出終了 bool a = await partyWaitStateModel.End(i); Console.WriteLine("OriginalPokemonID = " + originalPokemonId.ToString()); // 分析結果からポケモンイメージを表示 partyManegementModel.ChangePokemonId(i, originalPokemonId); } }
private void ShowPokemonSearchWindow(object index) { // ポケモンId取得 int partyIndex = ObjectConverter.ToInt(index); int pokemonId = _partyManegementModel.GetPokemonId(partyIndex); // 通知 PokemonSearchWindowNotification pokemonSearchWindowNotification = new PokemonSearchWindowNotification(); pokemonSearchWindowNotification.WindowId = PokemonSearchWindowNotification.POKEMON_SEARCH_WINDOW; pokemonSearchWindowNotification.IsModal = true; pokemonSearchWindowNotification.PokemonId = pokemonId; ShowWindowRequest.Raise(pokemonSearchWindowNotification, notification => { PokemonSearchWindowNotification resultNotification = (PokemonSearchWindowNotification)notification; _partyManegementModel.ChangePokemonId(partyIndex, resultNotification.PokemonId); }); }