-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwykonanie.txt
8 lines (7 loc) · 1.75 KB
/
wykonanie.txt
1
2
3
4
5
6
7
For the purpose of the Homework, I used Interfaces: ICreature oraz ILocations with all the functions which are possible to use for creatures and locations.
Class Creature contains several methods, such as Feed(), Dominance(), Fight(), GetAway() and others. They were crucial for the game since they were used on all of the creatures in the certain situations.
Then, I could simply call the function for the elemens of the listOfCreatures - which was updated when catching the creature and when the creature got away.
Every creature gets its name when a player gives it in the Inventory; it has its type and species - which is checked in several places for displaying a proper element - since these two properties together are unique for the element. They also have feedLevel which leads to trustLevel - affecting the random function GetAway(), giving a smaller chance for losing the creature if its trustLevel is higher.
There are also 3 locations on the map which work using the same function Search() from the Class Location which was checking if anything was found at all.
Class Variables contains money and food values which are changing in a few forms - while earning money and buying food. It is also displayed in the Inventory. In order to keep these data in order, money and food are properties of the element of the class.
For example, while fighting the creature enemy with my creature c, I can simply call the function Fight() and give the creature enemy from the FormFound and the creature of certain type and species - chosen by player in the FormFight. The function Fight() calls the Dominance() function for enemy creature and also for creature c, to get the factor for the equation. This also sets the creature c health to 0 and gives the enemy.fightlost bool value.