示例#1
0
        protected AStar(VG.Map.Tissue tissue, bool expl, Point start, int width)
        {
            this.tissue = tissue;
            X = tissue.Width;
            Y = tissue.Height;
            exArray = new int[X + 1, Y + 1];
            openList = new int[X * Y + 2];
            openX = new int[X * Y + 2];
            openY = new int[X * Y + 2];
            parentX = new int[X + 1, Y + 1];
            parentY = new int[X + 1, Y + 1];
            Fcost = new int[X * Y + 2];
            Gcost = new int[X + 1, Y + 1];
            Hcost = new int[X * Y + 2];
            history = new List<FPath>();

            map = new int[X, Y];
            for (int i = 0; i < X; i++)
            {
                for (int j = 0; j < Y; j++)
                    map[i, j] = (int)tissue[i, j].AreaType;
            }
            this.bogStartX = start.X;
            this.bogStartY = start.Y;
            this.bogWidth = width;

            this.explorer = expl;
        }
示例#2
0
        protected AStar(VG.Map.Tissue tissue, bool expl, Point start, int width)
        {
            this.tissue = tissue;
            X           = tissue.Width;
            Y           = tissue.Height;
            exArray     = new int[X + 1, Y + 1];
            openList    = new int[X * Y + 2];
            openX       = new int[X * Y + 2];
            openY       = new int[X * Y + 2];
            parentX     = new int[X + 1, Y + 1];
            parentY     = new int[X + 1, Y + 1];
            Fcost       = new int[X * Y + 2];
            Gcost       = new int[X + 1, Y + 1];
            Hcost       = new int[X * Y + 2];
            history     = new List <FPath>();
            eHistory    = new List <FPath>();

            map = new int[X, Y];
            for (int i = 0; i < X; i++)
            {
                for (int j = 0; j < Y; j++)
                {
                    map[i, j] = (int)tissue[i, j].AreaType;
                }
            }
            this.bogStartX = start.X;
            this.bogStartY = start.Y;
            this.bogWidth  = width;

            this.explorer = expl;
        }
示例#3
0
        public AStar(VG.Map.Tissue tissue)
        {
            openList = new List<Node>();
            closeList = new List<Node>();

            this.tissue = tissue;
            this.x = tissue.Width;
            this.y = tissue.Width;
            this.existsArray = new int[this.x, this.y];
        }
示例#4
0
        int[,] existsArray; /*массив для определения в каком списке лежит point
                             * 0 - точка ни в одном списке
                             * 1 - точка в открытом списке
                             * 2 - точка в закрытом списке
                             * =))
                             * */

        public AStar(VG.Map.Tissue tissue)
        {
            openList  = new List <Node>();
            closeList = new List <Node>();

            this.tissue      = tissue;
            this.x           = tissue.Width;
            this.y           = tissue.Width;
            this.existsArray = new int[this.x, this.y];
        }
示例#5
0
 public AStar(VG.Map.Tissue tissue, Point start, int width)
     : this(tissue, false, start, width)
 {
 }
示例#6
0
 public AStar(VG.Map.Tissue tissue)
     : this(tissue, new Point(0, 0), 0)
 {
 }
示例#7
0
 public eAStar(VG.Map.Tissue tissue, Point start, int width)
     : base(tissue, true, start, width)
 {
 }