Exemplo n.º 1
0
 public void InitForm(ClopWar clpw)
 {
     //Get ClopWar class intance
     ClopWar = clpw;
     FieldW  = ClopWar.FieldW;
     FieldH  = ClopWar.FieldH;
     //Init form
     OwnerForm.Width  = FieldW * CellW + OffX2;
     OwnerForm.Height = FieldH * CellH + OffY2;
     OwnerForm.Top    = 10;
     OwnerForm.Left   = 10;
     //Cursor
     cx = ClopWar.RedBaseX;
     cy = ClopWar.RedBaseY;
     //refresh
     enablerefresh = true;
     //Info
     InfoString = "Info";
     //OldField
     OldField = new int[FieldW, FieldH];
     for (int i = 0; i < FieldW; i++)
     {
         for (int j = 0; j < FieldH; j++)
         {
             OldField[i, j] = -1;
         }
     }
 }
Exemplo n.º 2
0
        private void frmTool_Load(object sender, EventArgs e)
        {
            //Icon
            //Icon= new Icon(GetType(),"clop.ico");

            //Show
            Show();

            //Enable double buffering to avoid flickering
            SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
            UpdateStyles();

            ClpDraw = new WinClopDraw(this);
            Clp     = new ClopWar(ClpDraw);
            ClpCPU  = new ClopCPU(Clp);

            ClpDraw.showtext     = false;
            ClpDraw.showavail    = false;
            ClpDraw.showcursor   = false;
            ClpDraw.dispclopleft = false;
            Clp.AutoRedraw       = false;

            //LoadStrat();

            fightThread = new Thread(DoFight);

            //Start!
            Clp.RedFirst = true;
        }
Exemplo n.º 3
0
        private void frmMain_Load(object sender, System.EventArgs e)
        {
            //Show
            this.Show();

            //Enable double buffering to avoid flickering
            this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw, true);
            this.UpdateStyles();

            ClpDraw = new WinClopDraw(this);
            Clp     = new ClopWar(ClpDraw);
            ClpCPU  = new ClopCPU(Clp);

            LoadStrat();

            loaded = true;

            //Max difficulty
            menuDifficultyImpossible_Click(null, null);
            //Start!
            Clp.RedFirst  = true;
            OpponentHuman = false;
            Clp.ResetGame();
            CheckGame();
        }
Exemplo n.º 4
0
        private const int TURN_NEARBASE2     = 1000;            //÷ена хода около своей базы

        //Constructor
        public ClopCPU(ClopWar cw)
        {
            ClpWar = cw;

            //Prepare pathfinder
            PathFinder.Dist   = new Clops_.a_star.GetDist(dist);
            PathFinder.NodeXY = new Clops_.a_star.GetNodeByXY(nodexy);
        }