//迷宫类相关
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
namespace MazeDemo
{
/// <summary>
/// 迷宫类
/// </summary>
public class CMaze
{
bool[,] mg; //地图格子
Stack stack; //堆栈
Point in_p; //入口点
Point out_p; //出口点
Point start_p; //绘制迷时候的起始点
Size boxsize; //每个格子的大小
int step_count; //共走多少步
public CMaze()
{
stack=new Stack();
this.start_p=new Point(0,0);
this.boxsize=new Size(50,50);
step_count=0;
}
public CMaze(bool[,] _mg):this()
{
this.mg=_mg;
}
public CMaze(bool[,] _mg,Point _in,Point _out):this()
{
this.mg=_mg;
this.in_p=_in;
this.out_p=_out;
Stack way=this.Test(this.in_p,_in);
stack.Push(new CCoor(this.in_p,way));
this.step_count++;
}
/// <summary>
/// 绘制迷宫时窗口的起始坐标
/// </summary>
public Point StartPoint
{
set{this.start_p=value;}
get{return this.start_p;}
}
/// <summary>
/// 当前迷宫共走多少步
/// </summary>
public int StepCount
{
get{return this.step_count;}
}
/// <summary>
/// 迷宫格子大小
/// </summary>
public Size BoxSize
{
set{this.boxsize=value;}
get{return this.boxsize;}
}
/// <summary>
/// 堆栈数据个数
/