speciesgen/src/starbound/frames.cpp

75 lines
2.3 KiB
C++
Raw Normal View History

2023-03-27 13:36:18 +00:00
/*
speciesgen
2023-04-26 12:42:24 +00:00
Copyright (C) 2022-2023 prisixia
2023-03-27 13:36:18 +00:00
This file is part of speciesgen.
speciesgen 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.
speciesgen 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 speciesgen. If not, see <https://www.gnu.org/licenses/>.
*/
#include "starbound/frames.h"
2023-05-04 08:54:08 +00:00
namespace Starbound::Frames {
2023-03-27 13:36:18 +00:00
//----------------------------------------------------------------------
// Grid
//----------------------------------------------------------------------
2023-05-05 18:29:32 +00:00
Grid::Grid(std::vector<std::vector<std::optional<std::string>>> names,
2023-03-27 13:36:18 +00:00
const std::tuple<uint32_t, uint32_t> size,
const std::tuple<uint32_t, uint32_t> dimensions)
2023-05-05 18:29:32 +00:00
: m_size(size), m_dimensions(dimensions), m_names(std::move(names)) {}
2023-03-27 13:36:18 +00:00
std::tuple<uint32_t, uint32_t> Grid::GetSize() const { return m_size; }
std::tuple<uint32_t, uint32_t> Grid::GetDimensions() const {
return m_dimensions;
}
std::vector<std::vector<std::optional<std::string>>> Grid::GetNames() const {
return m_names;
}
void Grid::SetSize(const std::tuple<uint32_t, uint32_t> size) { m_size = size; }
void Grid::SetDimensions(const std::tuple<uint32_t, uint32_t> dimensions) {
m_dimensions = dimensions;
}
void Grid::SetNames(
const std::vector<std::vector<std::optional<std::string>>> &names) {
2023-03-27 13:36:18 +00:00
m_names = names;
}
//----------------------------------------------------------------------
// Frames
//----------------------------------------------------------------------
2023-05-05 18:29:32 +00:00
Frames::Frames(std::unordered_map<std::string, std::string> aliases, Grid grid)
: m_aliases(std::move(aliases)), m_grid(std::move(grid)) {}
2023-03-27 13:36:18 +00:00
std::unordered_map<std::string, std::string> Frames::GetAliases() const {
return m_aliases;
}
Grid Frames::GetGrid() const { return m_grid; }
void Frames::SetAliases(
const std::unordered_map<std::string, std::string> &aliases) {
2023-03-27 13:36:18 +00:00
m_aliases = aliases;
}
void Frames::SetGrid(const Grid &grid) { m_grid = grid; }
2023-05-04 08:54:08 +00:00
} // namespace Starbound::Frames