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"
|
|
|
|
|
|
|
|
namespace Star {
|
|
|
|
|
|
|
|
STAR_CLASS(ObjectItem);
|
|
|
|
|
|
|
|
class ObjectItem : public Item, public FireableItem, public BeamItem {
|
|
|
|
public:
|
|
|
|
ObjectItem(Json const& config, String const& directory, Json const& objectParameters);
|
|
|
|
virtual ~ObjectItem() {}
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
float cooldownTime() const override;
|
|
|
|
void fire(FireMode mode, bool shifting, bool edgeTriggered) override;
|
|
|
|
|
|
|
|
String objectName() const;
|
|
|
|
Json objectParameters() const;
|
|
|
|
|
|
|
|
bool placeInWorld(FireMode mode, bool shifting);
|
|
|
|
bool canPlace(bool shifting) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_shifting;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|