-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathData.cs
More file actions
36 lines (32 loc) · 1.03 KB
/
Data.cs
File metadata and controls
36 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace CheatEngineForumScraper
{
public class Data
{
// Storing deleted profile is useless but it's good when you need to total the profiles scraped
[JsonPropertyName("errors")]
public List<int> ErrorIDs { get; set; } = new();
[JsonPropertyName("profiles")]
public List<Profile> Profiles { get; set; } = new();
[JsonIgnore]
public bool Running { get; set; } = true;
public void LogLastSuccess()
{
int count = Profiles.Count;
if (count == 0) return;
var last = Profiles[count - 1];
last.Log();
}
public void LogLastFailure()
{
int count = ErrorIDs.Count;
if (count == 0) return;
var lastID = ErrorIDs[count - 1];
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"{lastID}:[ERROR]");
Console.ResetColor();
}
}
}