StendhalDesign: Difference between revisions

Content deleted Content added
No edit summary
Line 55:
*# Weapon
*# Healing potions
 
===Pig seller's user case===
FOREVER do:
Line 67 ⟶ 68:
*** Duplicate Pig
*** Make Pig follows Player
* Say bybye to Player
DONE
 
===Pig buyer's user case===
FOREVER do:
* Listen to Player
* If listen "Hi":
** Seller says "Greetings <Player>!"
* If listen "Sell pig" from Player:
** Estimate pig value related to Pig weight
** Seller says "Do you want to sell buy a pig for <estimated price> coins?"
* If listen "yes" from Player:
** set Player money=Player money + <estimated price>
** Destroy Pig
* Say bye to Player
DONE
 
===Pig's user case===
Line 89 ⟶ 103:
* If Wolf is attacked:
** Wolf attacks Attacker
 
== Entities ==
The above user cases shows the next entities in our system:
* Pig
* Pig seller
* Pig buyer
* Wolf
* Player
* Food
* Armor
* Weapon
* Healing potion
 
Let's describe each entity with its attributes and actions related.
=== Pig ===
It has the following set of attributes:
* x
* y
* dx
* dy
* hp
* owner
* weight
 
Pig tasks would be:
* follow
* eat
 
=== Wolf ===
It has the following set of attributes:
* x
* y
* dx
* dy
* hp
* atk
 
Wolf tasks would be:
* follow
* attack
* patrol
* chat
 
=== Pig seller and Pig buyer ===
It has the following set of attributes:
* x
* y
* dx
* dy
* atending
 
seller and buyer tasks would be:
* patrol
 
=== Player===
It has the following set of attributes:
* x
* y
* dx
* dy
* hp
* atk
* pig
* money
 
It has three slots:
* armor
* hand
* backpack
 
Player tasks would be:
* move
* attack
* chat
 
=== Food ===
It has the following set of attributes:
* x
* y
* quantity