Go to the documentation of this file.
45 m_color(
Color::alpha),
74 if(m_clientId == 0 || !
canDraw())
81 int xPattern = 0, yPattern = 0, zPattern = 0;
87 rawGetThingType()->
draw(dest, scaleFactor, 0, xPattern, yPattern, zPattern, animationPhase, redrawFlag, lightView);
111 id = itemType->getClientId();
125 while(in->canRead()) {
126 int attrib = in->getU8();
142 m_attribs.
set(attrib, in->getU8());
147 m_attribs.
set(attrib, in->getU16());
162 m_attribs.
set(attrib, in->getU32());
167 pos.
x = in->getU16();
168 pos.
y = in->getU16();
170 m_attribs.
set(attrib, pos);
178 m_attribs.
set(attrib, in->getString());
203 out->addPos(dest.
x, dest.
y, dest.
z);
228 const std::string text =
getText();
231 out->addString(text);
236 out->addString(desc);
240 for(
const auto& i : m_containerItems)
241 i->serializeItem(out);
247 return m_countOrSubType;
256 return m_countOrSubType;
263 *(item.
get()) = *
this;
274 if(m_countOrSubType <= 0) {
277 }
else if(m_countOrSubType < 5) {
278 xPattern = m_countOrSubType - 1;
280 }
else if(m_countOrSubType < 10) {
283 }
else if(m_countOrSubType < 25) {
286 }
else if(m_countOrSubType < 50) {
304 switch(m_countOrSubType) {
364 color = m_countOrSubType;
ThingType * rawGetThingType(uint16 id, ThingCategory category)
virtual void setColor(const Color &color)
void serializeItem(const OutputBinaryTreePtr &out)
void startListenerPainter(const float duration)
const TilePtr & getTile()
AnimatorPtr getAnimator()
void unserializeItem(const BinaryTreePtr &in)
void error(const std::string &what)
const ThingTypePtr & getThingType() override
const ItemTypePtr & getItemType(uint16 id)
void draw(const Point &dest, float scaleFactor, bool animate, int redrawFlag=Otc::ReDrawThing, LightView *lightView=nullptr) override
int getExactSize(int layer=0, int xPattern=0, int yPattern=0, int zPattern=0, int animationPhase=0) override
ThingType * rawGetThingType() override
void calculatePatterns(int &xPattern, int &yPattern, int &zPattern)
std::string getDescription()
bool isValidOtbId(uint16 id)
static ItemPtr createFromOtb(int id)
const ItemTypePtr & findItemTypeByClientId(uint16 id)
const ThingTypePtr & getThingType(uint16 id, ThingCategory category)
bool getFeature(Otc::GameFeature feature)
bool hasAnimationPhases()
int calculateAnimationPhase(bool animate)
void throw_exception(const std::string &what)
Throws a generic exception.
static ItemPtr create(int id)
virtual const char * what() const
virtual int getExactSize(int layer, int xPattern, int yPattern, int zPattern, int animationPhase)
void setId(uint32 id) override
void startListenerPainter()
void set(Key id, const T &value)
void draw(const Point &dest, float scaleFactor, int layer, int xPattern, int yPattern, int zPattern, int animationPhase, int reDrawFlags=Otc::ReDrawThing, LightView *lightView=nullptr)
stdext::shared_object_ptr< Item > ItemPtr
ThingTypeManager g_things
bool isValidDatId(uint16 id, ThingCategory category)