IJInventoryItem.h 999 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // IJInventoryItem.h
  3. // InsideJob
  4. //
  5. // Created by Adam Preble on 10/7/10.
  6. // Copyright 2010 Adam Preble. All rights reserved.
  7. //
  8. #import <Cocoa/Cocoa.h>
  9. // See: http://www.minecraftwiki.net/wiki/Data_values
  10. #define IJInventorySlotQuickFirst (0)
  11. #define IJInventorySlotQuickLast (8)
  12. #define IJInventorySlotNormalFirst (9)
  13. #define IJInventorySlotNormalLast (35)
  14. #define IJInventorySlotArmorLast (103) // head
  15. #define IJInventorySlotArmorFirst (100) // feet
  16. @interface IJInventoryItem : NSObject <NSCoding> {
  17. int16_t itemId;
  18. int16_t damage;
  19. uint8_t count;
  20. int8_t slot;
  21. }
  22. @property (nonatomic, assign) int16_t itemId;
  23. @property (nonatomic, assign) int16_t damage;
  24. @property (nonatomic, assign) uint8_t count;
  25. @property (nonatomic, assign) int8_t slot;
  26. @property (nonatomic, readonly) NSString *itemName;
  27. @property (nonatomic, readonly) NSImage *image;
  28. + (id)emptyItemWithSlot:(uint8_t)slot;
  29. + (NSDictionary *)itemIdLookup;
  30. + (NSImage *)imageForItemId:(uint16_t)itemId;
  31. @end