我正在尝试使用以下代码在标题中初始化地图,但它一直给我标题中的错误。我正在使用 C++11,所以这应该是可能的,对吧?
typedef std::map<NPCAnimation::ID, std::map<Direction::ID, sf::Time>> AnimationSpeedMap;
AnimationSpeedMap AnimationSpeeds = {
{NPCAnimation::WALK, {
{Direction::LEFT, sf::milliseconds(100)},
{Direction::RIGHT, sf::milliseconds(100)},
{Direction::UP, sf::milliseconds(200)},
{Direction::DOWN, sf::milliseconds(200)}
}
},
{NPCAnimation::IDLE, {
{Direction::LEFT, sf::milliseconds(600)},
{Direction::RIGHT, sf::milliseconds(600)},
{Direction::UP, sf::milliseconds(600)},
{Direction::DOWN, sf::milliseconds(600)}
}
},
{NPCAnimation::SPECIAL, {
{Direction::LEFT, sf::milliseconds(500)},
{Direction::RIGHT, sf::milliseconds(500)},
{Direction::UP, sf::milliseconds(500)},
{Direction::DOWN, sf::milliseconds(500)}
}
},
};
提前致谢!~ 漫步者1