Ejemplo n.º 1
0
 public void autoSweep(MineFieldTile_View origin)
 {
     foreach (MineFieldTile_View mftv in this.getNeighboringTiles(origin))
     {
         if (!mftv.getModel().tileHasBeenSwept())
         {
             mftv.sweep(false);
         }
     }
 }
Ejemplo n.º 2
0
        public Minefield_View(Minefield_Model inModel, Form inParentView)
        {
            model       = inModel;
            parent_view = inParentView;
            field       = new MineFieldTile_View[model.getHeight()][];

            for (int i = 0; i < model.getHeight(); i++)
            {
                field[i] = new MineFieldTile_View[model.getWidth()];
                for (int j = 0; j < model.getWidth(); j++)
                {
                    field[i][j]        = new MineFieldTile_View(model.getMineFieldTile_Model(i, j), this);
                    field[i][j].Margin = new Padding(0);
                    this.Controls.Add(field[i][j]);
                }
            }
            this.Width   = model.getWidth() * MineFieldTile_View.TILE_WIDTH;
            this.Height  = model.getHeight() * MineFieldTile_View.TILE_HEIGHT;
            this.Margin  = new Padding(0);
            this.Padding = new Padding(0);
        }
Ejemplo n.º 3
0
 public List <MineFieldTile_View> getNeighboringTiles(MineFieldTile_View origin)
 {
     return(getNeighboringTiles(origin.getModel().getYPos(), origin.getModel().getXPos()));
 }