2024-02-25 14:46:47 +00:00
|
|
|
#pragma once
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
#include "StarItem.hpp"
|
|
|
|
#include "StarFireableItem.hpp"
|
|
|
|
#include "StarBeamItem.hpp"
|
|
|
|
#include "StarEntityRendering.hpp"
|
2023-08-20 00:42:17 +00:00
|
|
|
#include "StarPreviewTileTool.hpp"
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
namespace Star {
|
|
|
|
|
|
|
|
STAR_CLASS(LiquidItem);
|
|
|
|
|
2023-08-20 00:42:17 +00:00
|
|
|
class LiquidItem : public Item, public FireableItem, public PreviewTileTool, public BeamItem {
|
2023-06-20 04:33:09 +00:00
|
|
|
public:
|
|
|
|
LiquidItem(Json const& config, String const& directory, Json const& settings);
|
|
|
|
virtual ~LiquidItem() {}
|
|
|
|
|
|
|
|
ItemPtr clone() const override;
|
|
|
|
|
|
|
|
void init(ToolUserEntity* owner, ToolHand hand) override;
|
2023-07-20 14:58:49 +00:00
|
|
|
void update(float dt, FireMode fireMode, bool shifting, HashSet<MoveControlType> const& moves) override;
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
List<Drawable> nonRotatedDrawables() const override;
|
|
|
|
|
|
|
|
void fire(FireMode mode, bool shifting, bool edgeTriggered) override;
|
|
|
|
|
|
|
|
LiquidId liquidId() const;
|
|
|
|
float liquidQuantity() const;
|
|
|
|
|
2023-08-20 08:56:50 +00:00
|
|
|
List<PreviewTile> previewTiles(bool shifting) const override;
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
bool canPlace(bool shifting) const;
|
|
|
|
bool canPlaceAtTile(Vec2I pos) const;
|
|
|
|
bool multiplaceEnabled() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
LiquidId m_liquidId;
|
|
|
|
float m_quantity;
|
|
|
|
|
|
|
|
float m_blockRadius;
|
|
|
|
float m_altBlockRadius;
|
|
|
|
bool m_shifting;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|