网页游戏五子棋(2) 五子棋实现

上一篇文章里写了三个基础的类,下面开始的是五子棋的实现,这里将会省略智能AI,留到最后来写

Dipper.WZQ.AI 机器人

Dipper.WZQ.Message 五子棋消息,相当于网络传输的数据包

Code
        public int Type
        {
            
get { return _type; }
        }
      
        
private int _desktop;

        
public int Desktop
        {
            
get { return _desktop; }
            
set { _desktop = value; }
        }
        
private int _x;

        
public int X
        {
            
get { return _x; }
        }
        
private int _y;

        
public int Y
        {
            
get { return _y; }
        }

        
public Message(int type, int desktop, int x, int y)
        {
            
this._type = type;
            
this._desktop = desktop;
            
this._x = x;
            
this._y = y;
        }

        
public override string ToString()
        {
            
return "[" + this._type + "," + this._desktop + "," + this._x + "," + this._y + "]";
        }
    }
}

 

Dipper.WZQ.Initialize 房间初始化类用来初始化游戏房间的,不过此类是可以大大改进的,我会列出现有方法和改进方法

Code

 

Dipper.Games.Room

Code

posted on 2009-03-31 13:18  知秋  阅读(798)  评论(0)    收藏  举报

导航