Exemplo n.º 1
0
        public MineFieldTile_View(MineFieldTile_Model inModel, Minefield_View inParent_view)
        {
            model       = inModel;
            parent_view = inParent_view;
            this.Width  = TILE_WIDTH;
            this.Height = TILE_HEIGHT;

            this.MouseUp += this.Btn_Click; //only handles mouse clicks.  Must use Mouse Up to be compatible with right clicking

            /* //Test Code - start
             * if (this.model.tileHasMine())
             * {
             *  this.BackColor = System.Drawing.Color.Azure;
             * }
             */                             // Test Code - end
        }
Exemplo n.º 2
0
        public Minefield_Model(int inHeight, int inWidth, int inNumMines = 1)
        {
            height   = inHeight;
            width    = inWidth;
            numMines = inNumMines;

            generateMineMap(ref mineMap);
            allTiles_Model = new MineFieldTile_Model[height][];
            for (int i = 0; i < height; i++)
            {
                allTiles_Model[i] = new MineFieldTile_Model[width];
                for (int j = 0; j < width; j++)
                {
                    allTiles_Model[i][j] = new MineFieldTile_Model(this, i, j, mineMap[i][j]);
                }
            }
        }
Exemplo n.º 3
0
 public SweepRecord(MineFieldTile_Model inTile, Minefield_Tile_Event inAction)
 {
     tile   = inTile;
     action = inAction;
 }
Exemplo n.º 4
0
 public void record(MineFieldTile_Model affectedTile, //the tile that the user clicked
                    Minefield_Tile_Event action       //what the user did to the tile:  swept, flagged, or questioned
                    )
 {
     allSweepRecords.Add(new SweepRecord(affectedTile, action));
 }