write_birth_diary(player_ptr);
for (int i = 1; i < max_towns; i++) {
- for (auto sst : StoreSaleType()) {
+ for (auto sst : STORE_SALE_TYPE_LIST) {
store_init(i, sst);
}
}
town_info = std::vector<town_type>(max_towns);
for (int i = 1; i < max_towns; i++) {
town_info[i].store = std::vector<store_type>(MAX_STORES);
- for (auto sst : StoreSaleType()) {
+ for (auto sst : STORE_SALE_TYPE_LIST) {
store_type *store_ptr = &town_info[i].store[enum2i(sst)];
if ((i > 1) && (sst == StoreSaleType::MUSEUM || sst == StoreSaleType::HOME))
continue;
if (o_ptr->to_d > 0)
return false;
- for (auto sst : StoreSaleType()) {
+ for (auto sst : STORE_SALE_TYPE_LIST) {
if (sst == StoreSaleType::HOME || sst == StoreSaleType::MUSEUM) {
continue;
}
StoreSaleType cur_store_num = StoreSaleType::GENERAL;
store_type *st_ptr = nullptr;
-StoreSaleType begin(StoreSaleType)
-{
- return StoreSaleType::GENERAL;
-}
-
-StoreSaleType end(StoreSaleType)
-{
- return StoreSaleType::MAX;
-}
-
-StoreSaleType operator*(StoreSaleType s)
-{
- return s;
-}
-
-StoreSaleType operator++(StoreSaleType &s)
-{
- return s = StoreSaleType(std::underlying_type<StoreSaleType>::type(s) + 1);
-}
-
/*!
* @brief 店舗のオブジェクト数を増やす /
* Add the item "o_ptr" to a real stores inventory.
#include "system/angband.h"
+#include "util/enum-range.h"
+
#include <memory>
#include <vector>
MAX = 10
};
-StoreSaleType begin(StoreSaleType);
-StoreSaleType end(StoreSaleType);
-StoreSaleType operator*(StoreSaleType s);
-StoreSaleType operator++(StoreSaleType &s);
+constexpr auto STORE_SALE_TYPE_LIST = EnumRange(StoreSaleType::GENERAL, StoreSaleType::MUSEUM);
using store_k_idx = std::vector<KIND_OBJECT_IDX>;