pokemon/men

This commit is contained in:
Geir Okkenhaug Jerstad 2024-12-09 12:32:29 +01:00
parent b5dc3a1e68
commit 9ea4a7c9bb
3 changed files with 10 additions and 13 deletions

View file

@ -8,13 +8,10 @@ internal class Pokemon
public int Health { get; private set; } public int Health { get; private set; }
public int Strength { get; private set; } public int Strength { get; private set; }
public Pokemon(int level, string name, string type, int health, int strength) public Pokemon(string name, string type)
{ {
Level = level;
Name = name; Name = name;
Type = type; Type = type;
Health = health;
Strength = strength;
} }
public void Fight(Pokemon opponent) public void Fight(Pokemon opponent)

View file

@ -10,15 +10,15 @@ internal class PokemonWorld
public PokemonWorld() public PokemonWorld()
{ {
MyTrainer = new Trainer(this, , , "Ash"); MyTrainer = new Trainer( "Ash", this);
WildPokemons = new List<Pokemon>() WildPokemons = new List<Pokemon>()
{ {
new Pokemon(11,"Lucario", "Grass",100,100), new Pokemon("Lucario", "Grass"),
new Pokemon(12,"Bulbasaur", "Grass",100,100), new Pokemon("Bulbasaur", "Grass"),
new Pokemon(13,"Gyarados", "Water",100,100), new Pokemon("Gyarados", "Water"),
new Pokemon(14,"Oshawott", "Water",100,100), new Pokemon("Oshawott", "Water"),
new Pokemon(15,"Grimer", "Mud",100,100), new Pokemon("Grimer", "Mud"),
new Pokemon(16,"Diglett", "Mud",100,100), new Pokemon("Diglett", "Mud"),
}; };
Menu(); Menu();
} }

View file

@ -7,11 +7,11 @@ internal class Trainer
public Pokemon StartPokemon { get; private set; } public Pokemon StartPokemon { get; private set; }
public string Name { get; private set; } public string Name { get; private set; }
public Trainer(PokemonWorld myWorld, List<string> inventory, Pokemon startPokemon, string name) public Trainer(string name, PokemonWorld myWorld)
{ {
MyWorld = myWorld; MyWorld = myWorld;
Inventory = new List<string>(); Inventory = new List<string>();
StartPokemon = new Pokemon(11,"Pikachu", "Lightning",100,100); StartPokemon = new Pokemon("Pikachu", "Lightning");
Name = name; Name = name;
} }