Used ClangFormat style guide I'm happy with.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -4,29 +4,27 @@
|
||||
#include <array>
|
||||
#include "Creature.hpp"
|
||||
|
||||
namespace CreatureLib::Battling{
|
||||
template <int max>
|
||||
class CreatureParty {
|
||||
namespace CreatureLib::Battling {
|
||||
template <int max> class CreatureParty {
|
||||
std::array<Creature*, max> _party;
|
||||
|
||||
public:
|
||||
CreatureParty(std::array<Creature*, max> party) : _party(party){
|
||||
}
|
||||
CreatureParty(std::array<Creature*, max> party) : _party(party) {}
|
||||
|
||||
Creature* GetAtIndex(int index) const{
|
||||
return _party[index];
|
||||
}
|
||||
Creature* GetAtIndex(int index) const { return _party[index]; }
|
||||
|
||||
void Switch(int a, int b){
|
||||
void Switch(int a, int b) {
|
||||
auto ca = _party[a];
|
||||
_party[a] = _party[b];
|
||||
_party[b] = ca;
|
||||
}
|
||||
|
||||
bool HasAvailableCreatures() const{
|
||||
for (Creature* c: _party){
|
||||
if (c == nullptr) continue;
|
||||
if (c->IsFainted()) continue;
|
||||
bool HasAvailableCreatures() const {
|
||||
for (Creature* c : _party) {
|
||||
if (c == nullptr)
|
||||
continue;
|
||||
if (c->IsFainted())
|
||||
continue;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -34,5 +32,4 @@ namespace CreatureLib::Battling{
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif //CREATURELIB_CREATUREPARTY_HPP
|
||||
#endif // CREATURELIB_CREATUREPARTY_HPP
|
||||
|
||||
Reference in New Issue
Block a user