Used ClangFormat style guide I'm happy with.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-11-28 12:55:22 +01:00
parent 3b685ae782
commit a8730d983f
91 changed files with 946 additions and 1121 deletions

View File

@@ -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