123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #pragma once
- #include "Block.h"
- #include "TickQueue.h"
- class FluidBlockType;
- class FluidBlock : public Block
- {
- private:
- Directions flowDir;
- short fluidAmount;
- short lastBroadcastedAmount;
- int nextFlow;
- 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);
- virtual ~FluidBlock();
- virtual void sendModelInfo(NetworkMessage* zMessage) override;
- static void sortByAmound(FluidBlock** array, int count);
- friend FluidBlockType;
- };
- class FluidBlockType : public BlockType
- {
- 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);
- };
|