speciesgen/src/starbound/frames.cpp

75 lines
2.3 KiB
C++

/*
speciesgen
Copyright (C) 2022-2023 prisixia
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"
namespace Starbound::Frames {
//----------------------------------------------------------------------
// Grid
//----------------------------------------------------------------------
Grid::Grid(std::vector<std::vector<std::optional<std::string>>> names,
const std::tuple<uint32_t, uint32_t> size,
const std::tuple<uint32_t, uint32_t> dimensions)
: m_size(size), m_dimensions(dimensions), m_names(std::move(names)) {}
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) {
m_names = names;
}
//----------------------------------------------------------------------
// Frames
//----------------------------------------------------------------------
Frames::Frames(std::unordered_map<std::string, std::string> aliases, Grid grid)
: m_aliases(std::move(aliases)), m_grid(std::move(grid)) {}
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) {
m_aliases = aliases;
}
void Frames::SetGrid(const Grid &grid) { m_grid = grid; }
} // namespace Starbound::Frames