abstract class Player
{
//base properties
internal string Name { get; }
internal string Position { get; }
internal string Nationality { get; }
//physical properties
//all players are assigned these randomly
public int Pace { get { return SetPhysicalProperties(60,90); } }
public int Strength { get { return SetPhysicalProperties(60,90); } }
//Methods
static int SetPhysicalProperties(int min, int max)
{
var rand = new Random();
return rand.Next(min, max);
}
//display Info Method
public void DisplayInfo()
{
var info = new StringBuilder();
info.AppendLine("-----Personal Details----");
info.AppendLine($"Name: {this.Name}\tPosition: {this.Position}\t,Nationality: {this.Nationality}");
info.AppendLine("----Physical Attributes----");
info.AppendLine($"Pace: {this.Pace}\tStrength: {this.Strength}\t");
System.Console.WriteLine(info.ToString());
abstract class Player
{
//base properties
internal string Name { get; }
internal string Position { get; }
internal string Nationality { get; }
//physical properties
//all players are assigned these randomly
public int Pace { get { return SetPhysicalProperties(60,90); } }
public int Strength { get { return SetPhysicalProperties(60,90); } }
//Methods
static int SetPhysicalProperties(int min, int max)
{
var rand = new Random();
return rand.Next(min, max);
}
//display Info Method
public void DisplayInfo()
{
var info = new StringBuilder();
info.AppendLine("-----Personal Details----");
info.AppendLine($"Name: {this.Name}\tPosition: {this.Position}\t,Nationality: {this.Nationality}");
info.AppendLine("----Physical Attributes----");
info.AppendLine($"Pace: {this.Pace}\tStrength: {this.Strength}\t");
System.Console.WriteLine(info.ToString());