Exemplo n.º 1
0
        public Field(int n, int m)
        {
            this.n = n;
            this.m = m;
            Width  = Form1.size * m;
            Height = Form1.size * n;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < m; j++)
                {
                    Controls.Add(new Part(i, j));
                }
            }

            Name = "field";

            map["diag"]    = new XY_Int(1, 1);
            map["hor"]     = new XY_Int(0, 1);
            map["diag_in"] = new XY_Int(-1, 1);
            map["ver"]     = new XY_Int(1, 0);

            if_five          = ifFive;
            set_normal_image = setNormalImage;
            back_step        = backStep;
            draw_complete    = drawComplete;
            replace          = _replace;
        }
Exemplo n.º 2
0
 bool ifFive(string name)
 {
     foreach (var Var in map)
     {
         XY_Int xy = Var.Value;
         if (linearIfFive(name, xy.x, xy.y))
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 3
0
 public static string toStr(XY_Int xy)
 {
     return(toStr(xy.x, xy.y));
 }