mirror of https://github.com/AxioDL/metaforce.git
Merge pull request #319 from lioncash/object
CObjectList: Minor interface modifications
This commit is contained in:
commit
8aef93473e
|
@ -44,11 +44,10 @@ public:
|
|||
m_id = m_list.GetNextObjectIndex(m_id);
|
||||
return *this;
|
||||
}
|
||||
bool operator!=(const iterator& other) const { return m_id != other.m_id; }
|
||||
bool operator==(const iterator& other) const { return m_id == other.m_id; }
|
||||
bool operator!=(const iterator& other) const { return !operator==(other); }
|
||||
CEntity* operator*() const { return m_list.GetObjectByIndex(m_id); }
|
||||
};
|
||||
iterator begin() { return iterator(*this, x2008_firstId); }
|
||||
iterator end() { return iterator(*this, -1); }
|
||||
|
||||
class const_iterator {
|
||||
friend class CObjectList;
|
||||
|
@ -61,13 +60,19 @@ public:
|
|||
m_id = m_list.GetNextObjectIndex(m_id);
|
||||
return *this;
|
||||
}
|
||||
bool operator!=(const iterator& other) const { return m_id != other.m_id; }
|
||||
bool operator==(const iterator& other) const { return m_id == other.m_id; }
|
||||
bool operator!=(const iterator& other) const { return !operator==(other); }
|
||||
const CEntity* operator*() const { return m_list.GetObjectByIndex(m_id); }
|
||||
};
|
||||
const_iterator cbegin() const { return const_iterator(*this, x2008_firstId); }
|
||||
const_iterator cend() const { return const_iterator(*this, -1); }
|
||||
|
||||
CObjectList(EGameObjectList listEnum);
|
||||
[[nodiscard]] iterator begin() { return iterator(*this, x2008_firstId); }
|
||||
[[nodiscard]] iterator end() { return iterator(*this, -1); }
|
||||
[[nodiscard]] const_iterator begin() const { return const_iterator(*this, x2008_firstId); }
|
||||
[[nodiscard]] const_iterator end() const { return const_iterator(*this, -1); }
|
||||
[[nodiscard]] const_iterator cbegin() const { return const_iterator(*this, x2008_firstId); }
|
||||
[[nodiscard]] const_iterator cend() const { return const_iterator(*this, -1); }
|
||||
|
||||
explicit CObjectList(EGameObjectList listEnum);
|
||||
virtual ~CObjectList() = default;
|
||||
|
||||
void AddObject(CEntity& entity);
|
||||
|
|
Loading…
Reference in New Issue