///
/// class: SmartWatch.cs
///
///This file defines the SmartWatch class, which represents a smartwatch device. It implements the IWearable interface
///and includes properties for water resistance and screen size, along with methods to get device details.
///
/// Name: Rens Pastoor
/// Studentnumber: 555408
/// Date: 11 May 2025
///
///Version: 1
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace PoloClubApp {
///
/// Represents a smartwatch device that implements IWearable interface.
///
public class SmartWatch : Device, IWearable {
///
/// Gets the type of the device (always "SmartWatch").
///
public string DeviceType { get; } = "SmartWatch";
///
/// Gets the water resistance rating in meters.
///
public int WaterResistanceMeters { get; }
///
/// Gets the screen size in millimeters.
///
public int ScreenSize { get; }
///
/// Initializes a new instance of the SmartWatch class.
///
/// The unique device identifier.
/// The name of the smartwatch.
/// Water resistance rating in meters.
/// Screen size in millimeters.
public SmartWatch(int id, string name, int waterResistanceMeters, int screenSize)
: base(id, name)
{
WaterResistanceMeters = waterResistanceMeters;
ScreenSize = screenSize;
}
///
/// Gets detailed information about the smartwatch.
///
/// Formatted string with device details.
public override string GetDetails()
{
return $"{DeviceType} - Id: {Id}, Name: {Name}, " +
$"Water Resistance: {WaterResistanceMeters}m, " +
$"Screen Size: {ScreenSize}mm";
}
///
/// Gets the water resistance rating.
///
/// Water resistance in meters.
public int GetWaterResistanceMeters()
{
return WaterResistanceMeters;
}
}
}