Page MenuHomec4science

abstractsystem.tpp
No OneTemporary

File Metadata

Created
Fri, May 2, 14:43

abstractsystem.tpp

#ifdef _ABSTRACTSYSTEM_TPP_
template <class T>
AbstractSystem<T>::AbstractSystem(const SVector<3>& offset, const QString& label, specs_t flags)
: SKActor(label, flags), offset(offset)
{
}
template <class T>
AbstractSystem<T>::AbstractSystem(const std::initializer_list<T*>& init)
: SKActor("", S_EVOLVE | S_RENDER | S_POSITION), components(init)
{
}
template <class T>
typename AbstractSystem<T>::iterator AbstractSystem<T>::begin()
{
return components.begin();
}
template <class T>
typename AbstractSystem<T>::iterator AbstractSystem<T>::end()
{
return components.end();
}
template <class T>
typename AbstractSystem<T>::const_iterator AbstractSystem<T>::begin() const
{
return components.begin();
}
template <class T>
typename AbstractSystem<T>::const_iterator AbstractSystem<T>::end() const
{
return components.end();
}
template <class T>
void AbstractSystem<T>::attach(T* actor)
{
if (!actor)
{
; // throw an error
}
components.push_back(actor);
}
template <class T>
void AbstractSystem<T>::detach(T* actor)
{
if (!actor)
{
; // throw an error
}
components.remove(actor);
}
template <class T>
void AbstractSystem<T>::detachAll()
{
components.clear();
}
template <class T>
SVector<3> AbstractSystem<T>::position() const
{
return offset;
}
template <class T>
void AbstractSystem<T>::setOffset(const SVector<3>& offset)
{
this->offset=offset;
}
#endif

Event Timeline