public SeisekiMove AddSasite(Move bestSasite, int version, int kati, int hikiwake, int make) { SeisekiMove seisekiSs = null; if (!this.SsItems.ContainsKey(bestSasite)) { // 無ければ問答無用で追加☆(^▽^) seisekiSs = new SeisekiMove(bestSasite, Move.Toryo, version, kati, hikiwake, make, this); if (null != seisekiSs) { this.SsItems.Add(bestSasite, seisekiSs); this.Owner.Edited = true; } } else { // 既存なら、上書き(加算)☆ seisekiSs = this.SsItems[bestSasite]; seisekiSs.Version = version; seisekiSs.Kati += kati; seisekiSs.Hikiwake += hikiwake; seisekiSs.Make += make; } return(seisekiSs); }
public static bool TryParse(Kyokumen ky, string commandline, ref int caret, out SeisekiMove out_result, SeisekiKyokumen owner, StringBuilder syuturyoku) { bool successfule = true; // 指し手☆ if (!Med_Parser.TryFenMove(Option_Application.Optionlist.USI, commandline, ref caret, ky.Sindan, out Move ss)) { successfule = false; } // 応手☆ if (!Med_Parser.TryFenMove(Option_Application.Optionlist.USI, commandline, ref caret, ky.Sindan, out Move ss2)) { successfule = false; } // バージョン(これは無いこともある☆ 評価値のパーサーを使いまわし) if (!Conv_Hyokati.TryParse(commandline, ref caret, out int version, syuturyoku)) { version = 0; //successfule = false; } // 勝った回数(評価値のパーサーを使いまわし) if (!Conv_Hyokati.TryParse(commandline, ref caret, out int kati, syuturyoku)) { successfule = false; } // 引き分けた回数 if (!Conv_Hyokati.TryParse(commandline, ref caret, out int hikiwake, syuturyoku)) { successfule = false; } // 負けた回数 if (!Conv_Hyokati.TryParse(commandline, ref caret, out int make, syuturyoku)) { successfule = false; } out_result = new SeisekiMove(ss, ss2, version, kati, hikiwake, make, owner); return(successfule); }
/// <summary> /// 定跡局面の中で、勝率が一番高い指し手を返すぜ☆(^▽^) /// </summary> /// <param name="ky"></param> /// <returns>指し手が登録されていれば真☆</returns> public bool GetSasite_Syoritu(Kyokumen ky, Move ss, out float out_syoritu) { out_syoritu = float.MinValue; ulong hash = ky.KyokumenHash.Value; if (this.KyItems.ContainsKey(hash)) { SeisekiKyokumen josekyKy = this.KyItems[hash]; if (josekyKy.SsItems.ContainsKey(ss)) { SeisekiMove seSs = josekyKy.SsItems[ss]; out_syoritu = seSs.GetSyoritu(); return(true); } } return(false); }
public SeisekiMove AddSasite(Kyokumen ky, string sasiteRecordStr, StringBuilder syuturyoku) { int caret = 0; if (SeisekiMove.TryParse(ky, sasiteRecordStr, ref caret, out SeisekiMove josekiSs, this, syuturyoku)) { } if (!this.SsItems.ContainsKey(josekiSs.Move)) { this.SsItems.Add(josekiSs.Move, josekiSs); this.Owner.Edited = true; } else { josekiSs = this.SsItems[josekiSs.Move]; } return(josekiSs); }