(NDK) Added Listener component and system
Former-commit-id: 0553c4ad9a7e33608e9ab91bd4ca8812272a6293
This commit is contained in:
32
SDK/include/NDK/Components/ListenerComponent.hpp
Normal file
32
SDK/include/NDK/Components/ListenerComponent.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NDK_COMPONENTS_LISTENERCOMPONENT_HPP
|
||||
#define NDK_COMPONENTS_LISTENERCOMPONENT_HPP
|
||||
|
||||
#include <NDK/Component.hpp>
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
class NDK_API ListenerComponent : public Component<ListenerComponent>
|
||||
{
|
||||
public:
|
||||
ListenerComponent();
|
||||
~ListenerComponent() = default;
|
||||
|
||||
bool IsActive() const;
|
||||
bool SetActive(bool active = true);
|
||||
|
||||
static ComponentIndex componentIndex;
|
||||
|
||||
private:
|
||||
bool m_isActive;
|
||||
};
|
||||
}
|
||||
|
||||
#include <NDK/Components/ListenerComponent.inl>
|
||||
|
||||
#endif // NDK_COMPONENTS_LISTENERCOMPONENT_HPP
|
||||
21
SDK/include/NDK/Components/ListenerComponent.inl
Normal file
21
SDK/include/NDK/Components/ListenerComponent.inl
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
inline ListenerComponent::ListenerComponent() :
|
||||
m_isActive(true)
|
||||
{
|
||||
}
|
||||
|
||||
inline bool ListenerComponent::IsActive() const
|
||||
{
|
||||
return m_isActive;
|
||||
}
|
||||
|
||||
inline bool ListenerComponent::SetActive(bool active)
|
||||
{
|
||||
m_isActive = active;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user