Merge pull request 'smells' (#48) from smells into main
continuous-integration/drone/push Build is passing Details

Reviewed-on: #48
pull/50/head
Alexis Drai 2 years ago
commit ab2febf1b8

@ -7,11 +7,7 @@ namespace App
{
static void Main(string[] args)
{
Debug.WriteLine("Hello Debug!");
Player player = new Player("John");
Die die = new Die("I'm a die");
Debug.WriteLine(player.Name);
Debug.WriteLine(die.Name);
Debug.WriteLine("HelloWorld");
}
}
}

@ -3,7 +3,7 @@ using System.Xml.Linq;
namespace Model
{
public class Player : IEquatable<Player>
public sealed class Player : IEquatable<Player>
{
public string Name
{
@ -13,7 +13,7 @@ namespace Model
}
internal set
{
if (!String.IsNullOrWhiteSpace(value) && !value.Equals(""))
if (!String.IsNullOrWhiteSpace(value))
{
name = value;
}

@ -55,7 +55,7 @@ namespace Model
/// <returns>player with said name</returns>
public Player GetOneByName(string name)
{
if (!String.IsNullOrWhiteSpace(name) && !name.Equals(""))
if (!String.IsNullOrWhiteSpace(name))
{
Player result = players.FirstOrDefault(p => p.Name.Equals(name));
return new Player(result); // THIS IS A COPY (using a copy constructor)

Loading…
Cancel
Save