From d4f3e07ae4bcd827d8e4747266281a3c0a16fdcb Mon Sep 17 00:00:00 2001 From: zv0n Date: Fri, 18 Dec 2020 16:02:23 +0100 Subject: [PATCH] TETRIS: make copySelf actually copy everything --- tetris/custom_classes.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tetris/custom_classes.hpp b/tetris/custom_classes.hpp index cd5e177..31bce03 100644 --- a/tetris/custom_classes.hpp +++ b/tetris/custom_classes.hpp @@ -33,7 +33,12 @@ public: pieces_bag[_index]++; } virtual std::shared_ptr< RenderObject > copySelf() override { - return std::make_shared< TetrisBlock >( *this ); + auto ret = std::make_shared< TetrisBlock >( *this ); + copyTo(ret); + return ret; + } + virtual void copyTo(std::shared_ptr other) override { + RectangleRender::copyTo(other); } std::shared_ptr< TetrisBlock > copyInScene() { auto ret = std::shared_ptr< TetrisBlock >( new TetrisBlock( *this ) );