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

namespace AudioWallpaper.ActivityWatch {
    public class TimeSliceResult {
        public string TimeSlice { get; set; }
        public string Timezone { get; set; }
        public string DominantProcess { get; set; }
        public double ActiveSeconds { get; set; }
        public int SwitchCount { get; set; }
        public int KeywordsMatched { get; set; }
        public int DistractionEvents { get; set; }
        public List<string> WindowTitles { get; set; }
        public double FocusScore { get; set; }
        public string FocusState { get; set; }
        public double ProductivityScore { get; set; }
        public Dictionary<string, double> AppUtilization { get; set; }

#if DEBUG

        public override string ToString() {
            var windowTitles = WindowTitles != null ? string.Join(", ", WindowTitles) : "null";
            var appUtilization = AppUtilization != null
                ? string.Join(", ", AppUtilization.Select(kv => $"{kv.Key}:{kv.Value:F2}"))
                : "null";

            return $"TimeSlice: {TimeSlice}, " +
                   $"Timezone: {Timezone}, " +
                   $"DominantProcess: {DominantProcess}, " +
                   $"ActiveSeconds: {ActiveSeconds:F2}, " +
                   $"SwitchCount: {SwitchCount}, " +
                   $"KeywordsMatched: {KeywordsMatched}, " +
                   $"DistractionEvents: {DistractionEvents}, " +
                   $"WindowTitles: [{windowTitles}], " +
                   $"FocusScore: {FocusScore:F2}, " +
                   $"FocusState: {FocusState}, " +
                   $"ProductivityScore: {ProductivityScore:F2}, " +
                   $"AppUtilization: [{appUtilization}]";
        }
    }
#endif
}
