I am in the middle of creating a new library, and since I was building it, something seemed a little strange. Here is the code:
namespace traditional_poker
{
public class poker
{
public class hand
{
public String Name
{
get; set;
}
public String[] cards
{
get; set;
}
}
List<hand> players;
public void AddPlayer(String name)
{
hand newHand = new hand();
newHand.Name = name;
players.Add(newHand);
}
}
}
I have it List<hand> playersinside the library itself, which means the library stores data (albeit temporarily).
Is this a bad practice?
Is there a better way to do this?
Or is this how I do it completely legal?
Rolan source
share