ItemType.cpp 997 B

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