Newer
Older
GameEngine / src / Framework / ISystemCollection.h
@John Ryland John Ryland on 22 Aug 742 bytes save WIP
#pragma once

/*
	ApplicationFramework
	by John Ryland
	Copyright (c) 2023
*/

////////////////////////////////////////////////////////////////////////////////////
//	System Collection

#include "ICollection.h"
#include "ISystem.h"

namespace ApplicationFramework {

template <typename InterfaceType>
class ISystemCollection : public ICollection<InterfaceType>
{
public:
    void Initialize() override    { this->Apply(std::mem_fn(&InterfaceType::Initialize)); }
    void Shutdown() override      { this->ApplyReverse(std::mem_fn(&InterfaceType::Shutdown)); }
    void Update() override        { this->Apply(std::mem_fn(&InterfaceType::Update)); }
};

using SystemCollection = ISystemCollection<ISystem>;

} // ApplicationFramework namespace