mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-07-31 17:35:47 +00:00
26 lines
927 B
C++
26 lines
927 B
C++
#ifndef CSELECTIONITERATOR
|
|
#define CSELECTIONITERATOR
|
|
|
|
#include "CNodeSelection.h"
|
|
|
|
class CSelectionIterator
|
|
{
|
|
CNodeSelection *mpSelection;
|
|
uint32 mCurrentIndex;
|
|
|
|
public:
|
|
CSelectionIterator(CNodeSelection *pSelection)
|
|
: mpSelection(pSelection), mCurrentIndex(0) {}
|
|
|
|
inline void Next() { mCurrentIndex++; }
|
|
inline bool DoneIterating() const { return (mCurrentIndex == mpSelection->Size()); }
|
|
inline operator bool() const { return !DoneIterating(); }
|
|
inline CSceneNode* operator*() const { return mpSelection->At(mCurrentIndex); }
|
|
inline CSceneNode* operator->() const { return mpSelection->At(mCurrentIndex); }
|
|
inline CSelectionIterator& operator++() { Next(); return *this; }
|
|
inline CSelectionIterator operator++(int) { CSelectionIterator Copy = *this; Next(); return Copy; }
|
|
};
|
|
|
|
#endif // CSELECTIONITERATOR
|
|
|