Go to the documentation of this file.
44 m_color(
Color::alpha),
79 int xPattern = 0, yPattern = 0, zPattern = 0;
84 rawGetThingType()->
draw(dest, scaleFactor, 0, xPattern, yPattern, zPattern, animationPhase, lightView);
108 id = itemType->getClientId();
122 while(in->canRead()) {
123 int attrib = in->getU8();
139 m_attribs.
set(attrib, in->getU8());
144 m_attribs.
set(attrib, in->getU16());
159 m_attribs.
set(attrib, in->getU32());
163 pos.
x = in->getU16();
164 pos.
y = in->getU16();
166 m_attribs.
set(attrib, pos);
174 m_attribs.
set(attrib, in->getString());
199 out->addPos(dest.
x, dest.
y, dest.
z);
227 out->addString(text);
232 out->addString(desc);
236 for(
auto i : m_containerItems)
237 i->serializeItem(out);
243 return m_countOrSubType;
252 return m_countOrSubType;
269 *(item.
get()) = *
this;
280 if(m_countOrSubType <= 0) {
283 }
else if(m_countOrSubType < 5) {
284 xPattern = m_countOrSubType-1;
286 }
else if(m_countOrSubType < 10) {
289 }
else if(m_countOrSubType < 25) {
292 }
else if(m_countOrSubType < 50) {
310 switch(m_countOrSubType) {
370 color = m_countOrSubType;
ThingType * rawGetThingType(uint16 id, ThingCategory category)
virtual void setColor(const Color &color)
void serializeItem(const OutputBinaryTreePtr &out)
const TilePtr & getTile()
AnimatorPtr getAnimator()
void unserializeItem(const BinaryTreePtr &in)
void error(const std::string &what)
const ThingTypePtr & getThingType()
const ItemTypePtr & getItemType(uint16 id)
void calculatePatterns(int &xPattern, int &yPattern, int &zPattern)
std::string getDescription()
bool isValidOtbId(uint16 id)
void draw(const Point &dest, float scaleFactor, bool animate, LightView *lightView=nullptr)
static ItemPtr createFromOtb(int id)
const ItemTypePtr & findItemTypeByClientId(uint16 id)
const ThingTypePtr & getThingType(uint16 id, ThingCategory category)
bool getFeature(Otc::GameFeature feature)
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
void draw(const Point &dest, float scaleFactor, int layer, int xPattern, int yPattern, int zPattern, int animationPhase, LightView *lightView=nullptr)
int getExactSize(int layer=0, int xPattern=0, int yPattern=0, int zPattern=0, int animationPhase=0)
virtual int getExactSize(int layer, int xPattern, int yPattern, int zPattern, int animationPhase)
void set(Key id, const T &value)
stdext::shared_object_ptr< Item > ItemPtr
ThingTypeManager g_things
bool isValidDatId(uint16 id, ThingCategory category)
ThingType * rawGetThingType()