This commit is contained in:
Rens Pastoor
2025-06-12 11:20:08 +02:00
parent 37013ec1fc
commit 1086760c4a
21 changed files with 444 additions and 256 deletions

View File

@@ -17,27 +17,57 @@ using System.Text;
using System.Threading.Tasks;
namespace PoloClubApp {
internal class FitTracker : Device, IWearable {
public string DeviceType = "FitTracker";
public int Id { get; }
public string Name { get; }
public string PlayerName { get; set; }
/// <summary>
/// Represents a fitness tracker device that implements IWearable interface.
/// </summary>
public class FitTracker : Device, IWearable {
/// <summary>
/// Gets the type of the device (always "FitTracker").
/// </summary>
public string DeviceType { get; } = "FitTracker";
/// <summary>
/// Gets the water resistance rating in meters.
/// </summary>
public int WaterResistanceMeters { get; }
/// <summary>
/// Gets the color of the fitness tracker.
/// </summary>
public string Color { get; }
public FitTracker(int id, string name, int waterResistanceMeters, string color) : base(id, name, null){
Id = id;
Name = name;
/// <summary>
/// Initializes a new instance of the FitTracker class.
/// </summary>
/// <param name="id">The unique device identifier.</param>
/// <param name="name">The name of the fitness tracker.</param>
/// <param name="waterResistanceMeters">Water resistance rating in meters.</param>
/// <param name="color">The color of the device.</param>
public FitTracker(int id, string name, int waterResistanceMeters, string color)
: base(id, name)
{
WaterResistanceMeters = waterResistanceMeters;
Color = color;
}
public override string GetDetails(){
return DeviceType + "Id: " + Id + ", Name: " + Name + ", Type: " + ", WaterResistanceMeters: " + WaterResistanceMeters + ", Color: " + Color;
/// <summary>
/// Gets detailed information about the fitness tracker.
/// </summary>
/// <returns>Formatted string with device details.</returns>
public override string GetDetails()
{
return $"{DeviceType} - Id: {Id}, Name: {Name}, " +
$"Water Resistance: {WaterResistanceMeters}m, " +
$"Color: {Color}";
}
public int GetWaterResistanceMeters(){
/// <summary>
/// Gets the water resistance rating.
/// </summary>
/// <returns>Water resistance in meters.</returns>
public int GetWaterResistanceMeters()
{
return WaterResistanceMeters;
}
}
}
}