Commit 3f9eeea5 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Silence warning in BattleShipsConfiguration

We can use both the default copy constructor and the default assignment
operator
parent 4474d8f2
......@@ -36,16 +36,6 @@ BattleShipsConfiguration::BattleShipsConfiguration(unsigned int longestShipSize,
{
}
BattleShipsConfiguration::BattleShipsConfiguration(const BattleShipsConfiguration& copy)
: m_longestShip(copy.longestShip())
, m_allowAdjacentShips(copy.isAllowedAdjacentShips())
, m_boardWidth(copy.boardWidth())
, m_boardHeight(copy.boardHeight())
, m_fromXML(copy.m_fromXML)
, m_ships(copy.m_ships)
{
}
void BattleShipsConfiguration::setLongestShipSize(unsigned int longestShipSize)
{
m_longestShip = longestShipSize;
......
......@@ -46,7 +46,8 @@ public:
explicit BattleShipsConfiguration(const bool fromXML=false);
explicit BattleShipsConfiguration(unsigned int longestShipSize, const bool allowAdjacentShips, const unsigned int boardWidth, const unsigned int boardHeight, const bool fromXML=false);
BattleShipsConfiguration(const BattleShipsConfiguration& copy);
BattleShipsConfiguration(const BattleShipsConfiguration& copy) = default;
BattleShipsConfiguration& operator=(const BattleShipsConfiguration&) = default;
// does not add any ship longer than longestShip
// overwrites any previous configuration for ships of the requested size
BattleShipsConfiguration& addShips(unsigned int size, unsigned int number, QString shipsName, QString shipsPluralName);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment