• R/O
  • SSH
  • HTTPS

shoginextmove: コミット


コミットメタ情報

リビジョン73 (tree)
日時2016-02-22 10:03:55
作者bellyoshi

ログメッセージ

変更サマリ

差分

--- Quantum/QuantumShogi/QuantumShogi.Logic/Move.cs (nonexistent)
+++ Quantum/QuantumShogi/QuantumShogi.Logic/Move.cs (revision 73)
@@ -0,0 +1,15 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Linq;
4+using System.Text;
5+
6+namespace QuantumShogi.Logic
7+{
8+ class Move
9+ {
10+ public int from { get; set; }
11+ public int to { get; set; }
12+ public Piece piece { get; set; }
13+ public int
14+ }
15+}
--- Quantum/QuantumShogi/QuantumShogi.Logic/Piece.cs (revision 72)
+++ Quantum/QuantumShogi/QuantumShogi.Logic/Piece.cs (revision 73)
@@ -17,9 +17,9 @@
1717 {
1818 return _isTypeOf[pieceType];
1919 }
20-
20+
2121 ///なりごま
22- public bool IsPromoted { get; set; } = false;
22+ public bool IsPromoted { get; set; }
2323
2424 const int Pawn = 1;// 歩
2525 const int Lance = 2;// 香車
@@ -41,7 +41,11 @@
4141 }
4242 }
4343
44- public static int MaxOfType()
44+ /// <summary>
45+ /// 駒の種類の最大値
46+ /// </summary>
47+ /// <returns></returns>
48+ public static int MaxOfType()
4549 {
4650 return King;
4751 }
@@ -48,27 +52,62 @@
4852 /// <summary>
4953 /// 駒を初期化する。
5054 /// </summary>
51- /// <param name="color">Black or White</param>
52- public Piece(int color)
55+ public Piece(bool isBlack,bool isWhite,bool isTypeOf)
5356 {
54- _isTypeOf[Promoted] = false;
5557 for (int i = Pawn; i < King; i++)
5658 {
57- _isTypeOf[i] = true;
59+ _isTypeOf[i] = isTypeOf;
5860 }
59- _isTypeOf[Black] = false;
60- _isTypeOf[White] = false;
61- _isTypeOf[color] = true;
62- IsEmtpy = false;
61+ IsPromoted = false;
62+ IsBlack = isBlack;
63+ IsWhite = isWhite;
6364 }
6465
66+ /// <summary>
67+ /// 先手の初期量子駒
68+ /// </summary>
69+ /// <returns></returns>
70+ public Piece GetInitBlack()
71+ {
72+ return new Piece(true,false,true);
73+ }
74+ /// <summary>
75+ /// 後手の初期量子駒
76+ /// </summary>
77+ /// <returns></returns>
78+ public Piece GetInitWhite()
79+ {
80+ return new Piece(false, true, true);
81+ }
82+
83+ static private Piece CreateEmpty()
84+ {
85+ return new Piece(false, false, false);
86+ }
87+ static private Piece empty = CreateEmpty();
88+
6589 public Piece GetEmpty()
6690 {
67- return Piece()
91+ return empty;
6892 }
6993
94+ static private Piece CreateWall()
95+ {
96+ return new Piece(true, true, false);
7097
71- public bool IsEmtpy { get; set; }
98+ }
99+ static private Piece wall = CreateWall();
100+ public Piece GetWall()
101+ {
102+ return wall;
103+ }
104+
105+
106+ public bool IsEmtpy {
107+ get {
108+ return !IsWhite && !IsBlack;
109+ }
110+ }
72111
73112 }
74113 }
旧リポジトリブラウザで表示