Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. public class Weapon extends Item
  2. {
  3. public ItemType ThisItemType;
  4. public enum ItemType
  5. {
  6. Weapon,
  7. Potion
  8. }
  9.  
  10. public Weapon(ItemType type,int weaponDamage)
  11. {
  12. super();
  13. ThisItemType = type;
  14. setWeaponDamage(weaponDamage);
  15. }
  16.  
  17. public void UseItem()
  18. {
  19. if(ThisItemType == ItemType.Weapon)
  20. {
  21. //do shit
  22. }
  23. if(ThisItemType == ItemType.Potion)
  24. {
  25. //do shit
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement