MassBuilderSaveTool/src/Profile/Profile.h

176 lines
4.7 KiB
C++

#pragma once
// MassBuilderSaveTool
// Copyright (C) 2021-2022 Guillaume Jacquemin
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// 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 <string>
#include <Magnum/Magnum.h>
#include "../UESaveFile/UESaveFile.h"
#include "ResourceIDs.h"
using namespace Magnum;
enum class ProfileType : UnsignedByte {
Demo,
FullGame
};
enum class ProfileVersion : UnsignedByte {
Legacy, // pre-0.8
Normal // 0.8 and later
};
class Profile {
public:
explicit Profile(const std::string& path);
auto valid() const -> bool;
auto lastError() const -> std::string const&;
auto filename() const -> std::string const&;
auto type() const -> ProfileType;
auto version() const -> ProfileVersion;
auto account() const -> std::string const&;
void refreshValues();
auto companyName() const -> std::string const&;
auto renameCompany(const std::string& new_name) -> bool;
auto activeFrameSlot() const -> Int;
auto credits() const -> Int;
auto setCredits(Int credits) -> bool;
auto storyProgress() const -> Int;
auto setStoryProgress(Int progress) -> bool;
auto lastMissionId() const -> Int;
auto verseSteel() const -> Int;
auto setVerseSteel(Int amount) -> bool;
auto undinium() const -> Int;
auto setUndinium(Int amount) -> bool;
auto necriumAlloy() const -> Int;
auto setNecriumAlloy(Int amount) -> bool;
auto lunarite() const -> Int;
auto setLunarite(Int amount) -> bool;
auto asterite() const -> Int;
auto setAsterite(Int amount) -> bool;
auto ednil() const -> Int;
auto setEdnil(Int amount) -> bool;
auto nuflalt() const -> Int;
auto setNuflalt(Int amount) -> bool;
auto aurelene() const -> Int;
auto setAurelene(Int amount) -> bool;
auto soldus() const -> Int;
auto setSoldus(Int amount) -> bool;
auto synthesisedN() const -> Int;
auto setSynthesisedN(Int amount) -> bool;
auto alcarbonite() const -> Int;
auto setAlcarbonite(Int amount) -> bool;
auto keriphene() const -> Int;
auto setKeriphene(Int amount) -> bool;
auto nitinolCM() const -> Int;
auto setNitinolCM(Int amount) -> bool;
auto quarkium() const -> Int;
auto setQuarkium(Int amount) -> bool;
auto alterene() const -> Int;
auto setAlterene(Int amount) -> bool;
auto mixedComposition() const -> Int;
auto setMixedComposition(Int amount) -> bool;
auto voidResidue() const -> Int;
auto setVoidResidue(Int amount) -> bool;
auto muscularConstruction() const -> Int;
auto setMuscularConstruction(Int amount) -> bool;
auto mineralExoskeletology() const -> Int;
auto setMineralExoskeletology(Int amount) -> bool;
auto carbonisedSkin() const -> Int;
auto setCarbonisedSkin(Int amount) -> bool;
private:
auto getResource(const char* container, MaterialID id) -> Int;
auto setResource(const char* container, MaterialID id, Int amount) -> bool;
std::string _filename;
ProfileType _type;
ProfileVersion _version;
UESaveFile _profile;
std::string _name;
Int _activeFrameSlot = 0;
Int _credits = 0;
Int _storyProgress = 0;
Int _lastMissionId = 0;
Int _verseSteel = 0;
Int _undinium = 0;
Int _necriumAlloy = 0;
Int _lunarite = 0;
Int _asterite = 0;
Int _ednil = 0;
Int _nuflalt = 0;
Int _aurelene = 0;
Int _soldus = 0;
Int _synthesisedN = 0;
Int _alcarbonite = 0;
Int _keriphene = 0;
Int _nitinolCM = 0;
Int _quarkium = 0;
Int _alterene = 0;
Int _mixedComposition = 0;
Int _voidResidue = 0;
Int _muscularConstruction = 0;
Int _mineralExoskeletology = 0;
Int _carbonisedSkin = 0;
std::string _account;
bool _valid = false;
std::string _lastError;
};