Files
John Norman 75393a0a1a #include updates.
Sorted includes.
Converted dependencies to brackets.
Use relative path for includes.
2024-07-05 16:23:33 -07:00

59 lines
1.2 KiB
C++

#ifndef TLEVELSIGN_H
#define TLEVELSIGN_H
#include <memory>
#include <vector>
#include <CString.h>
#ifdef V8NPCSERVER
#include "scripting/interface/ScriptBindings.h"
#endif
class Player;
class LevelSign : public std::enable_shared_from_this<LevelSign>
{
public:
LevelSign(const int pX, const int pY, const CString& pSign, bool encoded = false);
// functions
CString getSignStr(Player* pPlayer = 0) const;
// get private variables
int getX() const { return m_x; }
int getY() const { return m_y; }
CString getText() const { return m_text; }
CString getUText() const { return m_unformattedText; }
void setX(int value = 0) { m_x = value; }
void setY(int value = 0) { m_y = value; }
void setText(const CString& value);
void setUText(const CString& value);
#ifdef V8NPCSERVER
inline IScriptObject<LevelSign>* getScriptObject() const
{
return m_scriptObject.get();
}
inline void setScriptObject(std::unique_ptr<IScriptObject<LevelSign>> object)
{
m_scriptObject = std::move(object);
}
#endif
private:
int m_x, m_y;
CString m_text;
CString m_unformattedText;
#ifdef V8NPCSERVER
std::unique_ptr<IScriptObject<LevelSign>> m_scriptObject;
#endif
};
using LevelSignPtr = std::shared_ptr<LevelSign>;
#endif // TLEVELSIGN_H