speciesgen/src/starbound/item.cpp

126 lines
4.2 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/item.h"
namespace Starbound::Item {
//----------------------------------------------------------------------
// Frames
//----------------------------------------------------------------------
Frames::Frames(std::filesystem::path body) : m_body(std::move(body)) {}
Frames::Frames(std::filesystem::path body, std::filesystem::path backSleeve,
std::filesystem::path frontSleeve)
: m_body(std::move(body)), m_backSleeve(std::move(backSleeve)),
m_frontSleeve(std::move(frontSleeve)) {}
std::filesystem::path Frames::GetBody() const { return m_body; }
std::filesystem::path Frames::GetBackSleeve() const { return m_backSleeve; }
std::filesystem::path Frames::GetFrontSleeve() const { return m_frontSleeve; }
void Frames::SetBody(const std::filesystem::path &body) { m_body = body; }
void Frames::SetBackSleeve(const std::filesystem::path &backSleeve) {
m_backSleeve = backSleeve;
}
void Frames::SetFrontSleeve(const std::filesystem::path &frontSleeve) {
m_frontSleeve = frontSleeve;
}
//----------------------------------------------------------------------
// Item
//----------------------------------------------------------------------
Item::Item(std::string itemName, const Rarity rarity)
: m_itemName(std::move(itemName)), m_price(0), m_maxStack(1), m_rarity(rarity) {}
Item::Item(std::string itemName, std::filesystem::path inventoryIcon,
const Category category, std::string description,
std::string shortDescription, Frames maleFrames, Frames femaleFrames)
: m_itemName(std::move(itemName)), m_price(0),
m_inventoryIcon(std::move(inventoryIcon)), m_maxStack(1),
m_rarity(Rarity::Essential), m_category(category),
m_description(std::move(description)),
m_shortDescription(std::move(shortDescription)),
m_tooltipKind(TooltipKind::Armor), m_maleFrames(std::move(maleFrames)),
m_femaleFrames(std::move(femaleFrames)) {}
std::string Item::GetItemName() const { return m_itemName; }
uint32_t Item::GetPrice() const { return m_price; }
std::filesystem::path Item::GetInventoryIcon() const { return m_inventoryIcon; }
uint16_t Item::GetMaxStack() const { return m_maxStack; }
Rarity Item::GetRarity() const { return m_rarity; }
Category Item::GetCategory() const { return m_category; }
std::string Item::GetDescription() const { return m_description; }
std::string Item::GetShortDescription() const { return m_shortDescription; }
TooltipKind Item::GetTooltipKind() const { return m_tooltipKind; }
Frames Item::GetMaleFrames() const { return m_maleFrames; }
Frames Item::GetFemaleFrames() const { return m_femaleFrames; }
void Item::SetItemName(const std::string &itemName) { m_itemName = itemName; }
void Item::SetPrice(const uint32_t price) { m_price = price; }
void Item::SetInventoryIcon(const std::filesystem::path &inventoryIcon) {
m_inventoryIcon = inventoryIcon;
}
void Item::SetMaxStack(const uint16_t maxStack) { m_maxStack = maxStack; }
void Item::SetRarity(const Rarity rarity) { m_rarity = rarity; }
void Item::SetCategory(const Category category) { m_category = category; }
void Item::SetDescription(const std::string &description) {
m_description = description;
}
void Item::SetShortDescription(const std::string &shortDescription) {
m_shortDescription = shortDescription;
}
void Item::SetTooltipKind(const TooltipKind tooltipKind) {
m_tooltipKind = tooltipKind;
}
void Item::SetMaleFrames(const Frames &maleFrames) {
m_maleFrames = maleFrames;
}
void Item::SetFemaleFrames(const Frames &femaleFrames) {
m_femaleFrames = femaleFrames;
}
} // namespace Starbound::Item