| @@ -7,21 +7,36 @@ | ||
| 7 | 7 | { |
| 8 | 8 | class Koma |
| 9 | 9 | { |
| 10 | - public long value { get; set; } | |
| 10 | + public int value { get; set; } | |
| 11 | 11 | |
| 12 | - const long Promoted = 1 << 0; //なりごま | |
| 13 | - const long Pawn = 1 << 1;// 歩 | |
| 14 | - const long Lance = 1 << 2;// 香車 | |
| 15 | - const long Knight = 1 << 3;// 桂馬 | |
| 16 | - const long Silver = 1 << 4;// 銀 | |
| 17 | - const long Gold = 1 << 5;// 金 | |
| 18 | - const long Bishop = 1 << 6;// 角 | |
| 19 | - const long Rook = 1 << 7;// 飛 | |
| 20 | - const long King = 1 << 8;// 王 | |
| 21 | - const long Black = 1 << 9;// 現在先手の駒 | |
| 22 | - const long White = 1 << 10;// 現在後手の駒 | |
| 23 | - const long InitialBlack = 1 << 11;//初期局面先手の駒 | |
| 24 | - const long InitialWhite = 1 << 12;//初期局面後手の駒 | |
| 25 | - const long Wall = Black | White;//壁 | |
| 12 | + const int Promoted = 0; //なりごま | |
| 13 | + const int Pawn = 1;// 歩 | |
| 14 | + const int Lance = 2;// 香車 | |
| 15 | + const int Knight = 3;// 桂馬 | |
| 16 | + const int Silver = 4;// 銀 | |
| 17 | + const int Gold = 5;// 金 | |
| 18 | + const int Bishop = 6;// 角 | |
| 19 | + const int Rook = 7;// 飛 | |
| 20 | + const int King = 8;// 王 | |
| 21 | + const int Black = 9;// 現在先手の駒 | |
| 22 | + const int White = 10;// 現在後手の駒 | |
| 23 | + const int InitialBlack = 11;//初期局面先手の駒 | |
| 24 | + const int InitialWhite = 12;//初期局面後手の駒 | |
| 25 | + //const long Wall = Black | White;//壁 | |
| 26 | + | |
| 27 | + /// <summary> | |
| 28 | + /// 駒を初期化する。 | |
| 29 | + /// </summary> | |
| 30 | + /// <param name="color">Black or White</param> | |
| 31 | + public Koma(int color) | |
| 32 | + { | |
| 33 | + value = 0; | |
| 34 | + for (int i = Pawn; i < King; i++) | |
| 35 | + { | |
| 36 | + value |= 1 << i; | |
| 37 | + } | |
| 38 | + value |= 1 << color; | |
| 39 | + value |= 1 << (color + 2); | |
| 40 | + } | |
| 26 | 41 | } |
| 27 | 42 | } |
| @@ -0,0 +1,27 @@ | ||
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | +using System.Linq; | |
| 4 | +using System.Text; | |
| 5 | + | |
| 6 | +namespace QuantumShogi.Logic | |
| 7 | +{ | |
| 8 | + class Board | |
| 9 | + { | |
| 10 | + const int SIZE_OF_X = 9; | |
| 11 | + const int SIZE_OF_Y = 9; | |
| 12 | + private Koma[] _cells; | |
| 13 | + public Koma GetCells(int x,int y) | |
| 14 | + { | |
| 15 | + return _cells[SIZE_OF_X * y + x]; | |
| 16 | + } | |
| 17 | + private void SetCell(int x,int y,Koma koma) | |
| 18 | + { | |
| 19 | + | |
| 20 | + } | |
| 21 | + public Board() | |
| 22 | + { | |
| 23 | + _cells = new Koma[SIZE_OF_X * SIZE_OF_Y]; | |
| 24 | + } | |
| 25 | + | |
| 26 | + } | |
| 27 | +} |
| @@ -0,0 +1,12 @@ | ||
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | +using System.Linq; | |
| 4 | +using System.Text; | |
| 5 | + | |
| 6 | +namespace QuantumShogi.UI | |
| 7 | +{ | |
| 8 | + class KomaGroup | |
| 9 | + { | |
| 10 | + int[] counts; | |
| 11 | + } | |
| 12 | +} |