MassBuilderSaveTool/src/Profile/Profile.h

187 lines
5.2 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 <Corrade/Containers/String.h>
#include <Corrade/Containers/StringView.h>
#include <Magnum/Magnum.h>
#include "../UESaveFile/UESaveFile.h"
#include "ResourceIDs.h"
using namespace Corrade;
using namespace Magnum;
enum class ProfileType : UnsignedByte {
Demo,
FullGame
};
class Profile {
public:
explicit Profile(Containers::StringView path);
auto valid() const -> bool;
auto lastError() const -> Containers::StringView;
auto filename() const -> Containers::StringView;
auto type() const -> ProfileType;
auto isDemo() const -> bool;
auto account() const -> Containers::StringView;
void refreshValues();
auto companyName() const -> Containers::StringView;
auto renameCompany(Containers::StringView 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;
Int halliteFragma() const;
bool setHalliteFragma(Int amount);
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;
Int nanoc() const;
bool setNanoc(Int amount);
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;
Int cosmium() const;
bool setCosmium(Int amount);
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;
Int isolatedVoidParticle() const;
bool setIsolatedVoidParticle(Int amount);
private:
auto getResource(Containers::StringView container, MaterialID id) -> Int;
auto setResource(Containers::StringView container, MaterialID id, Int amount) -> bool;
Containers::String _filename;
ProfileType _type;
UESaveFile _profile;
Containers::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 _halliteFragma = 0;
Int _ednil = 0;
Int _nuflalt = 0;
Int _aurelene = 0;
Int _soldus = 0;
Int _synthesisedN = 0;
Int _nanoc = 0;
Int _alcarbonite = 0;
Int _keriphene = 0;
Int _nitinolCM = 0;
Int _quarkium = 0;
Int _alterene = 0;
Int _cosmium = 0;
Int _mixedComposition = 0;
Int _voidResidue = 0;
Int _muscularConstruction = 0;
Int _mineralExoskeletology = 0;
Int _carbonisedSkin = 0;
Int _isolatedVoidParticle = 0;
Containers::String _account;
bool _valid = false;
Containers::String _lastError;
};