Replace most collections with Arbutils collections for more safety.
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:
@@ -1,16 +1,16 @@
|
||||
#ifndef CREATURELIB_CREATUREPARTY_HPP
|
||||
#define CREATURELIB_CREATUREPARTY_HPP
|
||||
|
||||
#include <array>
|
||||
#include <Arbutils/Collections/List.hpp>
|
||||
#include "Creature.hpp"
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class CreatureParty {
|
||||
std::vector<Creature*> _party;
|
||||
Arbutils::Collections::List<Creature*> _party;
|
||||
|
||||
public:
|
||||
CreatureParty(size_t size) : _party(size) {}
|
||||
CreatureParty(std::vector<Creature*> party) : _party(party) {}
|
||||
CreatureParty(Arbutils::Collections::List<Creature*> party) : _party(party) {}
|
||||
CreatureParty(std::initializer_list<Creature*> party) : _party(party) {}
|
||||
|
||||
virtual ~CreatureParty() {
|
||||
@@ -38,10 +38,10 @@ namespace CreatureLib::Battling {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<Creature*>& GetParty() { return _party; }
|
||||
const std::vector<Creature*>& GetParty() const { return _party; }
|
||||
Arbutils::Collections::List<Creature*>& GetParty() { return _party; }
|
||||
const Arbutils::Collections::List<Creature*>& GetParty() const { return _party; }
|
||||
|
||||
size_t GetLength() const { return _party.size(); }
|
||||
size_t GetLength() const { return _party.Count(); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user