12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #pragma once
- #include "BasicBlocks.h"
- #include "Block.h"
- #include "BlockType.h"
- class BasicLightSourceBlockType;
- class LightSourceItemType;
- class LightSourceItem : public BasicBlockItem
- {
- protected:
- int color;
- public:
- LightSourceItem(int itemType, int blockType, const char* name);
- virtual bool canBeStackedWith(const Item* zItem) const override;
- friend LightSourceItemType;
- friend BasicLightSourceBlockType;
- };
- class LightSourceItemType : public BasicBlockItemType
- {
- private:
- int color;
- protected:
- virtual void loadSuperItem(
- Item* zItem, Framework::StreamReader* zReader) const override;
- virtual void saveSuperItem(
- const Item* zItem, Framework::StreamWriter* zWriter) const override;
- virtual Item* createItem() const override;
- public:
- LightSourceItemType(
- int id, const char* name, const ModelInfo model, int blockTypeId);
- LightSourceItemType* setColor(int color);
- };
- class BasicLightSource : public Block
- {
- protected:
- void setLight(int light);
- public:
- BasicLightSource(int typeId, Framework::Vec3<int> pos);
- virtual bool onTick(
- TickQueue* zQueue, int numTicks, bool& blocked) override;
- virtual void onPostTick() override;
- friend BasicLightSourceBlockType;
- };
- class BasicLightSourceBlockType : public BlockType
- {
- private:
- int itemType;
- bool transparent;
- bool passable;
- float hardness;
- bool interactable;
- int color;
- protected:
- virtual void createSuperBlock(Block* zBlock, Item* zItem) const override;
- virtual void loadSuperBlock(Block* zBlock,
- Framework::StreamReader* zReader,
- int dimensionId) const override;
- virtual void saveSuperBlock(
- Block* zBlock, Framework::StreamWriter* zWriter) const override;
- public:
- BasicLightSourceBlockType(int typeId, int itemTypeId, ModelInfo model, const char *name);
- virtual Block* createBlock(Framework::Vec3<int> position) const override;
- virtual Item* createItem() const override;
- BasicLightSourceBlockType* setHardness(float hardness);
- BasicLightSourceBlockType* setColor(int color);
- };
|