Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
FacundoPiriz17 committed Nov 7, 2024
1 parent ba55d93 commit a2a7db2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
14 changes: 8 additions & 6 deletions src/Library/Attack.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
namespace Library;

/// <summary>
/// Esta clase representa un ataque básico que puede aprender el pokémon.
/// </summary>
public class Attack : IAttack
{
/// <summary>
Expand Down Expand Up @@ -27,14 +29,14 @@ public class Attack : IAttack
/// </summary>
/// <param name="name">Nombre del ataque a crear.</param>
/// <param name="type">Tipo del ataque a crear.</param>
/// <param name="Accuracy">Precisión del ataque a crear.</param>
/// <param name="Power">Potencia del ataque a crear.</param>
public Attack(string name, Type type, int Accuracy, int Power)
/// <param name="accuracy">Precisión del ataque a crear.</param>
/// <param name="power">Potencia del ataque a crear.</param>
public Attack(string name, Type type, int accuracy, int power)
{
this.Name = name;
this.Type = type;
this.Accuracy = Accuracy;
this.Power = Power;
this.Accuracy = accuracy;
this.Power =power;

}
}
10 changes: 7 additions & 3 deletions src/Library/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,14 @@ public void AddToTeam(Pokemon pokemon)
/// </returns>
public bool SetActivePokemon(Pokemon pokemon)
{
if (pokemon.CurrentLife > 0)
if (pokemon != null)
{
this.ActivePokemon = pokemon;
return true;
if (pokemon.CurrentLife > 0)
{
this.ActivePokemon = pokemon;
return true;
}
return false;
}
return false;
}
Expand Down

0 comments on commit a2a7db2

Please sign in to comment.