speciesgen/src/starbound/frames.cpp

78 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"
namespace Starbound {
namespace Frames {
//----------------------------------------------------------------------
// Grid
//----------------------------------------------------------------------
Grid::Grid(const 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(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(const std::unordered_map<std::string, std::string> aliases,
const Grid grid)
: m_aliases(aliases), m_grid(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 Frames
} // namespace Starbound