Hey so my code isn't recognizing that I've got created a constructor and it isn't recognizing my string variables. I've tried to figure out the issue but I just couldn't, so I'm here asking for advice. I've added my game class to it to help debug it a bit more.
namespace Mas
{
class Game
{
private string _Title;
private string _Category;
public int _MinimumAge;
private string _NumberofPlayers;
private string title;
private string category;
private string numberOfPlayers;
public Game(string Title, string Category, int MinimumAge, string NumberOfPlayers)
{
_Title = Title;
_Category = Category;
if (MinimumAge >= 0)
{
_MinimumAge = MinimumAge;
}
else
{
throw new Exception("Minimum age is 0 please state a higher age");
}
_NumberofPlayers = NumberOfPlayers;
}
public string Title
{
get { return _Title; }
}
public string Category
{
get { return _Category; }
}
public int MinimunAge
{
get { return _MinimumAge; }
}
public string NumberofPlayers
{
get { return _NumberofPlayers; }
}
public override string ToString()
{
return Title.PadRight(10) + Category.ToString().PadRight(5) + NumberofPlayers;
}
}
}