Posted at

構造体を波カッコで初期化

More than 3 years have passed since last update.


構造体の宣言

    struct GateMaster {

int gateId;
int stageId;
int nextGateId;
int x;
int y;
GateType gateType;
};


変数の宣言

const static std::map<int, GateMaster> DUMMY_GATE_MASTER_LIST;


初期化

const std::map<int, Gate::GateMaster> Gate::DUMMY_GATE_MASTER_LIST = {

{1, {1, 1, 2, 100, 100, Gate::GateType::NORMAL_V}},
{2, {2, 2, 1, 200, 100, Gate::GateType::NORMAL_V}},
{3, {3, 2, 4, 300, 100, Gate::GateType::NORMAL_V}},
{4, {4, 3, 3, 400, 100, Gate::GateType::NORMAL_V}},
{5, {5, 3, 7, 500, 100, Gate::GateType::NORMAL_V}},
{6, {6, 3, 8, 600, 100, Gate::GateType::NORMAL_V}},
{7, {7, 4, 5, 700, 100, Gate::GateType::NORMAL_V}},
{8, {8, 5, 6, 800, 100, Gate::GateType::NORMAL_V}},
};