Mario: fix modifier deletion

This commit is contained in:
2021-08-07 12:13:23 +02:00
parent 7b1ef25f37
commit 6238022ed2
8 changed files with 88 additions and 77 deletions
+26 -22
View File
@@ -15,34 +15,34 @@ struct VisitorType {
class MouseVisitor : public SDLPP::Visitor {
public:
MouseVisitor() {}
virtual void visit( const SDLPP::RenderObject &obj ) override;
virtual void setFromId( uint64_t /*UNUSED*/ ) override {}
virtual uint64_t getFromId() override {
MouseVisitor() = default;
void visit( const SDLPP::RenderObject &obj ) override;
void setFromId( uint64_t /*UNUSED*/ ) override {}
uint64_t getFromId() const override {
return 0;
}
uint64_t getFlags() {
uint64_t getFlags() const {
return select_flags;
}
bool foundEditBox() {
bool foundEditBox() const {
return edit_box;
}
const SDLPP::Vec2D< int > &getEditBoxIndexes() {
const SDLPP::Vec2D< int > &getEditBoxIndexes() const {
return edit_box_location;
}
bool foundToolBox() {
bool foundToolBox() const {
return tool_box;
}
const SDLPP::Vec2D< int > &getToolBoxIndexes() {
const SDLPP::Vec2D< int > &getToolBoxIndexes() const {
return tool_box_location;
}
virtual void setVisitorType( uint64_t type ) override {
void setVisitorType( uint64_t type ) override {
_type = type;
}
virtual uint64_t getVisitorType() override {
uint64_t getVisitorType() const override {
return _type;
}
uint64_t getToolType() {
uint64_t getToolType() const {
return tool_box_type;
}
@@ -61,38 +61,42 @@ private:
bool tool_box = false;
SDLPP::Vec2D< int > edit_box_location = { -1, -1 };
SDLPP::Vec2D< int > tool_box_location = { -1, -1 };
uint64_t _type;
uint64_t _type{};
uint64_t tool_box_type = 0;
};
class ToolVisitor : public SDLPP::Visitor {
public:
ToolVisitor(){};
virtual void visit( const SDLPP::RenderObject &obj ) override;
virtual void setFromId( uint64_t id ) override {
ToolVisitor() = default;
void visit( const SDLPP::RenderObject &obj ) override;
void setFromId( uint64_t id ) override {
source_id = id;
}
virtual uint64_t getFromId() override {
uint64_t getFromId() const override {
return source_id;
}
virtual void setVisitorType( uint64_t type ) override {
void setVisitorType( uint64_t type ) override {
_type = type;
}
virtual uint64_t getVisitorType() override {
uint64_t getVisitorType() const override {
return _type;
}
void setSourceType(LandType::Value type) {
source_type = type;
}
bool addBlock();
bool removeBlock();
void setSourceData(const uint64_t &data) {
_data = data;
}
bool addBlock() const;
bool removeBlock() const;
private:
bool remove_block = false;
bool add_block = true;
uint64_t source_id = 0;
uint64_t _type = 0;
LandType::Value source_type;
uint64_t _data = 0;
LandType::Value source_type{};
};
#endif