#pragma once #include "BasicBlocks.h" class Chest : public BasicBlock { private: bool open; int userEntityId; virtual void onDestroy() override; virtual void onDialogClosed(Framework::Text dialogId) override; Framework::Text getDialogId() const; protected: virtual bool onTick( TickQueue* zQueue, int numTicks, bool& blocked) override; public: Chest(int typeId, Framework::Vec3 pos, int dimensionId); virtual bool interact(Item* zItem, Entity* zActor) override; virtual void sendModelInfo(NetworkMessage* zMessage) override; }; class ChestBlockType : public BasicBlockType { public: ChestBlockType(); virtual Block* createBlock( Framework::Vec3 position, int dimensionId) const override; }; class ChestBlockTypeFactory : public BasicBlockTypeFactory { public: ChestBlockTypeFactory(); BasicBlockType* createValue( Framework::JSON::JSONObject* zJson) const override; BasicBlockType* fromJson(Framework::JSON::JSONObject* zJson) const override; Framework::JSON::JSONObject* toJsonObject( BasicBlockType* zObject) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; const char* getTypeToken() const override; const char* getTypeName() const; };