Various little fixes (#118)

* Add missing override qualifier

* Mostly shadowing, virtual destructor and other little things
This commit is contained in:
Gawaboumga
2017-02-19 23:15:13 +01:00
committed by Jérôme Leclercq
parent ee9712fdcd
commit c2e4ccaf72
38 changed files with 94 additions and 92 deletions

View File

@@ -53,9 +53,9 @@ void EventState::AddEvent(const Nz::WindowEvent& event)
m_events.push_back(Nz::String::Number(m_count) + " - " + ToString(event));
Nz::String content;
for (auto&& event : m_events)
for (auto&& currentEvent : m_events)
{
content += event + "\n";
content += currentEvent + "\n";
}
content += "\nM for Menu";
m_text.SetContent(content, 36);

View File

@@ -46,7 +46,7 @@ void KeyState::DrawMenu()
m_text.SetContent("Clic on a key, this text should change !\nN for alternating event\nM for Menu");
}
void KeyState::ManageInput(KeyStatus isKeyPressed, const Nz::WindowEvent::KeyEvent& key, Ndk::StateMachine& fsm)
void KeyState::ManageInput(KeyStatus /*isKeyPressed*/, const Nz::WindowEvent::KeyEvent& key, Ndk::StateMachine& fsm)
{
if (key.code == Nz::Keyboard::Key::M && key.shift)
fsm.ChangeState(StateFactory::Get(EventStatus::Menu));

View File

@@ -58,7 +58,7 @@ void MouseClickState::DrawMenu()
m_text.SetContent("Click in the windows, this text should change !\nM for Menu");
}
void MouseClickState::ManageInput(MouseStatus mouseStatus, const Nz::WindowEvent::MouseButtonEvent& mouse, Ndk::StateMachine& fsm)
void MouseClickState::ManageInput(MouseStatus mouseStatus, const Nz::WindowEvent::MouseButtonEvent& mouse, Ndk::StateMachine& /*fsm*/)
{
Nz::String content;
if (mouseStatus == MouseStatus::Pressed)

View File

@@ -11,7 +11,7 @@ Text::Text(StateContext& stateContext) :
m_context(stateContext)
{
m_text = m_context.world.CreateEntity();
Ndk::NodeComponent& nodeComponent = m_text->AddComponent<Ndk::NodeComponent>();
m_text->AddComponent<Ndk::NodeComponent>();
Ndk::GraphicsComponent& graphicsComponent = m_text->AddComponent<Ndk::GraphicsComponent>();
m_textSprite = Nz::TextSprite::New();

View File

@@ -16,8 +16,8 @@ SCENARIO("EntityList", "[NDK][ENTITYLIST]")
THEN("These results are expected")
{
REQUIRE(entityList.Has(entity->GetId()));
const Ndk::EntityHandle& entity = world.CreateEntity();
REQUIRE(!entityList.Has(entity->GetId()));
const Ndk::EntityHandle& newEntity = world.CreateEntity();
REQUIRE(!entityList.Has(newEntity->GetId()));
}
}