Pokemon Game SRP
Sorry I have a question about a game, I am making project for my uni about a pokemon game, the question is the next, I want to do the SRP principle of solid but I don't find a another posibility that make takedamage a method of each pokemon, is that bad? my setters are private because I don´t want them to be public, but I find that makeing and takeing damage should be a game mechanics class responsability
12 Replies
What did you try so far, can you show some code?
also i believe it depends on what the rules for taking damage are
This is my pokemon
some word are in spanish
I reached this, not find another to make damage to my pokemon, but I find it should be a game mechanics thing
yeah there are formulas online on how to calculate a pokemon taking damage
https://bulbapedia.bulbagarden.net/wiki/Damage this one look good
Bulbapedia
Damage
Damage (Japanese: ダメージ damage) is a loss of a Pokémon's HP that happens as the result of a physical or special attack used against it by another Pokémon.
atleast make
Estado
an enum, this way you can have named integersI mean if it should be a method of the pokemon I assume that yes
because I don't find another way
yes it should be only a single method, you can call it
TakeDamage
or something that has a parameter of Pokemon
or if u want to apply SRP you could put it in a class called DamageCalculator
Thanks you so much
I am doing a uni project
we should be a team
but Only two of us are workings
we are four
so it is a very hard time
@Manu what year are you I just started a c# class my first year
first year too
@Manu Im guessing ur at uni im just taking a community class to recover from injury but we haven’t gone over constructors yet 😭