Skip to content

Commit d28308a

Browse files
committed
Implemented Weather, Projectile, Note, Climate, ConstructibleObject, IdleMarker, LeveledItem
1 parent ee7cf42 commit d28308a

48 files changed

Lines changed: 5610 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.IO;
7+
using System.Xml.Linq;
8+
using ESPSharp.Enums;
9+
using ESPSharp.Enums.Flags;
10+
using ESPSharp.Interfaces;
11+
using ESPSharp.Subrecords;
12+
using ESPSharp.SubrecordCollections;
13+
using ESPSharp.DataTypes;
14+
15+
namespace ESPSharp.DataTypes
16+
{
17+
public partial class TimeOfDayColors : IESPSerializable, ICloneable<TimeOfDayColors>
18+
{
19+
public Color Sunrise { get; set; }
20+
public Color Day { get; set; }
21+
public Color Sunset { get; set; }
22+
public Color Night { get; set; }
23+
public Color HighNoon { get; set; }
24+
public Color Midnight { get; set; }
25+
26+
public TimeOfDayColors()
27+
{
28+
Sunrise = new Color();
29+
Day = new Color();
30+
Sunset = new Color();
31+
Night = new Color();
32+
HighNoon = new Color();
33+
Midnight = new Color();
34+
}
35+
36+
public TimeOfDayColors(Color Sunrise, Color Day, Color Sunset, Color Night, Color HighNoon, Color Midnight)
37+
{
38+
this.Sunrise = Sunrise;
39+
this.Day = Day;
40+
this.Sunset = Sunset;
41+
this.Night = Night;
42+
this.HighNoon = HighNoon;
43+
this.Midnight = Midnight;
44+
}
45+
46+
public TimeOfDayColors(TimeOfDayColors copyObject)
47+
{
48+
Sunrise = copyObject.Sunrise.Clone();
49+
Day = copyObject.Day.Clone();
50+
Sunset = copyObject.Sunset.Clone();
51+
Night = copyObject.Night.Clone();
52+
HighNoon = copyObject.HighNoon.Clone();
53+
Midnight = copyObject.Midnight.Clone();
54+
}
55+
56+
public void ReadBinary(ESPReader reader)
57+
{
58+
try
59+
{
60+
Sunrise.ReadBinary(reader);
61+
Day.ReadBinary(reader);
62+
Sunset.ReadBinary(reader);
63+
Night.ReadBinary(reader);
64+
HighNoon.ReadBinary(reader);
65+
Midnight.ReadBinary(reader);
66+
}
67+
catch
68+
{
69+
return;
70+
}
71+
}
72+
73+
public void WriteBinary(ESPWriter writer)
74+
{
75+
Sunrise.WriteBinary(writer);
76+
Day.WriteBinary(writer);
77+
Sunset.WriteBinary(writer);
78+
Night.WriteBinary(writer);
79+
HighNoon.WriteBinary(writer);
80+
Midnight.WriteBinary(writer);
81+
}
82+
83+
public void WriteXML(XElement ele, ElderScrollsPlugin master)
84+
{
85+
XElement subEle;
86+
87+
ele.TryPathTo("Sunrise", true, out subEle);
88+
Sunrise.WriteXML(subEle, master);
89+
90+
ele.TryPathTo("Day", true, out subEle);
91+
Day.WriteXML(subEle, master);
92+
93+
ele.TryPathTo("Sunset", true, out subEle);
94+
Sunset.WriteXML(subEle, master);
95+
96+
ele.TryPathTo("Night", true, out subEle);
97+
Night.WriteXML(subEle, master);
98+
99+
ele.TryPathTo("HighNoon", true, out subEle);
100+
HighNoon.WriteXML(subEle, master);
101+
102+
ele.TryPathTo("Midnight", true, out subEle);
103+
Midnight.WriteXML(subEle, master);
104+
}
105+
106+
public void ReadXML(XElement ele, ElderScrollsPlugin master)
107+
{
108+
XElement subEle;
109+
110+
if (ele.TryPathTo("Sunrise", false, out subEle))
111+
{
112+
Sunrise.ReadXML(subEle, master);
113+
}
114+
115+
if (ele.TryPathTo("Day", false, out subEle))
116+
{
117+
Day.ReadXML(subEle, master);
118+
}
119+
120+
if (ele.TryPathTo("Sunset", false, out subEle))
121+
{
122+
Sunset.ReadXML(subEle, master);
123+
}
124+
125+
if (ele.TryPathTo("Night", false, out subEle))
126+
{
127+
Night.ReadXML(subEle, master);
128+
}
129+
130+
if (ele.TryPathTo("HighNoon", false, out subEle))
131+
{
132+
HighNoon.ReadXML(subEle, master);
133+
}
134+
135+
if (ele.TryPathTo("Midnight", false, out subEle))
136+
{
137+
Midnight.ReadXML(subEle, master);
138+
}
139+
}
140+
141+
public TimeOfDayColors Clone()
142+
{
143+
return new TimeOfDayColors(this);
144+
}
145+
}
146+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<#@ template debug="false" hostspecific="false" language="C#" #>
2+
<#@ output extension=".cs" #>
3+
<#
4+
DataTypeTemplate template = new DataTypeTemplate();
5+
template.ClassName = "TimeOfDayColors";
6+
7+
DataTypeField tempField;
8+
9+
tempField =
10+
new DataTypeField(
11+
typeof(Color),
12+
"Sunrise",
13+
"Sunrise"
14+
);
15+
template.Fields.Add(tempField);
16+
17+
tempField =
18+
new DataTypeField(
19+
typeof(Color),
20+
"Day",
21+
"Day"
22+
);
23+
template.Fields.Add(tempField);
24+
25+
tempField =
26+
new DataTypeField(
27+
typeof(Color),
28+
"Sunset",
29+
"Sunset"
30+
);
31+
template.Fields.Add(tempField);
32+
33+
tempField =
34+
new DataTypeField(
35+
typeof(Color),
36+
"Night",
37+
"Night"
38+
);
39+
template.Fields.Add(tempField);
40+
41+
tempField =
42+
new DataTypeField(
43+
typeof(Color),
44+
"HighNoon",
45+
"HighNoon"
46+
);
47+
template.Fields.Add(tempField);
48+
49+
tempField =
50+
new DataTypeField(
51+
typeof(Color),
52+
"Midnight",
53+
"Midnight"
54+
);
55+
template.Fields.Add(tempField);
56+
#>
57+
<#@ include file="DataTypeTemplate.t4" once="true" #>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.IO;
7+
using System.Xml.Linq;
8+
using ESPSharp.Enums;
9+
using ESPSharp.Enums.Flags;
10+
using ESPSharp.Interfaces;
11+
using ESPSharp.Subrecords;
12+
using ESPSharp.SubrecordCollections;
13+
using ESPSharp.DataTypes;
14+
15+
namespace ESPSharp.DataTypes
16+
{
17+
public partial class WeatherChance : IESPSerializable, ICloneable<WeatherChance>, IReferenceContainer
18+
{
19+
public FormID Weather { get; set; }
20+
public Int32 Chance { get; set; }
21+
public FormID Global { get; set; }
22+
23+
public WeatherChance()
24+
{
25+
Weather = new FormID();
26+
Chance = new Int32();
27+
Global = new FormID();
28+
}
29+
30+
public WeatherChance(FormID Weather, Int32 Chance, FormID Global)
31+
{
32+
this.Weather = Weather;
33+
this.Chance = Chance;
34+
this.Global = Global;
35+
}
36+
37+
public WeatherChance(WeatherChance copyObject)
38+
{
39+
Weather = copyObject.Weather.Clone();
40+
Chance = copyObject.Chance;
41+
Global = copyObject.Global.Clone();
42+
}
43+
44+
public void ReadBinary(ESPReader reader)
45+
{
46+
try
47+
{
48+
Weather.ReadBinary(reader);
49+
Chance = reader.ReadInt32();
50+
Global.ReadBinary(reader);
51+
}
52+
catch
53+
{
54+
return;
55+
}
56+
}
57+
58+
public void WriteBinary(ESPWriter writer)
59+
{
60+
Weather.WriteBinary(writer);
61+
writer.Write(Chance);
62+
Global.WriteBinary(writer);
63+
}
64+
65+
public void WriteXML(XElement ele, ElderScrollsPlugin master)
66+
{
67+
XElement subEle;
68+
69+
ele.TryPathTo("Weather", true, out subEle);
70+
Weather.WriteXML(subEle, master);
71+
72+
ele.TryPathTo("Chance", true, out subEle);
73+
subEle.Value = Chance.ToString();
74+
75+
ele.TryPathTo("Global", true, out subEle);
76+
Global.WriteXML(subEle, master);
77+
}
78+
79+
public void ReadXML(XElement ele, ElderScrollsPlugin master)
80+
{
81+
XElement subEle;
82+
83+
if (ele.TryPathTo("Weather", false, out subEle))
84+
{
85+
Weather.ReadXML(subEle, master);
86+
}
87+
88+
if (ele.TryPathTo("Chance", false, out subEle))
89+
{
90+
Chance = subEle.ToInt32();
91+
}
92+
93+
if (ele.TryPathTo("Global", false, out subEle))
94+
{
95+
Global.ReadXML(subEle, master);
96+
}
97+
}
98+
99+
public WeatherChance Clone()
100+
{
101+
return new WeatherChance(this);
102+
}
103+
}
104+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<#@ template debug="false" hostspecific="false" language="C#" #>
2+
<#@ output extension=".cs" #>
3+
<#
4+
DataTypeTemplate template = new DataTypeTemplate();
5+
template.ClassName = "WeatherChance";
6+
7+
DataTypeField tempField;
8+
9+
tempField =
10+
new DataTypeField(
11+
typeof(FormID),
12+
"Weather",
13+
"Weather"
14+
);
15+
template.Fields.Add(tempField);
16+
17+
tempField =
18+
new DataTypeField(
19+
typeof(int),
20+
"Chance",
21+
"Chance"
22+
);
23+
template.Fields.Add(tempField);
24+
25+
tempField =
26+
new DataTypeField(
27+
typeof(FormID),
28+
"Global",
29+
"Global"
30+
);
31+
template.Fields.Add(tempField);
32+
#>
33+
<#@ include file="DataTypeTemplate.t4" once="true" #>

0 commit comments

Comments
 (0)