From 9272bd627c732771b81e6dcf6b8465404917a9d6 Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 5 Aug 2014 22:54:36 +0100 Subject: Removed dependecy of redstone simulator on NoteBlock --- src/BlockEntities/NoteEntity.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/BlockEntities/NoteEntity.h') diff --git a/src/BlockEntities/NoteEntity.h b/src/BlockEntities/NoteEntity.h index e8497da3e..f9db6cbe6 100644 --- a/src/BlockEntities/NoteEntity.h +++ b/src/BlockEntities/NoteEntity.h @@ -2,6 +2,7 @@ #pragma once #include "BlockEntity.h" +#include "RedstonePoweredEntity.h" namespace Json @@ -29,7 +30,8 @@ enum ENUM_NOTE_INSTRUMENTS // tolua_begin class cNoteEntity : - public cBlockEntity + public cBlockEntity, + public cRedstonePoweredEntity { typedef cBlockEntity super; public: @@ -38,6 +40,7 @@ public: /// Creates a new note entity. a_World may be NULL cNoteEntity(int a_X, int a_Y, int a_Z, cWorld * a_World); + virtual ~cNoteEntity() {} bool LoadFromJson(const Json::Value & a_Value); virtual void SaveToJson(Json::Value & a_Value) override; @@ -53,6 +56,11 @@ public: virtual void UsedBy(cPlayer * a_Player) override; virtual void SendTo(cClientHandle &) override {} + + virtual void SetRedstonePower(bool a_Value) + { + if (a_Value) MakeSound(); + } static const char * GetClassStatic(void) { return "cNoteEntity"; } -- cgit v1.2.3 From a0ba7426c6bc2059d5db6d248ef8e582e40ce4b3 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 6 Aug 2014 13:17:05 +0100 Subject: Fixed multiple inhertance being output by tolua --- src/BlockEntities/NoteEntity.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/BlockEntities/NoteEntity.h') diff --git a/src/BlockEntities/NoteEntity.h b/src/BlockEntities/NoteEntity.h index f9db6cbe6..dd201e0a9 100644 --- a/src/BlockEntities/NoteEntity.h +++ b/src/BlockEntities/NoteEntity.h @@ -30,8 +30,10 @@ enum ENUM_NOTE_INSTRUMENTS // tolua_begin class cNoteEntity : - public cBlockEntity, - public cRedstonePoweredEntity + public cBlockEntity + // tolua_end + , public cRedstonePoweredEntity + // tolua_begin { typedef cBlockEntity super; public: -- cgit v1.2.3 From 6acddd0cad25078ae2c67e7a0eb353e9d4d100e2 Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 6 Aug 2014 13:19:22 +0100 Subject: Fixed style issues --- src/BlockEntities/NoteEntity.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/BlockEntities/NoteEntity.h') diff --git a/src/BlockEntities/NoteEntity.h b/src/BlockEntities/NoteEntity.h index dd201e0a9..f538de060 100644 --- a/src/BlockEntities/NoteEntity.h +++ b/src/BlockEntities/NoteEntity.h @@ -61,7 +61,10 @@ public: virtual void SetRedstonePower(bool a_Value) { - if (a_Value) MakeSound(); + if (a_Value) + { + MakeSound(); + } } static const char * GetClassStatic(void) { return "cNoteEntity"; } -- cgit v1.2.3