123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- #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, int dimensionId);
- 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, int dimensionId) const override;
- virtual Item* createItem() const override;
- BasicLightSourceBlockType* setHardness(float hardness);
- BasicLightSourceBlockType* setColor(int color);
- };
|