Files
TrackTrendsDoc/temp_annexes/Code/DriverSectorWindow.md
T
2023-06-05 16:17:17 +02:00

1006 B

DriverSectorWindow.cs

/// Author : Maxime Rohmer
/// Date : 30/05/2023
/// File : DriverSectorWindow.cs
/// Brief : Window containing infos about a driver sector time. Can be the first second or third, does not matter.
/// Version : Alpha 1.0

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;

namespace TrackTrends
{
    public class DriverSectorWindow:Window
    {
        public DriverSectorWindow(Bitmap image, Rectangle bounds, int sectorId, bool generateEngine = true) : base(image, bounds,generateEngine)
        {
            Name = "Sector"+sectorId;
        }
        /// <summary>
        /// Decodes the sector
        /// </summary>
        /// <returns>the sector time in int (ms)</returns>
        public override object DecodePng()
        {
            int ocrResult = GetTimeFromPng(WindowImage, OcrImage.WindowType.Sector, Engine);
            return ocrResult;
        }
    }
}