Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit 2d1401e

Browse files
committed
修改EventBase接口;
1 parent 1a12527 commit 2d1401e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

include/events/event_interface.hpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,23 @@ namespace Cyan
99
class EventBase : public Serializable
1010
{
1111
public:
12-
EventBase() {}
12+
EventBase() : bot_(nullptr) {}
13+
1314
static MiraiEvent GetMiraiEvent()
1415
{
1516
return MiraiEvent::Default;
1617
}
17-
virtual void SetMiraiBot(MiraiBot*) = 0;
18+
virtual void SetMiraiBot(MiraiBot* bot)
19+
{
20+
this->bot_ = bot;
21+
}
22+
virtual MiraiBot& GetMiraiBot()
23+
{
24+
return *bot_;
25+
}
1826
virtual ~EventBase() {}
27+
protected:
28+
MiraiBot* bot_;
1929
};
2030

2131

0 commit comments

Comments
 (0)