LoginSignup
5
5

More than 5 years have passed since last update.

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

Posted at

構造体の宣言

    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}},
};       
5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5