cs and c
This commit is contained in:
@@ -17,18 +17,30 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoloClubApp {
|
||||
internal class SmartPhone : Device {
|
||||
public string DeviceType = "SmartPhone";
|
||||
public int Id { get; }
|
||||
public string Name { get; }
|
||||
public string PlayerName { get; set; }
|
||||
|
||||
public SmartPhone(int id, string name) : base(id, name, null){
|
||||
Id = id;
|
||||
Name = name;
|
||||
}
|
||||
public override string GetDetails(){
|
||||
return DeviceType + "Id: " + Id + ", Name: " + Name;
|
||||
/// <summary>
|
||||
/// Represents a smartphone device in the Polo Club system.
|
||||
/// </summary>
|
||||
public class SmartPhone : Device
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the type of the device (always "SmartPhone").
|
||||
/// </summary>
|
||||
public string DeviceType { get; } = "SmartPhone";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the SmartPhone class.
|
||||
/// </summary>
|
||||
/// <param name="id">The unique identifier for the smartphone.</param>
|
||||
/// <param name="name">The name of the smartphone.</param>
|
||||
public SmartPhone(int id, string name) : base(id, name) { }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a formatted string with details about the smartphone.
|
||||
/// </summary>
|
||||
/// <returns>A string containing device details.</returns>
|
||||
public override string GetDetails()
|
||||
{
|
||||
return $"{DeviceType} - Id: {Id}, Name: {Name}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user