?
/**************************************************************************************/
?* 功能:?棋盘类
?* 描述:?用于描述和计算棋盘上的棋子状态, 气, 子串
?*???提子等判断。
?* 作者:?Chen Rong
?* 时间:?2004-6-7 2:24
?*
?* History:
?*???2004-6-7 2:24 :实现了子串的搜索, 串的气判断。 使用了 ArrayList 类, 以后效率
?*???????如果要优化, 可改写成数组。
? **************************************************************************************/
using System;
using System.Collections;
using System.Drawing;
namespace ChenRong.Weiqi
{
?///
?/// Board 的摘要说明。
?///
?public class Board
?{
??public static readonly int Black = -1;
??public static readonly int Empty = 0;
??public static readonly int White = 1;
??// 棋子数组
??private int[,] stones;?
??// 最后一步杀死的棋子数
??public int LastKillCount = 0;
??// 上下左右偏移量数组, 用于判断某位置周围四个点的情况
??private int[,] offsets = new int[4, 2] { { -1, 0 }, { 1, 0 }, { 0, -1 }, { 0, 1} };
??// 构造函数(constructor)
??public Board()
??{
???this.stones = new int[19, 19];
???this.SetForNewGame();
??}
??// 复制棋盘
??public Board(Board board)
??{
???this.stones = board.stones;
???this.LastKillCount = board.LastKillCount;
??}
??// 初始化
??public void SetForNewGame()
?