Removed dependecy of redstone simulator on NoteBlock

This commit is contained in:
Tycho
2014-08-05 22:54:36 +01:00
parent 06942871dd
commit 9272bd627c
4 changed files with 20 additions and 12 deletions
+9 -1
View File
@@ -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"; }