93 lines
2.5 KiB
C++
93 lines
2.5 KiB
C++
#pragma once
|
|
|
|
// MassBuilderSaveTool
|
|
// Copyright (C) 2021-2024 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 <map>
|
|
|
|
#include <Corrade/Containers/String.h>
|
|
#include <Corrade/Containers/StringView.h>
|
|
|
|
#include "../GameData/ResourceIDs.h"
|
|
#include "../Gvas/File.h"
|
|
|
|
using namespace Corrade;
|
|
|
|
namespace mbst { namespace GameObjects {
|
|
|
|
class Profile {
|
|
public:
|
|
explicit Profile(Containers::StringView path);
|
|
|
|
bool valid() const;
|
|
|
|
auto lastError() const -> Containers::StringView;
|
|
|
|
auto filename() const -> Containers::StringView;
|
|
|
|
enum class Type: std::uint8_t {
|
|
Demo,
|
|
FullGame
|
|
};
|
|
|
|
auto type() const -> Type;
|
|
bool isDemo() const;
|
|
|
|
auto account() const -> Containers::StringView;
|
|
|
|
void refreshValues();
|
|
|
|
auto companyName() const -> Containers::StringView;
|
|
bool renameCompany(Containers::StringView new_name);
|
|
|
|
auto activeFrameSlot() const -> std::int32_t;
|
|
|
|
auto credits() const -> std::int32_t;
|
|
bool setCredits(std::int32_t credits);
|
|
|
|
auto storyProgress() const -> std::int32_t;
|
|
bool setStoryProgress(std::int32_t progress);
|
|
|
|
auto lastMissionId() const -> std::int32_t;
|
|
|
|
auto material(GameData::MaterialID id) const -> std::int32_t;
|
|
bool setMaterial(GameData::MaterialID id, std::int32_t amount);
|
|
|
|
private:
|
|
auto getResource(Containers::StringView container, GameData::MaterialID id) -> std::int32_t;
|
|
|
|
Containers::String _filename;
|
|
|
|
Type _type;
|
|
|
|
Gvas::File _profile;
|
|
|
|
Containers::String _name;
|
|
std::int32_t _activeFrameSlot = 0;
|
|
std::int32_t _credits = 0;
|
|
std::int32_t _storyProgress = 0;
|
|
std::int32_t _lastMissionId = 0;
|
|
|
|
std::map<GameData::MaterialID, std::int32_t> _materials;
|
|
|
|
Containers::String _account;
|
|
|
|
bool _valid = false;
|
|
Containers::String _lastError;
|
|
};
|
|
|
|
}}
|