diff --git a/src/game/position.cpp b/src/game/position.cpp index 7f9a73f5..9801b6f0 100644 --- a/src/game/position.cpp +++ b/src/game/position.cpp @@ -72,11 +72,6 @@ StateInfo::StateInfo(const StateInfo &state) *this = state; } -Position::Position(const Position &pos) -{ - *this = pos; -} - StateInfo::StateInfo(StateInfo &state) { if (position != nullptr) { @@ -89,64 +84,18 @@ StateInfo::StateInfo(StateInfo &state) *this = state; } -Position::Position(Position &pos) -{ - *this = pos; -} - StateInfo &StateInfo::operator= (const StateInfo &state) { memcpy(position, state.position, sizeof(Position)); return *this; } -Position &Position::operator= (const Position &pos) -{ - currentStep = pos.currentStep; - moveStep = pos.moveStep; - memcpy(board.locations, pos.board.locations, sizeof(board.locations)); - memcpy(board.byTypeBB, pos.board.byTypeBB, sizeof(board.byTypeBB)); - currentSquare = pos.currentSquare; - winner = pos.winner; - startTime = pos.startTime; - currentTime = pos.currentTime; - elapsedSeconds[BLACK] = pos.elapsedSeconds[BLACK]; - elapsedSeconds[WHITE] = pos.elapsedSeconds[WHITE]; - move = pos.move; - memcpy(cmdline, pos.cmdline, sizeof(cmdline)); - cmdlist = pos.cmdlist; - //tips = pos.tips; - - return *this; -} - StateInfo &StateInfo::operator= (StateInfo &state) { memcpy(position, state.position, sizeof(Position)); return *this; } -Position &Position::operator= (Position &pos) -{ - currentStep = pos.currentStep; - moveStep = pos.moveStep; - memcpy(board.locations, pos.board.locations, sizeof(board.locations)); - memcpy(board.byTypeBB, pos.board.byTypeBB, sizeof(board.byTypeBB)); - currentSquare = pos.currentSquare; - winner = pos.winner; - startTime = pos.startTime; - currentTime = pos.currentTime; - elapsedSeconds[BLACK] = pos.elapsedSeconds[BLACK]; - elapsedSeconds[WHITE] = pos.elapsedSeconds[WHITE]; - move = pos.move; - memcpy(cmdline, pos.cmdline, sizeof(cmdline)); - cmdlist = pos.cmdlist; - //tips = pos.tips; - - return *this; -} - - int Position::countPiecesOnBoard() { nPiecesOnBoard[BLACK] = nPiecesOnBoard[WHITE] = 0; diff --git a/src/game/position.h b/src/game/position.h index 2df405d4..cfbc9979 100644 --- a/src/game/position.h +++ b/src/game/position.h @@ -43,11 +43,8 @@ public: Position(); virtual ~Position(); - Position(Position &); - Position(const Position &); - - Position &operator=(const Position &); - Position &operator=(Position &); + Position(const Position &) = delete; + Position &operator=(const Position &) = delete; Board board;