51 throw std::out_of_range(
"Invalid resource index");
55 static std::optional<ResourceType>
fromName(std::string_view name)
87 throw std::out_of_range(
"Invalid resource index");
109 throw std::out_of_range(
"Invalid resource index");
135 throw std::out_of_range(
"Invalid resource type");
143 os <<
"Food: " <<
res.food <<
", Linemate: " <<
res.linemate <<
", Deraumere: " <<
res.deraumere
144 <<
", Sibur: " <<
res.sibur <<
", Mendiane: " <<
res.mendiane <<
", Phiras: " <<
res.phiras
145 <<
", Thystame: " <<
res.thystame;
ResourceType
Enumerate the different types of resources in the game.
std::ostream & operator<<(std::ostream &os, const Resources &res)
static std::string res(const Resources &r)
Represents the resources available in the game, including food and various minerals.
static float density(ResourceType type)
static std::optional< ResourceType > fromName(std::string_view name)
int & operator[](size_t index)
const int & operator[](ResourceType type) const
static std::string get_name(ResourceType type)
static std::string get_name(int index)
const int & operator[](size_t index) const
static constexpr int TYPE_COUNT
int & operator[](ResourceType type)