2020-05-29 15:37:20 +08:00

174 lines
3.5 KiB
C++
Executable File

#pragma once
struct PerfMonitor
{
int max_run_delay_time = 0;
int max_dispatchmsg_time = 0;
int max_timer_idle = 0;
long long out_data_size = 0;
long long in_data_size = 0;
long long read_count = 0;
long long grid_chg_times = 0;
long long test_times = 0;
long long alive_count = 0;
long long real_alive_count = 0;
std::array<long long, 30> params = {};
std::array<int, 30> entity_num = {};
};
namespace MetaData
{
struct Map;
struct SafeArea;
struct Equip;
struct EquipUpgrade;
struct MapTplThing;
}
namespace cs
{
class MFWeapon;
class MFSkin;
}
struct GasData
{
GasMode_e gas_mode = GasInactive;
a8::Vec2 pos_old;
a8::Vec2 pos_old_bk;
a8::Vec2 pre_pos_old;
a8::Vec2 pos_new;
float rad_old = 0.0f;
float rad_new = 0.0f;
float gas_progress = 0.0f;
long long gas_start_frameno = 0;
MetaData::SafeArea* old_area_meta = nullptr;
MetaData::SafeArea* new_area_meta = nullptr;
bool is_last_gas = false;
};
struct Weapon
{
int weapon_idx = 0;
int weapon_id = 0;
int weapon_lv = 0;
int ammo = 0;
MetaData::Equip* meta = nullptr;
void ToPB(cs::MFWeapon* pb_obj);
void Recalc();
int GetClipVolume();
float GetAttrValue(HumanAttrType_e attr_type);
MetaData::EquipUpgrade* GetUpgradeMeta() { return upgrade_meta;}
private:
MetaData::EquipUpgrade* upgrade_meta = nullptr;
};
struct Skin
{
int tank_uniid = 0;
int skin_id = 0;
int skin_lv = 0;
void ToPB(cs::MFSkin* pb_obj);
};
struct PlayerStats
{
int kills = 0;
int damage_amount_in = 0;
int damage_amount_out = 0;
int heal_amount = 0;
int rescue_member = 0;
int history_time_alive = 0;
int history_kills = 0;
int history_damage_amount = 0;
int history_heal_amount = 0;
int gold = 0;
int score = 0;
std::vector<std::pair<int, int>> items;
int pass_score = 0;
int rank_score = 0;
std::vector<std::pair<int, int>> extra_drop;
int killer_id = 0;
std::string killer_name;
int weapon_id = 0;
int rank = 0;
int use_skill_times = 0;
};
struct CarObject
{
int car_id = 0;
a8::Vec2 pos;
bool taken = false;
};
struct HumanCar
{
int car_id = 0;
int car_uniid = 0;
MetaData::Equip* meta = nullptr;
};
struct BornPoint
{
MetaData::MapTplThing* thing_tpl = nullptr;
int player_num = 0;
int android_num = 0;
a8::Vec2 RandPoint() const;
};
struct HumanAbility
{
float hp = 0.0f;
float max_hp = 0.0f;
float hp_recover = 0.0f;
float atk = 0.0f;
float def = 0.0f;
float speed = 0.0f;
float shot_range = 0.0f;
float shot_speed = 0.0f;
float reload_speed = 0.0f;
float fire_rate = 0.0f;
};
struct ObstacleData
{
int flags = 0;
float health = 0.0f;
bool dead = false;
long long dead_frameno = 0;
int door_open_times = 0;
DoorState_e door_state = DoorStateClose;
};
class GridService;
class MapService;
class Building;
struct RoomInitInfo
{
int room_idx = 0;
long long room_uuid = 0;
RoomType_e room_type = RT_NewBrid;
const MetaData::Map* map_meta = nullptr;
std::string map_tpl_name;
GridService* grid_service = nullptr;
MapService* map_service = nullptr;
const std::vector<MetaData::MapTplThing*>* spawn_points = nullptr;
const MetaData::MapTplThing* newbie_born_point_meta = nullptr;
const std::vector<MetaData::MapTplThing*>* loots = nullptr;
const std::vector<Building*>* buildings = nullptr;
};