Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SortingSteps.cs
Go to the documentation of this file.
2using System.Linq;
4using Terraria.ID;
6
8
9public static class SortingSteps
10{
11 public class ByNetId : IBestiarySortStep, IEntrySortStep<BestiaryEntry>, IComparer<BestiaryEntry>
12 {
13 public bool HiddenFromSortOptions => true;
14
33
34 public string GetDisplayNameKey()
35 {
36 return "BestiaryInfo.Sort_ID";
37 }
38 }
39
56
57 public class ByBestiarySortingId : IBestiarySortStep, IEntrySortStep<BestiaryEntry>, IComparer<BestiaryEntry>
58 {
59 public bool HiddenFromSortOptions => false;
60
81
82 public string GetDisplayNameKey()
83 {
84 return "BestiaryInfo.Sort_BestiaryID";
85 }
86 }
87
88 public class ByBestiaryRarity : IBestiarySortStep, IEntrySortStep<BestiaryEntry>, IComparer<BestiaryEntry>
89 {
90 public bool HiddenFromSortOptions => false;
91
111
112 public string GetDisplayNameKey()
113 {
114 return "BestiaryInfo.Sort_Rarity";
115 }
116 }
117
118 public class Alphabetical : IBestiarySortStep, IEntrySortStep<BestiaryEntry>, IComparer<BestiaryEntry>
119 {
120 public bool HiddenFromSortOptions => false;
121
123 {
127 {
128 return 1;
129 }
131 {
132 return -1;
133 }
135 {
136 return 0;
137 }
140 return textValue.CompareTo(textValue2);
141 }
142
143 public string GetDisplayNameKey()
144 {
145 return "BestiaryInfo.Sort_Alphabetical";
146 }
147 }
148
149 public abstract class ByStat : IBestiarySortStep, IEntrySortStep<BestiaryEntry>, IComparer<BestiaryEntry>
150 {
151 public bool HiddenFromSortOptions => false;
152
154 {
158 {
159 return 1;
160 }
162 {
163 return -1;
164 }
166 {
167 return 0;
168 }
170 }
171
173
174 public abstract string GetDisplayNameKey();
175
177 {
178 if (!(element is NPCStatsReportInfoElement))
179 {
180 return false;
181 }
182 return true;
183 }
184 }
185
186 public class ByAttack : ByStat
187 {
189 {
190 return cardY.Damage.CompareTo(cardX.Damage);
191 }
192
193 public override string GetDisplayNameKey()
194 {
195 return "BestiaryInfo.Sort_Attack";
196 }
197 }
198
199 public class ByDefense : ByStat
200 {
202 {
203 return cardY.Defense.CompareTo(cardX.Defense);
204 }
205
206 public override string GetDisplayNameKey()
207 {
208 return "BestiaryInfo.Sort_Defense";
209 }
210 }
211
212 public class ByCoins : ByStat
213 {
215 {
216 return cardY.MonetaryValue.CompareTo(cardX.MonetaryValue);
217 }
218
219 public override string GetDisplayNameKey()
220 {
221 return "BestiaryInfo.Sort_Coins";
222 }
223 }
224
225 public class ByHP : ByStat
226 {
228 {
229 return cardY.LifeMax.CompareTo(cardX.LifeMax);
230 }
231
232 public override string GetDisplayNameKey()
233 {
234 return "BestiaryInfo.Sort_HitPoints";
235 }
236 }
237}
IBestiaryUICollectionInfoProvider UIInfoProvider
int Compare(BestiaryEntry x, BestiaryEntry y)
override int Compare(NPCStatsReportInfoElement cardX, NPCStatsReportInfoElement cardY)
override int Compare(NPCStatsReportInfoElement cardX, NPCStatsReportInfoElement cardY)
override int Compare(NPCStatsReportInfoElement cardX, NPCStatsReportInfoElement cardY)
override int Compare(NPCStatsReportInfoElement cardX, NPCStatsReportInfoElement cardY)
int Compare(BestiaryEntry x, BestiaryEntry y)
int Compare(BestiaryEntry x, BestiaryEntry y)
bool IsAStatsCardINeed(IBestiaryInfoElement element)
int Compare(NPCStatsReportInfoElement cardX, NPCStatsReportInfoElement cardY)
int Compare(BestiaryEntry x, BestiaryEntry y)
static Dictionary< int, int > NpcBestiaryRarityStars
static Dictionary< int, NPC > NpcsByNetId
static Dictionary< int, int > NpcBestiarySortingId
static string GetTextValue(string key)
Definition Language.cs:15
bool GetUnlockState(BestiaryUICollectionInfo providedInfo)