From be5299350a3b808ade39df7e9654eda47732e96e Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 18 Jan 2014 15:40:47 +0200 Subject: Command block (de)serialization --- src/BlockEntities/CommandBlockEntity.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/BlockEntities/CommandBlockEntity.cpp') diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp index 6e371e0fe..88e55dece 100644 --- a/src/BlockEntities/CommandBlockEntity.cpp +++ b/src/BlockEntities/CommandBlockEntity.cpp @@ -45,7 +45,7 @@ void cCommandBlockEntity::UsedBy(cPlayer * a_Player) cWindow * Window = GetWindow(); if (Window == NULL) { - //OpenWindow(new cDropSpenserWindow(m_PosX, m_PosY, m_PosZ, this)); + //OpenWindow(new cDropSpenserWindow(m_PosX, m_PosY, m_PosZ, this)); FIXME Window = GetWindow(); } @@ -71,6 +71,24 @@ void cCommandBlockEntity::SetCommand(const AString & a_Cmd) +void cCommandBlockEntity::SetLastOutput(const AString & a_LastOut) +{ + m_LastOutput = a_LastOut; +} + + + + + +void cCommandBlockEntity::SetResult(const NIBBLETYPE a_Result) +{ + m_Result = a_Result; +} + + + + + const AString & cCommandBlockEntity::GetCommand(void) const { return m_Command; @@ -89,6 +107,15 @@ const AString & cCommandBlockEntity::GetLastOutput(void) const +NIBBLETYPE cCommandBlockEntity::GetResult(void) const +{ + return m_Result; +} + + + + + void cCommandBlockEntity::Activate(void) { m_ShouldExecute = true; @@ -164,8 +191,11 @@ void cCommandBlockEntity::SaveToJson(Json::Value & a_Value) void cCommandBlockEntity::Execute() { // TODO: Parse arguments and dispatch command + LOGD("Command: %s", m_Command.c_str()); + m_LastOutput = ""; + m_Result = 0; } -- cgit v1.2.3