1 #include "market/building-initializer.h"
2 #include "floor/floor-town.h"
3 #include "object/object-kind.h"
4 #include "object/object-kind-hook.h"
5 #include "player-info/class-types.h"
6 #include "store/articles-on-sale.h"
7 #include "store/store-owners.h"
8 #include "store/store-util.h"
9 #include "store/store.h"
10 #include "system/angband.h"
11 #include "system/building-type-definition.h"
12 #include "system/object-type-definition.h"
16 * @brief 町情報読み込みのメインルーチン /
17 * Initialize town array
18 * @details 「我が家を拡張する」オプションのON/OFFとは無関係に、ON時の容量を確保しておく.
22 town_info = std::vector<town_type>(max_towns);
23 for (auto i = 1; i < max_towns; i++) {
24 town_info[i].store = std::vector<store_type>(MAX_STORES);
25 for (auto sst : STORE_SALE_TYPE_LIST) {
26 auto *store_ptr = &town_info[i].store[enum2i(sst)];
27 if ((i > 1) && (sst == StoreSaleType::MUSEUM || sst == StoreSaleType::HOME)) {
31 store_ptr->stock_size = store_get_stock_max(sst);
32 store_ptr->stock = std::make_unique<object_type[]>(store_ptr->stock_size);
33 if ((sst == StoreSaleType::BLACK) || (sst == StoreSaleType::HOME) || (sst == StoreSaleType::MUSEUM)) {
37 for (auto k = 0; k < STORE_INVEN_MAX; k++) {
38 auto tv = store_regular_table[enum2i(sst)][k].tval;
39 auto sv = store_regular_table[enum2i(sst)][k].sval;
40 if (tv == ItemKindType::NONE) {
44 auto k_idx = lookup_kind(tv, sv);
49 store_ptr->regular.push_back(k_idx);
52 for (auto k = 0; k < STORE_CHOICES; k++) {
53 auto tv = store_table[enum2i(sst)][k].tval;
54 auto sv = store_table[enum2i(sst)][k].sval;
55 if (tv == ItemKindType::NONE) {
59 auto k_idx = lookup_kind(tv, sv);
64 store_ptr->table.push_back(k_idx);
71 * @brief 店情報初期化のメインルーチン /
72 * Initialize buildings
74 void init_buildings(void)
76 for (auto i = 0; i < MAX_BLDG; i++) {
77 building[i].name[0] = '\0';
78 building[i].owner_name[0] = '\0';
79 building[i].owner_race[0] = '\0';
80 for (auto j = 0; j < 8; j++) {
81 building[i].act_names[j][0] = '\0';
82 building[i].member_costs[j] = 0;
83 building[i].other_costs[j] = 0;
84 building[i].letters[j] = 0;
85 building[i].actions[j] = 0;
86 building[i].action_restr[j] = 0;
89 building[i].member_class.assign(PLAYER_CLASS_TYPE_MAX, static_cast<short>(PlayerClassType::WARRIOR));
90 building[i].member_race.assign(MAX_RACES, static_cast<short>(PlayerRaceType::HUMAN));
91 building[i].member_realm.assign(MAX_MAGIC + 1, 0);