2024-10-25 12:36:31 +00:00
|
|
|
#ifndef D_FLAG_ENEMYFLAG_MANAGER_H
|
|
|
|
#define D_FLAG_ENEMYFLAG_MANAGER_H
|
|
|
|
|
|
|
|
#include "d/flag/bitwise_flag_helper.h"
|
|
|
|
#include "d/flag/committable_flag_manager.h"
|
|
|
|
#include "d/flag/flag_space.h"
|
|
|
|
#include "toBeSorted/file_manager.h"
|
|
|
|
|
2024-10-25 13:36:39 +00:00
|
|
|
class EnemyflagManager : public CommittableFlagManager {
|
2024-10-25 12:36:31 +00:00
|
|
|
public:
|
|
|
|
FlagSpace mFlagSpace;
|
|
|
|
BitwiseFlagHelper mFlagHelper;
|
|
|
|
u16 mSceneIndex;
|
|
|
|
|
|
|
|
static u16 sEnemyDefeatFlags[4096];
|
|
|
|
|
2024-10-25 13:36:39 +00:00
|
|
|
static EnemyflagManager *sInstance;
|
2024-10-25 12:36:31 +00:00
|
|
|
|
|
|
|
void clearSavedFlags();
|
|
|
|
bool checkUncommittedFlag(u16 flag);
|
|
|
|
u16 checkUncommittedFlag2(u16 flag) {
|
|
|
|
return checkUncommittedFlag(flag);
|
|
|
|
}
|
2024-10-25 13:36:39 +00:00
|
|
|
EnemyflagManager();
|
2024-10-25 12:36:31 +00:00
|
|
|
void init();
|
|
|
|
void copyFromSave(u16 sceneIndex);
|
|
|
|
void updateFlagIndex(u16 sceneIndex);
|
|
|
|
void clearAll();
|
|
|
|
bool checkIsValidFlag(u16 flag);
|
|
|
|
bool checkFlag(u16 flag);
|
2024-10-25 13:36:39 +00:00
|
|
|
virtual ~EnemyflagManager() {}
|
2024-10-25 12:36:31 +00:00
|
|
|
virtual u16 getFlagCount() const;
|
|
|
|
void setFlag(u16 flag);
|
|
|
|
|
|
|
|
virtual void doCommit() override {
|
|
|
|
FileManager *mgr = FileManager::sInstance;
|
|
|
|
mgr->setEnemyDefeatFlags(mFlagSpace.getFlagPtrUnchecked(), 0, 0x1000);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|