2019-04-26 15:07:55 +08:00

124 lines
2.3 KiB
C++
Executable File

#pragma once
#include "metatable.pb.h"
namespace MetaData
{
struct Parameter
{
const metatable::Parameter* i = nullptr;
int int_val = 0;
std::string str_val;
double float_val = 0.0f;
void Init();
};
struct Map
{
const metatable::Map* i = nullptr;
std::vector<std::tuple<std::string, int>> template_list;
int rand_space = 0;
void Init();
std::string RandTemplate();
};
struct MapThing
{
const metatable::MapThing* i = nullptr;
};
struct SafeArea
{
const metatable::SafeArea* i = nullptr;
};
struct Item
{
const metatable::Item* i = nullptr;
};
struct Equip
{
const metatable::Equip* i = nullptr;
std::vector<std::tuple<float, float>> bullet_born_offset;
std::array<int, IS_END> volume = {};
void Init();
};
struct Player
{
const metatable::Player* i = nullptr;
std::array<int, IS_END> volume = {};
void Init();
};
struct Building
{
struct Door
{
int door_id = 0;
Vector2D state0_dir;
Vector2D state1_dir;
const metatable::DoorObjJson* state0 = nullptr;
const metatable::DoorObjJson* state1 = nullptr;
};
const metatable::BuildingJson* i = nullptr;
std::vector<Door> doors;
void Init();
};
struct Drop
{
const metatable::Drop* i = nullptr;
void Init();
void RandItems(std::vector<std::tuple<int, int>>& drop_items);
private:
std::vector<std::tuple<std::vector<int>, std::vector<int>, int>> items;
int total_weight = 0;
};
struct MapTplThing
{
const metatable::MapTplThingJson* i = nullptr;
void Init();
int RandThing();
std::vector<std::tuple<int, int>> things;
int rand_space = 0;
};
struct AirDrop
{
const metatable::AirDrop* i = nullptr;
};
struct AirLine
{
const metatable::AirLine* i = nullptr;
float start_point_x = 0.0f;
float start_point_y = 0.0f;
float end_point_x = 0.0f;
float end_point_y = 0.0f;
void Init();
};
}