Example #1
0
        static int GenSymplePath(int iPathNum, int iX, int iY)
        {
            int iTempPath;

            /*Генерация длины пути*/
            iTempPath = rndLP.Next(500, 1000);
            /*Инициализация текущего направления на восток или юг*/
            iTecDir = rndDir.Next(0, 4);
            /*Инициализация главного пути*/
            ep[iPathNum] = new ElementPath(iTempPath, 0, 0, iTecDir, iX, iY);
            return(iTempPath);
        }
Example #2
0
        static void GenForFPath(int iPathLen, int iCoun, int iFTP = 0)
        {
            int iFTecDir, iFTecPov, iFTecPath = 0;

            iFTecPath = iFTecPath + iCoun;
            for (int p = 0; p < iPathLen; p++)
            {
                using (System.IO.StreamWriter file = new System.IO.StreamWriter(Environment.CurrentDirectory + @"\log.txt", true))
                {
                    file.WriteLine("TEST {0} {1} {2}", p, iCountPov, iCountEndPath);
                }
                iFTecDir = ElementPath.CheckDir(rndDir.Next(0, 101));
                iFTecPov = ElementPath.CheckPov(rndPov.Next(0, 101));
                /*Устанавливаем направление*/
                ep[iFTecPath].SetDirection(iFTecDir);
                /*Устанавливаем поворот*/
                ep[iFTecPath].SetPovorot(iFTecPov);
                if (iFTecPov == 0)
                {
                    if (CheckFCoord(ep[iFTecPath].Cord[ep[iFTecPath].Cord.Count - 1], iFTecDir) == true)
                    {
                        /*Установить элемент пути*/
                        ep[iFTecPath].SetCoord(SetPosFPath(ep[iFTecPath].Cord[ep[iFTecPath].Cord.Count - 1], iFTecPath, iFTecDir, iFTP));
                        iPathLen--;
                        bLuck = true;
                    }
                    else
                    {
                        p--;
                        bLuck = false;
                    }
                }
                /*Доп путь*/
                else
                {
                    if (iCountPov != 0)
                    {
                        if (iCountEndPath > iFTecPath)
                        {
                            for (int p2 = 0; p2 < iFTecPov; p2++)
                            {
                                GenForFPath(GenSymplePath(iFTecPath + 1, ep[iFTecPath].Cord[ep[iFTecPath].Cord.Count - 1].GetX(), ep[iFTecPath].Cord[ep[iFTecPath].Cord.Count - 1].GetY()), iFTecPath + 1, iFTecPov);
                            }
                            iCountEndPath--;
                        }
                        iCountPov--;
                    }
                }
            }
        }
Example #3
0
 public void SetValue(char cV, ElementPath e)
 {
     this.cValue = cV;
     this.ep     = e;
     this.bUsed  = true;
 }