ss/include/d/flag/enemyflag_manager.h
2024-10-25 15:36:39 +02:00

42 lines
1.1 KiB
C++

#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"
class EnemyflagManager : public CommittableFlagManager {
public:
FlagSpace mFlagSpace;
BitwiseFlagHelper mFlagHelper;
u16 mSceneIndex;
static u16 sEnemyDefeatFlags[4096];
static EnemyflagManager *sInstance;
void clearSavedFlags();
bool checkUncommittedFlag(u16 flag);
u16 checkUncommittedFlag2(u16 flag) {
return checkUncommittedFlag(flag);
}
EnemyflagManager();
void init();
void copyFromSave(u16 sceneIndex);
void updateFlagIndex(u16 sceneIndex);
void clearAll();
bool checkIsValidFlag(u16 flag);
bool checkFlag(u16 flag);
virtual ~EnemyflagManager() {}
virtual u16 getFlagCount() const;
void setFlag(u16 flag);
virtual void doCommit() override {
FileManager *mgr = FileManager::sInstance;
mgr->setEnemyDefeatFlags(mFlagSpace.getFlagPtrUnchecked(), 0, 0x1000);
};
};
#endif