2021-06-11 19:24:52 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// MassBuilderSaveTool
|
|
|
|
// Copyright (C) 2021 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 <string>
|
|
|
|
|
|
|
|
#include <Corrade/Containers/GrowableArray.h>
|
|
|
|
|
|
|
|
#include "../Mass/Mass.h"
|
|
|
|
|
|
|
|
using namespace Corrade;
|
|
|
|
|
|
|
|
class MassManager {
|
|
|
|
public:
|
2021-07-21 20:57:39 +02:00
|
|
|
MassManager(const std::string& save_path, const std::string& steam_id, bool demo, const std::string& staging_dir);
|
2021-06-11 19:24:52 +02:00
|
|
|
|
|
|
|
auto lastError() -> std::string const&;
|
|
|
|
|
2021-08-19 20:33:59 +02:00
|
|
|
auto hangar(int hangar) -> Mass&;
|
2021-06-11 19:24:52 +02:00
|
|
|
|
|
|
|
void refreshHangar(int hangar);
|
|
|
|
|
|
|
|
auto importMass(const std::string& staged_fn, int hangar) -> bool;
|
|
|
|
auto exportMass(int hangar) -> bool;
|
|
|
|
|
|
|
|
auto moveMass(int source, int destination) -> bool;
|
|
|
|
auto deleteMass(int hangar) -> bool;
|
|
|
|
|
|
|
|
auto stagedMasses() -> std::map<std::string, std::string> const&;
|
|
|
|
void refreshStagedMasses();
|
|
|
|
auto deleteStagedMass(const std::string& filename) -> bool;
|
|
|
|
|
|
|
|
private:
|
2021-07-21 20:57:39 +02:00
|
|
|
const std::string& _saveDirectory;
|
|
|
|
const std::string& _steamId;
|
2021-06-11 19:24:52 +02:00
|
|
|
bool _demo;
|
|
|
|
|
2021-07-21 12:38:27 +02:00
|
|
|
std::string _lastError;
|
2021-06-11 19:24:52 +02:00
|
|
|
|
|
|
|
Containers::Array<Mass> _hangars;
|
|
|
|
|
2021-07-21 20:57:39 +02:00
|
|
|
const std::string& _stagingAreaDirectory;
|
2021-06-11 19:24:52 +02:00
|
|
|
|
|
|
|
std::map<std::string, std::string> _stagedMasses;
|
|
|
|
};
|