refactor: format code

This commit is contained in:
2021-09-19 17:33:16 +02:00
parent 52a143769e
commit 0856ca47ca
71 changed files with 1102 additions and 1110 deletions

View File

@@ -69,8 +69,8 @@ const std::map<MobKey, MobStats> MobConstants = {
{{MobType::Giant, 5},{MobStats{0, 0, 0, 0, 0, 0}}},
};
const MobStats* getMobStats(MobType type, std::uint8_t level){
return &MobConstants.at(MobKey{type, level});
const MobStats* getMobStats(MobType type, std::uint8_t level) {
return &MobConstants.at(MobKey{ type, level });
}
const std::map<MobKey, TowerImmunities> MobsTowerImmunities = {
@@ -135,8 +135,8 @@ const std::map<MobKey, TowerImmunities> MobsTowerImmunities = {
{{MobType::Giant, 5},{}},
};
const TowerImmunities& getMobTowerImmunities(MobType type, std::uint8_t level){
return MobsTowerImmunities.at({type, level});
const TowerImmunities& getMobTowerImmunities(MobType type, std::uint8_t level) {
return MobsTowerImmunities.at({ type, level });
}
const std::map<MobKey, EffectImmunities> MobsEffectImmunities = {
@@ -201,11 +201,11 @@ const std::map<MobKey, EffectImmunities> MobsEffectImmunities = {
{{MobType::Giant, 5},{EffectType::Stun}},
};
const EffectImmunities& getMobEffectImmunities(MobType type, std::uint8_t level){
return MobsEffectImmunities.at({type, level});
const EffectImmunities& getMobEffectImmunities(MobType type, std::uint8_t level) {
return MobsEffectImmunities.at({ type, level });
}
MobPtr MobFactory::createMob(MobID id, MobType type, std::uint8_t level, PlayerID sender){
MobPtr MobFactory::createMob(MobID id, MobType type, std::uint8_t level, PlayerID sender) {
using MobCreator = std::function<std::shared_ptr<Mob>(MobID, std::uint8_t, PlayerID)>;
static std::map<MobType, MobCreator> mobFactory = {
@@ -215,6 +215,6 @@ MobPtr MobFactory::createMob(MobID id, MobType type, std::uint8_t level, PlayerI
return mobFactory[type](id, level, sender);
}
} // namespace game
} // namespace td