w.h" namespace std; :: LifeWidget (QWidget * parent)
: QWidget (parent)
{= new Life (this); = BLUE; _moves = 1; = FALSE; = FALSE; _now = -1; _level = 3; (70); (QSize (8, 8)) ; = game-> first (life-> points); = new point * [8]; (size_t i = 0; i <8; i + +)
{[i] = new point [8]; (size_t j = 0; j <8; j + +) [i] [j] = point ();
}> change_board (p, life-> points); _event_history (p);
} :: ~ LifeWidget ()
{(size_t i = 0; i <8; i + +) p [i];
} LifeWidget :: add_event_history (point ** new_move)
{** tmp_2 = new_move; _2 = new point * [8]; (size_t i = 0; i <8; i + +)
{_2 [i] = new point [8]; (size_t j = 0; j <8; j + +) _2 [i] [j] = new_move [i] [j];
} _moves.push_back (tmp_2); _now + +;
} LifeWidget :: set_game_level (size_t level)
{(level == 1) _level = 1; if (level == 0) _level = 0;
} LifeWidget :: history_up ()
{_now + +; (state_now> = history_moves.size ())
{_now -;;
}
{** p = history_moves [state_now];> change_board (life-> points, p); = BLUE; ();
}
} LifeWidget :: history_down ()
{_now -; (state_now <= 0)
{_now + +;;
}
{** p = history_moves [state_now];> change_board (life-> points, p); = BLUE; ();
}
} LifeWidget :: setGridSize (const QSize & size)
{> setGridSize (size); (); ();
} LifeWidget :: gridSize () const
{life-> gridSize ();
} LifeWidget :: setCellSize (int size)
{= size; (); ();
} LifeWidget :: cellSize () const
{cellSizeProperty;
} LifeWidget :: minimumSizeHint () const
{QSize (gridSize (). width () * cellSize (), gridSize (). height () * cellSize ());
} LifeWidget :: sizeHint () const
{minimumSizeHint ();
} LifeWidget :: mousePressEvent (QMouseEvent * event)
{(! (game_level == 1 | | game_level == 0)) return; pos = QPoint (event-> pos (). x ()/cellSize (), event-> pos (). y ()/cellSize ()); (player == BLUE)
{(event-> button () == Qt :: RightButton)
{= false; = false;> refresh (); ();;
}
{= true; (event-> button () == Qt :: LeftButton &&! life-> cell (pos) && click1)
{> setCell (pos, true); click (p...