Profile: use Magnum types.

This commit is contained in:
Guillaume Jacquemin 2021-06-20 14:07:43 +02:00
parent 6886334d61
commit 5bdb710356
2 changed files with 214 additions and 212 deletions

View file

@ -165,11 +165,11 @@ auto Profile::renameCompany(const std::string& new_name) -> bool {
}
}
auto Profile::activeFrameSlot() const -> std::int8_t {
auto Profile::activeFrameSlot() const -> Int {
return _activeFrameSlot;
}
auto Profile::getActiveFrameSlot() -> std::int8_t {
auto Profile::getActiveFrameSlot() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &active_slot_locator[0], &active_slot_locator[31]);
@ -190,17 +190,17 @@ auto Profile::getActiveFrameSlot() -> std::int8_t {
return _activeFrameSlot;
}
auto Profile::credits() const -> std::int32_t {
auto Profile::credits() const -> Int {
return _credits;
}
auto Profile::getCredits() -> std::int32_t {
auto Profile::getCredits() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &credits_locator[0], &credits_locator[22]);
if(iter != mmap.end()) {
_credits = *reinterpret_cast<const std::int32_t*>(iter + 0x20);
_credits = *reinterpret_cast<const Int*>(iter + 0x20);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -210,13 +210,13 @@ auto Profile::getCredits() -> std::int32_t {
return _credits;
}
auto Profile::setCredits(std::int32_t amount) -> bool {
auto Profile::setCredits(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &credits_locator[0], &credits_locator[22]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x20) = amount;
*reinterpret_cast<Int*>(iter + 0x20) = amount;
_credits = amount;
return true;
}
@ -226,17 +226,17 @@ auto Profile::setCredits(std::int32_t amount) -> bool {
}
}
auto Profile::storyProgress() const -> std::int32_t {
auto Profile::storyProgress() const -> Int {
return _storyProgress;
}
auto Profile::getStoryProgress() -> std::int32_t {
auto Profile::getStoryProgress() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &story_progress_locator[0], &story_progress_locator[29]);
if(iter != mmap.end()) {
_storyProgress = *reinterpret_cast<const std::int32_t*>(iter + 0x27);
_storyProgress = *reinterpret_cast<const Int*>(iter + 0x27);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -246,13 +246,13 @@ auto Profile::getStoryProgress() -> std::int32_t {
return _storyProgress;
}
auto Profile::setStoryProgress(std::int32_t progress) -> bool {
auto Profile::setStoryProgress(Int progress) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &story_progress_locator[0], &story_progress_locator[29]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x27) = progress;
*reinterpret_cast<Int*>(iter + 0x27) = progress;
_storyProgress = progress;
return true;
}
@ -262,17 +262,17 @@ auto Profile::setStoryProgress(std::int32_t progress) -> bool {
}
}
auto Profile::lastMissionId() const -> std::int32_t {
auto Profile::lastMissionId() const -> Int {
return _lastMissionId;
}
auto Profile::getLastMissionId() -> std::int32_t {
auto Profile::getLastMissionId() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &last_mission_id_locator[0], &last_mission_id_locator[29]);
if(iter != mmap.end()) {
_lastMissionId = *reinterpret_cast<const std::int32_t*>(iter + 0x27);
_lastMissionId = *reinterpret_cast<const Int*>(iter + 0x27);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -282,17 +282,17 @@ auto Profile::getLastMissionId() -> std::int32_t {
return _lastMissionId;
}
auto Profile::verseSteel() const -> std::int32_t {
auto Profile::verseSteel() const -> Int {
return _verseSteel;
}
auto Profile::getVerseSteel() -> std::int32_t {
auto Profile::getVerseSteel() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &verse_steel_locator[0], &verse_steel_locator[129]);
if(iter != mmap.end()) {
_verseSteel = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_verseSteel = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -302,13 +302,13 @@ auto Profile::getVerseSteel() -> std::int32_t {
return _verseSteel;
}
auto Profile::setVerseSteel(std::int32_t amount) -> bool {
auto Profile::setVerseSteel(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &verse_steel_locator[0], &verse_steel_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_verseSteel = amount;
return true;
}
@ -318,17 +318,17 @@ auto Profile::setVerseSteel(std::int32_t amount) -> bool {
}
}
auto Profile::undinium() const -> std::int32_t {
auto Profile::undinium() const -> Int {
return _undinium;
}
auto Profile::getUndinium() -> std::int32_t {
auto Profile::getUndinium() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &undinium_locator[0], &undinium_locator[129]);
if(iter != mmap.end()) {
_undinium = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_undinium = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -338,13 +338,13 @@ auto Profile::getUndinium() -> std::int32_t {
return _undinium;
}
auto Profile::setUndinium(std::int32_t amount) -> bool {
auto Profile::setUndinium(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &undinium_locator[0], &undinium_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_undinium = amount;
return true;
}
@ -354,17 +354,17 @@ auto Profile::setUndinium(std::int32_t amount) -> bool {
}
}
auto Profile::necriumAlloy() const -> std::int32_t {
auto Profile::necriumAlloy() const -> Int {
return _necriumAlloy;
}
auto Profile::getNecriumAlloy() -> std::int32_t {
auto Profile::getNecriumAlloy() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &necrium_alloy_locator[0], &necrium_alloy_locator[129]);
if(iter != mmap.end()) {
_necriumAlloy = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_necriumAlloy = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -374,13 +374,13 @@ auto Profile::getNecriumAlloy() -> std::int32_t {
return _necriumAlloy;
}
auto Profile::setNecriumAlloy(std::int32_t amount) -> bool {
auto Profile::setNecriumAlloy(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &necrium_alloy_locator[0], &necrium_alloy_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_necriumAlloy = amount;
return true;
}
@ -390,17 +390,17 @@ auto Profile::setNecriumAlloy(std::int32_t amount) -> bool {
}
}
auto Profile::lunarite() const -> std::int32_t {
auto Profile::lunarite() const -> Int {
return _lunarite;
}
auto Profile::getLunarite() -> std::int32_t {
auto Profile::getLunarite() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &lunarite_locator[0], &lunarite_locator[129]);
if(iter != mmap.end()) {
_lunarite = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_lunarite = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -410,13 +410,13 @@ auto Profile::getLunarite() -> std::int32_t {
return _lunarite;
}
auto Profile::setLunarite(std::int32_t amount) -> bool {
auto Profile::setLunarite(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &lunarite_locator[0], &lunarite_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_lunarite = amount;
return true;
}
@ -426,17 +426,17 @@ auto Profile::setLunarite(std::int32_t amount) -> bool {
}
}
auto Profile::asterite() const -> std::int32_t {
auto Profile::asterite() const -> Int {
return _asterite;
}
auto Profile::getAsterite() -> std::int32_t {
auto Profile::getAsterite() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &asterite_locator[0], &asterite_locator[129]);
if(iter != mmap.end()) {
_asterite = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_asterite = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -446,13 +446,13 @@ auto Profile::getAsterite() -> std::int32_t {
return _asterite;
}
auto Profile::setAsterite(std::int32_t amount) -> bool {
auto Profile::setAsterite(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &asterite_locator[0], &asterite_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_asterite = amount;
return true;
}
@ -462,17 +462,17 @@ auto Profile::setAsterite(std::int32_t amount) -> bool {
}
}
auto Profile::ednil() const -> std::int32_t {
auto Profile::ednil() const -> Int {
return _ednil;
}
auto Profile::getEdnil() -> std::int32_t {
auto Profile::getEdnil() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &ednil_locator[0], &ednil_locator[129]);
if(iter != mmap.end()) {
_ednil = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_ednil = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -482,13 +482,13 @@ auto Profile::getEdnil() -> std::int32_t {
return _ednil;
}
auto Profile::setEdnil(std::int32_t amount) -> bool {
auto Profile::setEdnil(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &ednil_locator[0], &ednil_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_ednil = amount;
return true;
}
@ -498,17 +498,17 @@ auto Profile::setEdnil(std::int32_t amount) -> bool {
}
}
auto Profile::nuflalt() const -> std::int32_t {
auto Profile::nuflalt() const -> Int {
return _nuflalt;
}
auto Profile::getNuflalt() -> std::int32_t {
auto Profile::getNuflalt() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &nuflalt_locator[0], &nuflalt_locator[129]);
if(iter != mmap.end()) {
_nuflalt = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_nuflalt = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -518,13 +518,13 @@ auto Profile::getNuflalt() -> std::int32_t {
return _nuflalt;
}
auto Profile::setNuflalt(std::int32_t amount) -> bool {
auto Profile::setNuflalt(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &nuflalt_locator[0], &nuflalt_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_nuflalt = amount;
return true;
}
@ -534,17 +534,17 @@ auto Profile::setNuflalt(std::int32_t amount) -> bool {
}
}
auto Profile::aurelene() const -> std::int32_t {
auto Profile::aurelene() const -> Int {
return _aurelene;
}
auto Profile::getAurelene() -> std::int32_t {
auto Profile::getAurelene() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &aurelene_locator[0], &aurelene_locator[129]);
if(iter != mmap.end()) {
_aurelene = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_aurelene = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -554,13 +554,13 @@ auto Profile::getAurelene() -> std::int32_t {
return _aurelene;
}
auto Profile::setAurelene(std::int32_t amount) -> bool {
auto Profile::setAurelene(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &aurelene_locator[0], &aurelene_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_aurelene = amount;
return true;
}
@ -570,17 +570,17 @@ auto Profile::setAurelene(std::int32_t amount) -> bool {
}
}
auto Profile::soldus() const -> std::int32_t {
auto Profile::soldus() const -> Int {
return _soldus;
}
auto Profile::getSoldus() -> std::int32_t {
auto Profile::getSoldus() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &soldus_locator[0], &soldus_locator[129]);
if(iter != mmap.end()) {
_soldus = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_soldus = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -590,13 +590,13 @@ auto Profile::getSoldus() -> std::int32_t {
return _soldus;
}
auto Profile::setSoldus(std::int32_t amount) -> bool {
auto Profile::setSoldus(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &soldus_locator[0], &soldus_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_soldus = amount;
return true;
}
@ -606,17 +606,17 @@ auto Profile::setSoldus(std::int32_t amount) -> bool {
}
}
auto Profile::synthesizedN() const -> std::int32_t {
auto Profile::synthesizedN() const -> Int {
return _synthesizedN;
}
auto Profile::getSynthesizedN() -> std::int32_t {
auto Profile::getSynthesizedN() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &synthesized_n_locator[0], &synthesized_n_locator[129]);
if(iter != mmap.end()) {
_synthesizedN = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_synthesizedN = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -626,13 +626,13 @@ auto Profile::getSynthesizedN() -> std::int32_t {
return _synthesizedN;
}
auto Profile::setSynthesizedN(std::int32_t amount) -> bool {
auto Profile::setSynthesizedN(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &synthesized_n_locator[0], &synthesized_n_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_synthesizedN = amount;
return true;
}
@ -642,17 +642,17 @@ auto Profile::setSynthesizedN(std::int32_t amount) -> bool {
}
}
auto Profile::alcarbonite() const -> std::int32_t {
auto Profile::alcarbonite() const -> Int {
return _alcarbonite;
}
auto Profile::getAlcarbonite() -> std::int32_t {
auto Profile::getAlcarbonite() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &alcarbonite_locator[0], &alcarbonite_locator[129]);
if(iter != mmap.end()) {
_alcarbonite = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_alcarbonite = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -662,13 +662,13 @@ auto Profile::getAlcarbonite() -> std::int32_t {
return _alcarbonite;
}
auto Profile::setAlcarbonite(std::int32_t amount) -> bool {
auto Profile::setAlcarbonite(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &alcarbonite_locator[0], &alcarbonite_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_alcarbonite = amount;
return true;
}
@ -678,17 +678,17 @@ auto Profile::setAlcarbonite(std::int32_t amount) -> bool {
}
}
auto Profile::keriphene() const -> std::int32_t {
auto Profile::keriphene() const -> Int {
return _keriphene;
}
auto Profile::getKeriphene() -> std::int32_t {
auto Profile::getKeriphene() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &keriphene_locator[0], &keriphene_locator[129]);
if(iter != mmap.end()) {
_keriphene = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_keriphene = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -698,13 +698,13 @@ auto Profile::getKeriphene() -> std::int32_t {
return _keriphene;
}
auto Profile::setKeriphene(std::int32_t amount) -> bool {
auto Profile::setKeriphene(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &keriphene_locator[0], &keriphene_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_keriphene = amount;
return true;
}
@ -714,17 +714,17 @@ auto Profile::setKeriphene(std::int32_t amount) -> bool {
}
}
auto Profile::nitinolCM() const -> std::int32_t {
auto Profile::nitinolCM() const -> Int {
return _nitinolCM;
}
auto Profile::getNitinolCM() -> std::int32_t {
auto Profile::getNitinolCM() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &nitinol_cm_locator[0], &nitinol_cm_locator[129]);
if(iter != mmap.end()) {
_nitinolCM = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_nitinolCM = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -734,13 +734,13 @@ auto Profile::getNitinolCM() -> std::int32_t {
return _nitinolCM;
}
auto Profile::setNitinolCM(std::int32_t amount) -> bool {
auto Profile::setNitinolCM(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &nitinol_cm_locator[0], &nitinol_cm_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_nitinolCM = amount;
return true;
}
@ -750,17 +750,17 @@ auto Profile::setNitinolCM(std::int32_t amount) -> bool {
}
}
auto Profile::quarkium() const -> std::int32_t {
auto Profile::quarkium() const -> Int {
return _quarkium;
}
auto Profile::getQuarkium() -> std::int32_t {
auto Profile::getQuarkium() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &quarkium_locator[0], &quarkium_locator[129]);
if(iter != mmap.end()) {
_quarkium = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_quarkium = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -770,13 +770,13 @@ auto Profile::getQuarkium() -> std::int32_t {
return _quarkium;
}
auto Profile::setQuarkium(std::int32_t amount) -> bool {
auto Profile::setQuarkium(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &quarkium_locator[0], &quarkium_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_quarkium = amount;
return true;
}
@ -786,17 +786,17 @@ auto Profile::setQuarkium(std::int32_t amount) -> bool {
}
}
auto Profile::alterene() const -> std::int32_t {
auto Profile::alterene() const -> Int {
return _alterene;
}
auto Profile::getAlterene() -> std::int32_t {
auto Profile::getAlterene() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &alterene_locator[0], &alterene_locator[129]);
if(iter != mmap.end()) {
_alterene = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_alterene = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -806,13 +806,13 @@ auto Profile::getAlterene() -> std::int32_t {
return _alterene;
}
auto Profile::setAlterene(std::int32_t amount) -> bool {
auto Profile::setAlterene(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &alterene_locator[0], &alterene_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_alterene = amount;
return true;
}
@ -822,17 +822,17 @@ auto Profile::setAlterene(std::int32_t amount) -> bool {
}
}
auto Profile::mixedComposition() const -> std::int32_t {
auto Profile::mixedComposition() const -> Int {
return _mixedComposition;
}
auto Profile::getMixedComposition() -> std::int32_t {
auto Profile::getMixedComposition() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &mixed_composition_locator[0], &mixed_composition_locator[129]);
if(iter != mmap.end()) {
_mixedComposition = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_mixedComposition = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -842,13 +842,13 @@ auto Profile::getMixedComposition() -> std::int32_t {
return _mixedComposition;
}
auto Profile::setMixedComposition(std::int32_t amount) -> bool {
auto Profile::setMixedComposition(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &mixed_composition_locator[0], &mixed_composition_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_mixedComposition = amount;
return true;
}
@ -858,17 +858,17 @@ auto Profile::setMixedComposition(std::int32_t amount) -> bool {
}
}
auto Profile::voidResidue() const -> std::int32_t {
auto Profile::voidResidue() const -> Int {
return _voidResidue;
}
auto Profile::getVoidResidue() -> std::int32_t {
auto Profile::getVoidResidue() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &void_residue_locator[0], &void_residue_locator[129]);
if(iter != mmap.end()) {
_voidResidue = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_voidResidue = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -878,13 +878,13 @@ auto Profile::getVoidResidue() -> std::int32_t {
return _voidResidue;
}
auto Profile::setVoidResidue(std::int32_t amount) -> bool {
auto Profile::setVoidResidue(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &void_residue_locator[0], &void_residue_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_voidResidue = amount;
return true;
}
@ -894,17 +894,17 @@ auto Profile::setVoidResidue(std::int32_t amount) -> bool {
}
}
auto Profile::muscularConstruction() const -> std::int32_t {
auto Profile::muscularConstruction() const -> Int {
return _muscularConstruction;
}
auto Profile::getMuscularConstruction() -> std::int32_t {
auto Profile::getMuscularConstruction() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &muscular_construction_locator[0], &muscular_construction_locator[129]);
if(iter != mmap.end()) {
_muscularConstruction = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_muscularConstruction = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -914,13 +914,13 @@ auto Profile::getMuscularConstruction() -> std::int32_t {
return _muscularConstruction;
}
auto Profile::setMuscularConstruction(std::int32_t amount) -> bool {
auto Profile::setMuscularConstruction(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &muscular_construction_locator[0], &muscular_construction_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_muscularConstruction = amount;
return true;
}
@ -930,17 +930,17 @@ auto Profile::setMuscularConstruction(std::int32_t amount) -> bool {
}
}
auto Profile::mineralExoskeletology() const -> std::int32_t {
auto Profile::mineralExoskeletology() const -> Int {
return _mineralExoskeletology;
}
auto Profile::getMineralExoskeletology() -> std::int32_t {
auto Profile::getMineralExoskeletology() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &mineral_exoskeletology_locator[0], &mineral_exoskeletology_locator[129]);
if(iter != mmap.end()) {
_mineralExoskeletology = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_mineralExoskeletology = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -950,13 +950,13 @@ auto Profile::getMineralExoskeletology() -> std::int32_t {
return _mineralExoskeletology;
}
auto Profile::setMineralExoskeletology(std::int32_t amount) -> bool {
auto Profile::setMineralExoskeletology(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &mineral_exoskeletology_locator[0], &mineral_exoskeletology_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_mineralExoskeletology = amount;
return true;
}
@ -966,17 +966,17 @@ auto Profile::setMineralExoskeletology(std::int32_t amount) -> bool {
}
}
auto Profile::carbonizedSkin() const -> std::int32_t {
auto Profile::carbonizedSkin() const -> Int {
return _carbonizedSkin;
}
auto Profile::getCarbonizedSkin() -> std::int32_t {
auto Profile::getCarbonizedSkin() -> Int {
auto mmap = Utility::Directory::mapRead(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &carbonized_skin_locator[0], &carbonized_skin_locator[129]);
if(iter != mmap.end()) {
_carbonizedSkin = *reinterpret_cast<const std::int32_t*>(iter + 0x8C);
_carbonizedSkin = *reinterpret_cast<const Int*>(iter + 0x8C);
}
else {
_lastError = "The profile save seems to be corrupted or the game didn't release the handle on the file.";
@ -986,13 +986,13 @@ auto Profile::getCarbonizedSkin() -> std::int32_t {
return _carbonizedSkin;
}
auto Profile::setCarbonizedSkin(std::int32_t amount) -> bool {
auto Profile::setCarbonizedSkin(Int amount) -> bool {
auto mmap = Utility::Directory::map(Utility::Directory::join(_profileDirectory, _filename));
auto iter = std::search(mmap.begin(), mmap.end(), &carbonized_skin_locator[0], &carbonized_skin_locator[129]);
if(iter != mmap.end()) {
*reinterpret_cast<std::int32_t*>(iter + 0x8C) = amount;
*reinterpret_cast<Int*>(iter + 0x8C) = amount;
_carbonizedSkin = amount;
return true;
}

View file

@ -16,11 +16,13 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <cstdint>
#include <string>
enum class ProfileType : std::uint8_t {
#include <Magnum/Magnum.h>
using namespace Magnum;
enum class ProfileType : UnsignedByte {
Demo,
FullGame
};
@ -45,99 +47,99 @@ class Profile {
auto getCompanyName() -> std::string const&;
auto renameCompany(const std::string& new_name) -> bool;
auto activeFrameSlot() const -> std::int8_t;
auto getActiveFrameSlot() -> std::int8_t;
auto activeFrameSlot() const -> Int;
auto getActiveFrameSlot() -> Int;
auto credits() const -> std::int32_t;
auto getCredits() -> std::int32_t;
auto setCredits(std::int32_t) -> bool;
auto credits() const -> Int;
auto getCredits() -> Int;
auto setCredits(Int credits) -> bool;
auto storyProgress() const -> std::int32_t;
auto getStoryProgress() -> std::int32_t;
auto setStoryProgress(std::int32_t progress) -> bool;
auto storyProgress() const -> Int;
auto getStoryProgress() -> Int;
auto setStoryProgress(Int progress) -> bool;
auto lastMissionId() const -> std::int32_t;
auto getLastMissionId() -> std::int32_t;
auto lastMissionId() const -> Int;
auto getLastMissionId() -> Int;
auto verseSteel() const -> std::int32_t;
auto getVerseSteel() -> std::int32_t;
auto setVerseSteel(std::int32_t amount) -> bool;
auto verseSteel() const -> Int;
auto getVerseSteel() -> Int;
auto setVerseSteel(Int amount) -> bool;
auto undinium() const -> std::int32_t;
auto getUndinium() -> std::int32_t;
auto setUndinium(std::int32_t amount) -> bool;
auto undinium() const -> Int;
auto getUndinium() -> Int;
auto setUndinium(Int amount) -> bool;
auto necriumAlloy() const -> std::int32_t;
auto getNecriumAlloy() -> std::int32_t;
auto setNecriumAlloy(std::int32_t amount) -> bool;
auto necriumAlloy() const -> Int;
auto getNecriumAlloy() -> Int;
auto setNecriumAlloy(Int amount) -> bool;
auto lunarite() const -> std::int32_t;
auto getLunarite() -> std::int32_t;
auto setLunarite(std::int32_t amount) -> bool;
auto lunarite() const -> Int;
auto getLunarite() -> Int;
auto setLunarite(Int amount) -> bool;
auto asterite() const -> std::int32_t;
auto getAsterite() -> std::int32_t;
auto setAsterite(std::int32_t amount) -> bool;
auto asterite() const -> Int;
auto getAsterite() -> Int;
auto setAsterite(Int amount) -> bool;
auto ednil() const -> std::int32_t;
auto getEdnil() -> std::int32_t;
auto setEdnil(std::int32_t amount) -> bool;
auto ednil() const -> Int;
auto getEdnil() -> Int;
auto setEdnil(Int amount) -> bool;
auto nuflalt() const -> std::int32_t;
auto getNuflalt() -> std::int32_t;
auto setNuflalt(std::int32_t amount) -> bool;
auto nuflalt() const -> Int;
auto getNuflalt() -> Int;
auto setNuflalt(Int amount) -> bool;
auto aurelene() const -> std::int32_t;
auto getAurelene() -> std::int32_t;
auto setAurelene(std::int32_t amount) -> bool;
auto aurelene() const -> Int;
auto getAurelene() -> Int;
auto setAurelene(Int amount) -> bool;
auto soldus() const -> std::int32_t;
auto getSoldus() -> std::int32_t;
auto setSoldus(std::int32_t amount) -> bool;
auto soldus() const -> Int;
auto getSoldus() -> Int;
auto setSoldus(Int amount) -> bool;
auto synthesizedN() const -> std::int32_t;
auto getSynthesizedN() -> std::int32_t;
auto setSynthesizedN(std::int32_t amount) -> bool;
auto synthesizedN() const -> Int;
auto getSynthesizedN() -> Int;
auto setSynthesizedN(Int amount) -> bool;
auto alcarbonite() const -> std::int32_t;
auto getAlcarbonite() -> std::int32_t;
auto setAlcarbonite(std::int32_t amount) -> bool;
auto alcarbonite() const -> Int;
auto getAlcarbonite() -> Int;
auto setAlcarbonite(Int amount) -> bool;
auto keriphene() const -> std::int32_t;
auto getKeriphene() -> std::int32_t;
auto setKeriphene(std::int32_t amount) -> bool;
auto keriphene() const -> Int;
auto getKeriphene() -> Int;
auto setKeriphene(Int amount) -> bool;
auto nitinolCM() const -> std::int32_t;
auto getNitinolCM() -> std::int32_t;
auto setNitinolCM(std::int32_t amount) -> bool;
auto nitinolCM() const -> Int;
auto getNitinolCM() -> Int;
auto setNitinolCM(Int amount) -> bool;
auto quarkium() const -> std::int32_t;
auto getQuarkium() -> std::int32_t;
auto setQuarkium(std::int32_t amount) -> bool;
auto quarkium() const -> Int;
auto getQuarkium() -> Int;
auto setQuarkium(Int amount) -> bool;
auto alterene() const -> std::int32_t;
auto getAlterene() -> std::int32_t;
auto setAlterene(std::int32_t amount) -> bool;
auto alterene() const -> Int;
auto getAlterene() -> Int;
auto setAlterene(Int amount) -> bool;
auto mixedComposition() const -> std::int32_t;
auto getMixedComposition() -> std::int32_t;
auto setMixedComposition(std::int32_t amount) -> bool;
auto mixedComposition() const -> Int;
auto getMixedComposition() -> Int;
auto setMixedComposition(Int amount) -> bool;
auto voidResidue() const -> std::int32_t;
auto getVoidResidue() -> std::int32_t;
auto setVoidResidue(std::int32_t amount) -> bool;
auto voidResidue() const -> Int;
auto getVoidResidue() -> Int;
auto setVoidResidue(Int amount) -> bool;
auto muscularConstruction() const -> std::int32_t;
auto getMuscularConstruction() -> std::int32_t;
auto setMuscularConstruction(std::int32_t amount) -> bool;
auto muscularConstruction() const -> Int;
auto getMuscularConstruction() -> Int;
auto setMuscularConstruction(Int amount) -> bool;
auto mineralExoskeletology() const -> std::int32_t;
auto getMineralExoskeletology() -> std::int32_t;
auto setMineralExoskeletology(std::int32_t amount) -> bool;
auto mineralExoskeletology() const -> Int;
auto getMineralExoskeletology() -> Int;
auto setMineralExoskeletology(Int amount) -> bool;
auto carbonizedSkin() const -> std::int32_t;
auto getCarbonizedSkin() -> std::int32_t;
auto setCarbonizedSkin(std::int32_t amount) -> bool;
auto carbonizedSkin() const -> Int;
auto getCarbonizedSkin() -> Int;
auto setCarbonizedSkin(Int amount) -> bool;
private:
std::string _profileDirectory;
@ -152,33 +154,33 @@ class Profile {
std::string _companyName;
std::int8_t _activeFrameSlot = 0;
Int _activeFrameSlot = 0;
std::int32_t _credits;
Int _credits;
std::int32_t _storyProgress;
Int _storyProgress;
std::int32_t _lastMissionId;
Int _lastMissionId;
std::int32_t _verseSteel;
std::int32_t _undinium;
std::int32_t _necriumAlloy;
std::int32_t _lunarite;
std::int32_t _asterite;
std::int32_t _ednil;
std::int32_t _nuflalt;
std::int32_t _aurelene;
std::int32_t _soldus;
std::int32_t _synthesizedN;
std::int32_t _alcarbonite;
std::int32_t _keriphene;
std::int32_t _nitinolCM;
std::int32_t _quarkium;
std::int32_t _alterene;
Int _verseSteel;
Int _undinium;
Int _necriumAlloy;
Int _lunarite;
Int _asterite;
Int _ednil;
Int _nuflalt;
Int _aurelene;
Int _soldus;
Int _synthesizedN;
Int _alcarbonite;
Int _keriphene;
Int _nitinolCM;
Int _quarkium;
Int _alterene;
std::int32_t _mixedComposition;
std::int32_t _voidResidue;
std::int32_t _muscularConstruction;
std::int32_t _mineralExoskeletology;
std::int32_t _carbonizedSkin;
Int _mixedComposition;
Int _voidResidue;
Int _muscularConstruction;
Int _mineralExoskeletology;
Int _carbonizedSkin;
};