ItemType.cpp 722 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "ItemType.h"
  2. #include <InMemoryBuffer.h>
  3. #include "Registries.h"
  4. ItemType::ItemType(int id, ModelInfo model)
  5. : ReferenceCounter(),
  6. id(id),
  7. model(model),
  8. icon(0)
  9. {}
  10. ItemType::~ItemType()
  11. {
  12. if (this->icon) this->icon->release();
  13. }
  14. int ItemType::getId() const
  15. {
  16. return id;
  17. }
  18. void ItemType::setBild(Framework::Bild* icon)
  19. {
  20. if (this->icon) this->icon->release();
  21. this->icon = icon;
  22. }
  23. Framework::Bild* ItemType::zIcon() const
  24. {
  25. return icon;
  26. }
  27. Framework::Model3DData* ItemType::getItemModel() const
  28. {
  29. return model.getModel();
  30. }
  31. Framework::Model3DTextur* ItemType::getItemTextur() const
  32. {
  33. return model.getTexture();
  34. }