osb/source/game/items/StarLiquidItem.hpp

46 lines
1.1 KiB
C++
Raw Permalink Normal View History

#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;
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;
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;
};
}