123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #pragma once
- #include "Block.h"
- #include "TickQueue.h"
- class FluidBlockType;
- class FluidBlock : public Block
- {
- private:
- Directions flowDir;
- short fluidAmount;
- short lastBroadcastedAmount;
- int nextFlow;
- Framework::Vec3<float> lightWeights;
- protected:
- virtual bool onTick(
- TickQueue* zQueue, int numTicks, bool& blocked) override;
- virtual void onPostTick() override;
- void broadcastAmount();
- public:
- FluidBlock(int typeId,
- Framework::Vec3<int> pos,
- int dimensionId,
- Framework::Vec3<float> lightWeights);
- virtual ~FluidBlock();
- virtual void sendModelInfo(NetworkMessage* zMessage) override;
- static void sortByAmound(FluidBlock** array, int count);
- virtual void filterPassingLight(unsigned char rgb[3]) const override;
- short getFluidAmount() const;
- friend FluidBlockType;
- };
- class FluidBlockType : public BlockType
- {
- private:
- Framework::Vec3<float> lightWeights;
- protected:
- virtual void loadSuperBlock(Block* zBlock,
- Framework::StreamReader* zReader,
- int dimensionId) const override;
- virtual void saveSuperBlock(
- Block* zBlock, Framework::StreamWriter* zWriter) const override;
- virtual Item* createItem() const override;
- virtual Block* createBlock(
- Framework::Vec3<int> position, int dimesionId) const override;
- public:
- FluidBlockType(int id,
- ModelInfo model,
- const char* name,
- int mapColor,
- Framework::Vec3<float> lightWeights);
- bool isFluid() const override;
- };
|