-
Notifications
You must be signed in to change notification settings - Fork 4
/
Metadata.cs
96 lines (77 loc) · 2.33 KB
/
Metadata.cs
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
95
96
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
namespace AstroModIntegrator
{
public enum DownloadMode
{
[EnumMember(Value = "index_file")]
IndexFile
}
public class DownloadInfo
{
[JsonProperty("type")]
[JsonConverter(typeof(StringEnumConverter))]
public DownloadMode Type;
[JsonProperty("url")]
[DefaultValue("")]
public string URL;
}
public enum SyncMode
{
[EnumMember(Value = "serverclient")]
ServerAndClient,
[EnumMember(Value = "server")]
ServerOnly,
[EnumMember(Value = "client")]
ClientOnly,
[EnumMember(Value = "none")]
None
}
public class Metadata : ICloneable
{
[JsonProperty("schema_version")]
[DefaultValue(1)]
public int SchemaVersion;
[JsonProperty("name")]
public string Name;
[JsonProperty("mod_id")]
[DefaultValue("")]
public string ModID;
[JsonProperty("author")]
[DefaultValue("")]
public string Author;
[JsonProperty("description")]
[DefaultValue("")]
public string Description;
[JsonProperty("version")]
[JsonConverter(typeof(VersionConverter))]
public Version ModVersion;
[JsonProperty("astro_build")]
[JsonConverter(typeof(VersionConverter))]
public Version AstroBuild;
[JsonProperty("sync")]
[JsonConverter(typeof(StringEnumConverter))]
public SyncMode Sync;
[JsonProperty("homepage")]
[DefaultValue("")]
public string Homepage;
[JsonProperty("download")]
public DownloadInfo Download;
[JsonProperty("linked_actor_components")]
public Dictionary<string, List<string>> LinkedActorComponents;
[JsonProperty("item_list_entries")]
public Dictionary<string, Dictionary<string, List<string>>> ItemListEntries;
[JsonProperty("persistent_actors")]
public List<string> PersistentActors;
[JsonProperty("mission_trailheads")]
public List<string> MissionTrailheads;
public object Clone()
{
return this.MemberwiseClone();
}
}
}