Example #1
0
 public MainForm()
 {
     InitializeComponent();
     MineField = new MineField(VALLOC_NODE_LIMIT);
     AllocateMemory(MineField);
     mineFieldControl.DataSource      = MineField;
     mineFieldControl.SquareRevealed += SquareRevealedCallback;
     mineFieldControl.FirstClick     += FirstClickCallback;
     stopwatch      = new Stopwatch();
     FlagsRemaining = MineField.TotalMines;
     mineFieldControl.MineFlagged += MineFlaggedCallback;
     RevealedCells = new List <uint>();
 }
Example #2
0
 private void AllocateMemory(MineField mf)
 {
     for (uint num = 0u; num < VALLOC_NODE_LIMIT; num++)
     {
         for (uint num2 = 0u; num2 < VALLOC_NODE_LIMIT; num2++)
         {
             bool flag = true;
             uint r    = num + 1;
             uint c    = num2 + 1;
             if (VALLOC_TYPES.Contains(DeriveVallocType(r, c)))
             {
                 flag = false;
             }
             mf.GarbageCollect[num2, num] = flag;
         }
     }
 }