2020-01-12 14:54:23 +01:00
|
|
|
#ifndef MASSMANAGER_H
|
|
|
|
#define MASSMANAGER_H
|
|
|
|
|
|
|
|
// wxMASSManager
|
|
|
|
// Copyright (C) 2020 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/>.
|
|
|
|
|
2020-01-16 00:35:23 +01:00
|
|
|
#include <map>
|
2020-01-12 14:54:23 +01:00
|
|
|
#include <string>
|
|
|
|
|
2020-09-30 16:27:26 +02:00
|
|
|
#include <Corrade/Containers/GrowableArray.h>
|
2020-01-12 14:54:23 +01:00
|
|
|
|
2020-09-30 16:27:26 +02:00
|
|
|
#include "../Mass/Mass.h"
|
2020-06-20 10:39:05 +02:00
|
|
|
|
2020-01-12 14:54:23 +01:00
|
|
|
using namespace Corrade;
|
|
|
|
|
|
|
|
class MassManager {
|
|
|
|
public:
|
2020-09-30 16:27:26 +02:00
|
|
|
MassManager(const std::string& save_path, const std::string& steam_id, bool demo);
|
2020-07-22 08:55:12 +02:00
|
|
|
|
2020-01-12 14:54:23 +01:00
|
|
|
auto saveDirectory() -> std::string const&;
|
2020-01-16 00:35:23 +01:00
|
|
|
auto stagingAreaDirectory() -> std::string const&;
|
2020-06-20 10:39:05 +02:00
|
|
|
|
2020-09-30 16:27:26 +02:00
|
|
|
auto lastError() -> std::string const&;
|
2020-01-12 14:54:23 +01:00
|
|
|
|
2020-09-30 16:27:26 +02:00
|
|
|
auto massName(int hangar) -> std::string const&;
|
|
|
|
auto massState(int hangar) -> MassState;
|
2020-01-12 14:54:23 +01:00
|
|
|
|
2020-09-30 16:27:26 +02:00
|
|
|
void refreshHangar(int hangar);
|
2020-01-12 14:54:23 +01:00
|
|
|
|
2020-01-16 00:35:23 +01:00
|
|
|
auto importMass(int staged_index, int hangar) -> bool;
|
|
|
|
auto exportMass(int hangar) -> bool;
|
2020-01-12 14:54:23 +01:00
|
|
|
|
|
|
|
auto moveMass(int source, int destination) -> bool;
|
|
|
|
auto deleteMass(int hangar) -> bool;
|
2020-06-13 22:28:44 +02:00
|
|
|
auto renameMass(int hangar, const std::string& new_name) -> bool;
|
|
|
|
|
2020-09-30 16:27:26 +02:00
|
|
|
auto stagedMasses() -> std::map<std::string, std::string> const&;
|
2020-01-12 14:54:23 +01:00
|
|
|
|
2020-10-02 12:55:31 +02:00
|
|
|
auto stagedMassName(int index) -> std::string const&;
|
2020-01-12 14:54:23 +01:00
|
|
|
|
2020-01-16 00:35:23 +01:00
|
|
|
auto updateStagedMass(const std::string& filename) -> int;
|
|
|
|
auto removeStagedMass(const std::string& filename) -> int;
|
2020-01-16 01:21:47 +01:00
|
|
|
void deleteStagedMass(int index);
|
2020-06-20 10:39:05 +02:00
|
|
|
|
2020-01-12 14:54:23 +01:00
|
|
|
private:
|
2020-09-30 16:27:26 +02:00
|
|
|
std::string _saveDirectory;
|
|
|
|
std::string _steamId;
|
|
|
|
bool _demo;
|
2020-01-12 14:54:23 +01:00
|
|
|
|
|
|
|
std::string _lastError = "";
|
|
|
|
|
2020-09-30 16:27:26 +02:00
|
|
|
Containers::Array<Mass> _hangars;
|
2020-01-12 14:54:23 +01:00
|
|
|
|
2020-09-30 16:27:26 +02:00
|
|
|
static const std::string _stagingAreaDirectory;
|
2020-01-16 00:35:23 +01:00
|
|
|
|
|
|
|
std::map<std::string, std::string> _stagedMasses;
|
2020-01-12 14:54:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //MASSMANAGER_H
|