shop.h
1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#pragma once
#include <common.h>
#include <share_msg.pb.h>
struct shop_element_t
{
std::vector<share_msg::item_t> buy_vec;
std::vector<share_msg::item_t> buy_pet_vec;
std::vector<share_msg::item_t> price_vec;
float vip_price;
bool notice;
uint32_t type;
uint32_t b_time;
uint32_t e_time;
uint32_t num;
shop_element_t(){
this->notice = false;
this->type = 0;
this->b_time = 0;
this->e_time = 0;
this->num = 0;
this->vip_price = 10.000000f;
}
};
struct shop_cfg_mgr_t
{
bool load_cfg();
bool check_cfg();
void init();
std::map<uint32_t, shop_element_t> shop_element_map;//key:id
shop_element_t* find(uint32_t id);
};
extern shop_cfg_mgr_t* g_shop_cfg_mgr;
//////////////////////////////////////////////////////////////////////////
struct play_game_reward_element_t
{
uint32_t pr;
std::vector<share_msg::item_t> reward_vec;
};
struct play_game_reward_cfg_mgr_t
{
bool load_cfg();
void init();
uint32_t play_cnt;
std::map<uint32_t, play_game_reward_element_t> play_game_reward_map;//key:id val:play_game_reward_element_t
};
extern play_game_reward_cfg_mgr_t* g_play_game_reward_cfg_mgr;
//////////////////////////////////////////////////////////////////////////
struct single_game_cfg_t
{
uint32_t game_id;
uint32_t need_vip;
uint32_t key_score;
uint32_t diamond;
std::map<ITEM_ID, ITEM_CNT> item_map;
uint32_t rate;
std::map<ITEM_ID, uint32_t> key_rate_map;
single_game_cfg_t(){
this->game_id = 0;
this->need_vip = 0;
this->rate = 0;
this->key_score = 0;
this->diamond = 0;
}
};
struct single_game_cfg_mgr_t
{
bool load_cfg();
void init();
std::map<GAME_ID, std::map<uint32_t,single_game_cfg_t>> single_game_score_map;
std::map<GAME_ID, uint32_t> game_id_need_vip_map;
std::map<GAME_ID, uint32_t> game_id_need_diamond_map;
std::map<uint32_t,single_game_cfg_t>* find(GAME_ID game_id);
std::map<GAME_ID, std::map<GAME_LEVEL, GAME_SCORE>> game_level_score_map;
};
extern single_game_cfg_mgr_t* g_single_game_cfg_mgr;