Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ XsdDuration() [3/5]

System.Xml.Schema.XsdDuration.XsdDuration ( TimeSpan timeSpan,
DurationType durationType )
inline

Definition at line 103 of file XsdDuration.cs.

104 {
105 long ticks = timeSpan.Ticks;
106 bool flag;
107 ulong num;
108 if (ticks < 0)
109 {
110 flag = true;
111 num = (ulong)(-ticks);
112 }
113 else
114 {
115 flag = false;
116 num = (ulong)ticks;
117 }
118 if (durationType == DurationType.YearMonthDuration)
119 {
120 int num2 = (int)(num / 315360000000000L);
121 int num3 = (int)(num % 315360000000000L / 25920000000000L);
122 if (num3 == 12)
123 {
124 num2++;
125 num3 = 0;
126 }
127 this = new XsdDuration(flag, num2, num3, 0, 0, 0, 0, 0);
128 return;
129 }
130 _nanoseconds = (uint)((int)(num % 10000000) * 100);
131 if (flag)
132 {
133 _nanoseconds |= 2147483648u;
134 }
135 _years = 0;
136 _months = 0;
137 _days = (int)(num / 864000000000L);
138 _hours = (int)(num / 36000000000L % 24);
139 _minutes = (int)(num / 600000000 % 60);
140 _seconds = (int)(num / 10000000 % 60);
141 }
XsdDuration(bool isNegative, int years, int months, int days, int hours, int minutes, int seconds, int nanoseconds)

References System.Xml.Schema.XsdDuration.XsdDuration(), System.Xml.Schema.XsdDuration._days, System.Xml.Schema.XsdDuration._hours, System.Xml.Schema.XsdDuration._minutes, System.Xml.Schema.XsdDuration._months, System.Xml.Schema.XsdDuration._nanoseconds, System.Xml.Schema.XsdDuration._seconds, System.Xml.Schema.XsdDuration._years, System.Xml.Dictionary, and System.Xml.L.