public Kyokumen() { // 将棋盤を生成する前に、盤のサイズを決めておくこと。 yomiKy_ = new YomiKy(this); shogiban = new Shogiban(); motigomaItiran = new MotigomaItiran(); }
public bool Try_Herasu(out MotigomaItiran out_ret, Motigoma mk #if DEBUG , IDebugMojiretu reigai1 #endif ) { valueMk[(int)mk]--; #if DEBUG if (valueMk[(int)mk] < 0) { reigai1.AppendLine("error 持駒の数がマイナス"); out_ret = null; return(false); } #endif out_ret = this; return(true); }
/// <summary> /// 将棋盤を180度ひっくり返すぜ☆(^▽^) /// 主にテスト用だぜ☆(^▽^) /// /// 参考:「ビットの並びを反転する」http://blog.livedoor.jp/techblog1/archives/5365383.html /// </summary> public static void Hanten() { // 盤上 { // 左右反転して、先後も入替 Bitboard tmp_T1 = PureMemory.gky_ky.shogiban.ibashoBan_yk00.CloneBB_KomaZenbu(Taikyokusya.T1); Bitboard tmp_T2 = PureMemory.gky_ky.shogiban.ibashoBan_yk00.CloneBB_KomaZenbu(Taikyokusya.T2); tmp_T1.Bitflip128(); tmp_T2.Bitflip128(); PureMemory.gky_ky.shogiban.ibashoBan_yk00.Set_KomaZenbu(Taikyokusya.T1, tmp_T1); PureMemory.gky_ky.shogiban.ibashoBan_yk00.Set_KomaZenbu(Taikyokusya.T2, tmp_T2); for (int iKs = 0; iKs < Conv_Komasyurui.itiran.Length; iKs++) { Komasyurui ks = Conv_Komasyurui.itiran[iKs]; Piece km1 = Med_Koma.KomasyuruiAndTaikyokusyaToKoma(ks, Taikyokusya.T1); tmp_T1 = PureMemory.gky_ky.shogiban.ibashoBan_yk00.CloneBb_Koma(km1); tmp_T1.Bitflip128(); PureMemory.gky_ky.shogiban.ibashoBan_yk00.Set_Koma(km1, tmp_T1); Piece km2 = Med_Koma.KomasyuruiAndTaikyokusyaToKoma(ks, Taikyokusya.T2); tmp_T2 = PureMemory.gky_ky.shogiban.ibashoBan_yk00.CloneBb_Koma(km2); tmp_T2.Bitflip128(); PureMemory.gky_ky.shogiban.ibashoBan_yk00.Set_Koma(km2, tmp_T2); } // 盤面反転、駒の先後も反転だぜ☆(^▽^) } // 持ち駒 { MotigomaItiran tmp = new MotigomaItiran(); foreach (Motigoma mk in Conv_Motigoma.itiran) { MotigomaSyurui mks = Med_Koma.MotiKomaToMotiKomasyrui(mk); Taikyokusya tai = Med_Koma.MotiKomaToTaikyokusya(mk); Motigoma hantenMotikoma = Med_Koma.MotiKomasyuruiAndTaikyokusyaToMotiKoma(mks, Conv_Taikyokusya.Hanten(tai)); tmp.Set(mk, PureMemory.gky_ky.motigomaItiran.yomiMotigomaItiran.Count(hantenMotikoma)); } PureMemory.gky_ky.motigomaItiran.Set(tmp); } }
public Kyokumen(Kyokumen src) { yomiKy_ = new YomiKy(this); shogiban = new Shogiban(src.shogiban); motigomaItiran = new MotigomaItiran(src.motigomaItiran); }
public MotigomaItiran(MotigomaItiran src) { valueMk = new int[(int)Motigoma.Yososu]; Array.Copy(src.valueMk, valueMk, src.valueMk.Length); yomiMotigomaItiran = new YomiMotigomaItiran(this); }
public YomiMotigomaItiran(MotigomaItiran hontai) { hontai_ = hontai; }
/// <summary> /// 値渡し☆(^~^) /// </summary> /// <param name="copy"></param> /// <returns></returns> public MotigomaItiran Set(MotigomaItiran copy) { Debug.Assert(valueMk.Length == copy.valueMk.Length, "持ち駒配列の長さが違う☆"); Array.Copy(copy.valueMk, valueMk, valueMk.Length); return(this); }