forked from rstarkov/TankIconMaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathData.cs
More file actions
94 lines (79 loc) · 3.06 KB
/
Copy pathData.cs
File metadata and controls
94 lines (79 loc) · 3.06 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using WotDataLib;
namespace TankIconMaker
{
class Tank : WotTank
{
private Action<string> _addWarning;
/// <param name="addWarning">
/// The method to be used to add warnings about this tank's rendering.</param>
public Tank(WotTank tank, Action<string> addWarning)
: base(tank)
{
_addWarning = addWarning;
}
public Tank(string tankId, int tier, Country country, Class class_, Category category, string imageName)
: base(tankId, country, tier, class_, category, imageName, Enumerable.Empty<KeyValuePair<ExtraPropertyId, string>>(), null)
{
}
/// <summary>
/// Adds a warning about this tank's rendering. The user will see a big warning icon telling them to look for
/// warnings on specific tanks, and each image with warnings will have a little warning icon shown in it.</summary>
public virtual void AddWarning(string warning)
{
_addWarning(warning);
}
}
/// <summary>Used to test makers for bugs in handling missing data.</summary>
class TestTank : Tank
{
/// <summary>Constructor.</summary>
public TestTank(string tankId, int tier, Country country, Class class_, Category category, string imageName, WotContext context)
: base(tankId, tier, country, class_, category, imageName)
{
TankId = tankId;
Tier = tier;
Country = country;
Class = class_;
Category = category;
Context = context;
ImageName = imageName;
}
public string PropertyValue;
public BitmapBase LoadedImage;
public override string this[string name] { get { return PropertyValue; } }
public override string this[ExtraPropertyId property] { get { return PropertyValue; } }
public override void AddWarning(string warning) { }
}
/// <summary>Represents one of the built-in tank image styles.</summary>
[TypeConverter(typeof(ImageBuiltInStyleTranslation.Conv))]
enum ImageBuiltInStyle
{
Contour,
ThreeD,
ThreeDv2,
ThreeDLarge,
ThreeDLargev2,
Country,
Class
}
class TimGameInstallation : GameInstallation, INotifyPropertyChanged
{
private TimGameInstallation() { } // for Classify
public TimGameInstallation(string path)
: base(path)
{
}
public override void Reload()
{
base.Reload();
PropertyChanged(this, new PropertyChangedEventArgs("DisplayName"));
}
/// <summary>The value displayed in the drop-down.</summary>
public string DisplayName { get { return (GameVersionName ?? "?") + ": " + Path; } }
public event PropertyChangedEventHandler PropertyChanged = (_, __) => { };
}
}