Made Battle take battleparties as a pointer instead of value for external use.
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:
@@ -13,10 +13,10 @@ namespace CreatureLib::Battling {
|
||||
BattleParty(CreatureParty* party, std::vector<CreatureIndex> responsibleIndices)
|
||||
: _party(party), _responsibleIndices(responsibleIndices) {}
|
||||
|
||||
CreatureParty* GetParty() { return _party; }
|
||||
const std::vector<CreatureIndex>& GetResponsibleIndices() const { return _responsibleIndices; }
|
||||
inline CreatureParty* GetParty() const { return _party; }
|
||||
inline const std::vector<CreatureIndex>& GetResponsibleIndices() const { return _responsibleIndices; }
|
||||
|
||||
bool IsResponsibleForIndex(const CreatureIndex& index) const {
|
||||
inline bool IsResponsibleForIndex(const CreatureIndex& index) const {
|
||||
for (const auto& i : _responsibleIndices) {
|
||||
if (i == index)
|
||||
return true;
|
||||
@@ -24,7 +24,7 @@ namespace CreatureLib::Battling {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsResponsibleForIndex(uint8_t side, uint8_t index) const {
|
||||
inline bool IsResponsibleForIndex(uint8_t side, uint8_t index) const {
|
||||
for (const auto& i : _responsibleIndices) {
|
||||
if (i.GetSideIndex() == side && i.GetCreatureIndex() == index)
|
||||
return true;
|
||||
@@ -32,7 +32,7 @@ namespace CreatureLib::Battling {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool HasCreaturesNotInField() const {
|
||||
inline bool HasCreaturesNotInField() const {
|
||||
auto p = _party->GetParty();
|
||||
for (const auto& creature : p) {
|
||||
if (creature == nullptr)
|
||||
|
||||
Reference in New Issue
Block a user