MassBuilderSaveTool/src/Profile/Profile.h

187 lines
5.2 KiB
C
Raw Normal View History

#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>
2021-06-20 14:07:43 +02:00
#include <Magnum/Magnum.h>
#include "../UESaveFile/UESaveFile.h"
2022-02-25 21:00:32 +01:00
#include "ResourceIDs.h"
using namespace Corrade;
2021-06-20 14:07:43 +02:00
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;
2022-03-09 13:25:26 +01:00
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;
2021-06-20 14:07:43 +02:00
auto setCredits(Int credits) -> bool;
auto storyProgress() const -> Int;
2021-06-20 14:07:43 +02:00
auto setStoryProgress(Int progress) -> bool;
auto lastMissionId() const -> Int;
auto verseSteel() const -> Int;
2021-06-20 14:07:43 +02:00
auto setVerseSteel(Int amount) -> bool;
auto undinium() const -> Int;
2021-06-20 14:07:43 +02:00
auto setUndinium(Int amount) -> bool;
auto necriumAlloy() const -> Int;
2021-06-20 14:07:43 +02:00
auto setNecriumAlloy(Int amount) -> bool;
auto lunarite() const -> Int;
2021-06-20 14:07:43 +02:00
auto setLunarite(Int amount) -> bool;
auto asterite() const -> Int;
2021-06-20 14:07:43 +02:00
auto setAsterite(Int amount) -> bool;
Int halliteFragma() const;
bool setHalliteFragma(Int amount);
auto ednil() const -> Int;
2021-06-20 14:07:43 +02:00
auto setEdnil(Int amount) -> bool;
auto nuflalt() const -> Int;
2021-06-20 14:07:43 +02:00
auto setNuflalt(Int amount) -> bool;
auto aurelene() const -> Int;
2021-06-20 14:07:43 +02:00
auto setAurelene(Int amount) -> bool;
auto soldus() const -> Int;
2021-06-20 14:07:43 +02:00
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;
2021-06-20 14:07:43 +02:00
auto setAlcarbonite(Int amount) -> bool;
auto keriphene() const -> Int;
2021-06-20 14:07:43 +02:00
auto setKeriphene(Int amount) -> bool;
auto nitinolCM() const -> Int;
2021-06-20 14:07:43 +02:00
auto setNitinolCM(Int amount) -> bool;
auto quarkium() const -> Int;
2021-06-20 14:07:43 +02:00
auto setQuarkium(Int amount) -> bool;
auto alterene() const -> Int;
2021-06-20 14:07:43 +02:00
auto setAlterene(Int amount) -> bool;
Int cosmium() const;
bool setCosmium(Int amount);
auto mixedComposition() const -> Int;
2021-06-20 14:07:43 +02:00
auto setMixedComposition(Int amount) -> bool;
auto voidResidue() const -> Int;
2021-06-20 14:07:43 +02:00
auto setVoidResidue(Int amount) -> bool;
auto muscularConstruction() const -> Int;
2021-06-20 14:07:43 +02:00
auto setMuscularConstruction(Int amount) -> bool;
auto mineralExoskeletology() const -> Int;
2021-06-20 14:07:43 +02:00
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;
};