mirror of
https://github.com/sebastiandine/Card-Collection-Manager-3.git
synced 2026-09-04 01:03:27 +00:00
Minor: New Game Yu-Gi-Oh! Bandai (#22)
This commit is contained in:
@@ -21,6 +21,7 @@ enum class Game {
|
||||
Pokemon,
|
||||
YuGiOh,
|
||||
DigiBattle99,
|
||||
YuGiOhBandai,
|
||||
JapanesePokemon, // internal Asia sets/preview routing; not in allGames()
|
||||
};
|
||||
|
||||
@@ -70,7 +71,7 @@ std::optional<Condition> conditionFromString(std::string_view s) noexcept;
|
||||
std::optional<Theme> themeFromString(std::string_view s) noexcept;
|
||||
|
||||
// User-facing games (Game menu / Settings). JapanesePokemon is internal-only.
|
||||
const std::array<Game, 4>& allGames() noexcept;
|
||||
const std::array<Game, 5>& allGames() noexcept;
|
||||
const std::array<Language, 10>& allLanguages() noexcept;
|
||||
const std::array<Condition, 7>& allConditions() noexcept;
|
||||
const std::array<Theme, 2>& allThemes() noexcept;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
// YuGiOhBandaiCard - Bandai Carddass (pre-Konami) card model.
|
||||
|
||||
#include "ccm/domain/Enums.hpp"
|
||||
#include "ccm/domain/Set.hpp"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace ccm {
|
||||
|
||||
struct YuGiOhBandaiCard {
|
||||
std::uint32_t id{0};
|
||||
std::uint8_t amount{1};
|
||||
std::string name;
|
||||
Set set;
|
||||
std::string setNo;
|
||||
std::string rarity;
|
||||
std::string note;
|
||||
std::vector<std::string> images;
|
||||
Language language{Language::Japanese};
|
||||
Condition condition{Condition::NearMint};
|
||||
bool holo{false};
|
||||
bool signed_{false};
|
||||
bool altered{false};
|
||||
|
||||
friend bool operator==(const YuGiOhBandaiCard&, const YuGiOhBandaiCard&) = default;
|
||||
};
|
||||
|
||||
void to_json(nlohmann::json& j, const YuGiOhBandaiCard& c);
|
||||
void from_json(const nlohmann::json& j, YuGiOhBandaiCard& c);
|
||||
|
||||
} // namespace ccm
|
||||
@@ -0,0 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
// YuGiOhBandaiSetCatalog: offline pack → card checklist for Bandai set
|
||||
// completion. Filled from Yugipedia set-gallery wikitext and persisted at
|
||||
// `<dataStorage>/yugiohbandai/set-catalog.json`.
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
namespace ccm {
|
||||
|
||||
struct YuGiOhBandaiCatalogCard {
|
||||
std::string setNo;
|
||||
std::string name;
|
||||
std::string rarity;
|
||||
|
||||
friend bool operator==(const YuGiOhBandaiCatalogCard&,
|
||||
const YuGiOhBandaiCatalogCard&) = default;
|
||||
};
|
||||
|
||||
struct YuGiOhBandaiSetCatalogPack {
|
||||
std::string setId;
|
||||
std::string setName;
|
||||
std::vector<YuGiOhBandaiCatalogCard> cards;
|
||||
|
||||
friend bool operator==(const YuGiOhBandaiSetCatalogPack&,
|
||||
const YuGiOhBandaiSetCatalogPack&) = default;
|
||||
};
|
||||
|
||||
struct YuGiOhBandaiSetCatalog {
|
||||
std::vector<YuGiOhBandaiSetCatalogPack> packs;
|
||||
|
||||
[[nodiscard]] const YuGiOhBandaiSetCatalogPack* findPack(
|
||||
std::string_view setId) const;
|
||||
|
||||
[[nodiscard]] bool empty() const noexcept { return packs.empty(); }
|
||||
|
||||
friend bool operator==(const YuGiOhBandaiSetCatalog&,
|
||||
const YuGiOhBandaiSetCatalog&) = default;
|
||||
};
|
||||
|
||||
void to_json(nlohmann::json& j, const YuGiOhBandaiCatalogCard& c);
|
||||
void from_json(const nlohmann::json& j, YuGiOhBandaiCatalogCard& c);
|
||||
void to_json(nlohmann::json& j, const YuGiOhBandaiSetCatalogPack& p);
|
||||
void from_json(const nlohmann::json& j, YuGiOhBandaiSetCatalogPack& p);
|
||||
void to_json(nlohmann::json& j, const YuGiOhBandaiSetCatalog& c);
|
||||
void from_json(const nlohmann::json& j, YuGiOhBandaiSetCatalog& c);
|
||||
|
||||
} // namespace ccm
|
||||
Reference in New Issue
Block a user