Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve class Item, by enumeration ItemType #163

Open
verhagen opened this issue Dec 14, 2014 · 4 comments
Open

Improve class Item, by enumeration ItemType #163

verhagen opened this issue Dec 14, 2014 · 4 comments

Comments

@verhagen
Copy link
Contributor

⚠️ First resolve #162

Create enumeration ItemType

It should contain, all the types of Items, that are currently found in the game, like:

ARMOUR
FOOD
FOOD_LIQUID
TOOL
WEAPON
etc

Update Item
Inside class Item, there is a field type, of type String, change it to:

private ItemType type

Update the related code.

@verhagen verhagen added the todo label Dec 14, 2014
@verhagen verhagen added this to the cleanup milestone Dec 14, 2014
@projectdelphai projectdelphai changed the title [Clean Code] Improve class Item, by enumeration ItemType Improve class Item, by enumeration ItemType Dec 14, 2014
@projectdelphai
Copy link
Member

  1. There is no distinction between food and food_liquid. It's all food to the user in that it provides +n amount of hp. If this absolutely needs to be changed (i.e to differentiate in grammar when posting status updates (eat vs drink)) it should be changed to drink or potion.
  2. A better option is to include liquids as potions, items which modify stats positively or negatively. So pmil1 would provide +5 hp while pmil2 would give +20 hp for example while ptox1 (toxic potion lvl 1) would give -30 hp.

@verhagen
Copy link
Contributor Author

The idea is to have a command eat for fixed food and drink for liquid stuff.

@paddatrapper
Copy link
Contributor

That can be done through the use of aliases and would not need the distinction made in the item type. Aliases can simply added to use command for East and drink

@projectdelphai
Copy link
Member

We can just change food-liquids to potions and then filter based on itemType. If it's food, then eat and if it's potion, then drink.

@paddatrapper paddatrapper modified the milestones: alpha version, cleanup, beta version Dec 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants