event lib

This commit is contained in:
lepelog
2022-06-27 01:37:35 +02:00
parent 63cbb8bbc1
commit d4cde560b2
14 changed files with 155 additions and 505 deletions
+39
View File
@@ -2,5 +2,44 @@
#define D_EVENT_D_EVENT_LIB_H
#include "dolphin/types.h"
#include "f_op/f_op_actor.h"
template <typename A0>
struct action_class {
typedef BOOL (A0::*fptr)();
fptr init;
fptr execute;
action_class(fptr pInit, fptr pExecute) {
init = pInit;
execute = pExecute;
}
fptr& getInit() { return init; }
fptr& getExecute() { return execute; }
};
struct dEvLib_callback_c {
/* 8004886C */ BOOL eventUpdate();
/* 800488A4 */ BOOL setEvent(int, int, int);
/* 80048940 */ void orderEvent(int, int, int);
/* 80048970 */ BOOL setAction(action_class<dEvLib_callback_c>*);
/* 800489A8 */ BOOL initAction();
/* 800489F8 */ BOOL executeAction();
/* 80048A50 */ BOOL initStart();
/* 80048A70 */ BOOL executeStart();
/* 80048B1C */ BOOL initRun();
/* 80048B48 */ BOOL executeRun();
virtual ~dEvLib_callback_c() {}
virtual BOOL eventStart() { return TRUE; }
virtual BOOL eventRun() { return TRUE; }
virtual BOOL eventEnd() { return TRUE; }
fopAc_ac_c* mActor;
action_class<dEvLib_callback_c>* mAction;
u16 _C;
};
#endif /* D_EVENT_D_EVENT_LIB_H */
+3 -1
View File
@@ -17,10 +17,12 @@ public:
char* getEventName();
void beforeProc();
void onCondition(u16);
void i_onCondition(u16 cond) { mCondition |= cond; }
void offCondition(u16);
void i_offCondition(u16 cond) { mCondition &= ~cond; }
bool checkCommandCatch();
BOOL checkCommandDoor();
bool checkCommandDemoAccrpt();
BOOL checkCommandDemoAccrpt() { return mCommand == 2; }
void setCommand(u16 command) { mCommand = command; }
void setMapToolId(u8 id) { mMapToolId = id; }