-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginInfo.cs
More file actions
42 lines (35 loc) · 1.32 KB
/
PluginInfo.cs
File metadata and controls
42 lines (35 loc) · 1.32 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
using System;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Text;
namespace Terraria.Plugins.Common {
public struct PluginInfo {
public static PluginInfo Empty = default(PluginInfo);
public string PluginName { get; private set; }
public Version VersionNumber { get; private set; }
public string VersionAppendix { get; private set; }
public string Author { get; private set; }
public string Description { get; private set; }
public PluginInfo(
string pluginName, Version versionNumber, string versionAppendix, string author, string description
): this() {
this.PluginName = pluginName;
this.VersionNumber = versionNumber;
this.VersionAppendix = versionAppendix;
this.Author = author;
this.Description = description;
}
public override string ToString() {
StringBuilder resultBuilder = new StringBuilder(this.PluginName);
resultBuilder.Append(' ');
resultBuilder.Append(this.VersionNumber.ToString(3));
if (this.VersionAppendix != string.Empty) {
resultBuilder.Append(' ');
resultBuilder.Append(this.VersionAppendix);
}
resultBuilder.Append(" by ");
resultBuilder.Append(this.Author);
return resultBuilder.ToString();
}
}
}