ss/include/d/flag/storyflag_manager.h
Elijah Thomas f42f9a0e23
Some checks failed
Build / build (SOUE01) (push) Has been cancelled
d_a_obj_seat_sword OK (#107)
* d_a_obj_seat_sword mostly done

* ninja apply

* symbol cleanup

* correct code pattern, not right regs

* d_a_obj_seat_sword OK

---------

Co-authored-by: robojumper <robojumper@gmail.com>
2024-11-15 12:28:43 -05:00

43 lines
1.1 KiB
C++

#ifndef D_FLAG_STORYFLAG_MANAGER_H
#define D_FLAG_STORYFLAG_MANAGER_H
#include "d/flag/baseflag_manager.h"
#include "toBeSorted/file_manager.h"
class StoryflagManager : public ItemStoryManagerBase {
public:
StoryflagManager();
virtual ~StoryflagManager() {}
FlagSpace mStoryFlags;
bool commit();
/** 0x0C */ virtual void initFlagSpace() override {
mpFlagSpace = &mStoryFlags;
}
/** 0x10 */ virtual void onDirty() override;
/** 0x14 */ virtual void copyFlagsFromSaveFirstTime() override;
/** 0x18 */ virtual void setupFlagIndex() override;
/** 0x1C */ virtual void doCommit() override {
u16 sz = mFlagCount;
u16 *flags = mpFlagSpace->getFlagPtrUnchecked();
FileManager::sInstance->setStoryFlags(flags, 0, sz);
}
/** 0x24 */ virtual void unsetFlag(u16 flag) override;
/** 0x38 */ virtual const u16 *getSaveFlagSpace() const override {
return FileManager::sInstance->getStoryFlagsConst();
};
u16 getFlag(u16 flag) const {
return getCounterOrFlag(flag);
}
public:
static StoryflagManager *sInstance;
static u16 sFlags[0x80];
};
#endif