Exemple #1
0
        public void init(DPanel target, int w, int h)
        {
            envW         = w;
            envH         = h;
            objCounts    = new int[4];
            objCounts[0] = objCounts[1] = objCounts[2] = objCounts[3] = 0;

            strategyCounts    = new int[4];
            strategyCounts[0] = strategyCounts[1] = strategyCounts[2] = strategyCounts[3] = 0;

            countHistory         = new List <int[]>();
            strategyCountHistory = new List <int[]>();

            drawer = new GridDrawer(target);
        }
        public GridDrawer(DPanel dp)
        {
            target = dp;
            target.DBpanelgr.CreateDoubleBuffer(target.CreateGraphics(), target.ClientRectangle.Width, target.ClientRectangle.Height);

            gr  = target.DBpanelgr.g;
            pen = new Pen(Color.Black);
            Font font = new Font(new FontFamily("Arial"), 8);

            gridW = Environment.envW;
            gridH = Environment.envH;

            cellW = (float)target.ClientRectangle.Width / gridW;
            cellH = (float)target.ClientRectangle.Height / gridH;

            Utils.imgW = (int)(cellW - 1);
            Utils.imgH = (int)(cellH - 1);
        }
        public GridDrawer(DPanel dp)
        {
            target = dp;
            target.DBpanelgr.CreateDoubleBuffer(target.CreateGraphics(), target.ClientRectangle.Width, target.ClientRectangle.Height);

            gr = target.DBpanelgr.g;
            pen = new Pen(Color.Black);
            Font font = new Font(new FontFamily("Arial"), 8);

            gridW = Environment.envW;
            gridH = Environment.envH;

            cellW = (float)target.ClientRectangle.Width / gridW;
            cellH = (float)target.ClientRectangle.Height / gridH;

            Utils.imgW = (int)(cellW - 1);
            Utils.imgH = (int)(cellH - 1);
        }
Exemple #4
0
        public Environment(DPanel target, int w, int h)
        {
            init(target, w, h);

            initGrid(w, h);
        }
        public void init(DPanel target, int w, int h)
        {
            envW = w;
            envH = h;
            objCounts = new int[4];
            objCounts[0] = objCounts[1] = objCounts[2] = objCounts[3] = 0;

            strategyCounts = new int[4];
            strategyCounts[0] = strategyCounts[1] = strategyCounts[2] = strategyCounts[3] = 0;

            countHistory = new List<int[]>();
            strategyCountHistory = new List<int[]>();

            drawer = new GridDrawer(target);
        }
        public Environment(DPanel target, int w, int h)
        {
            init(target, w, h);

            initGrid(w, h);
        }