Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TileDrawSorter.cs
Go to the documentation of this file.
1using System;
3
5
6public class TileDrawSorter
7{
8 public struct TileTexPoint
9 {
10 public int X;
11
12 public int Y;
13
14 public int TileType;
15
16 public override string ToString()
17 {
18 return $"X:{X}, Y:{Y}, Type:{TileType}";
19 }
20 }
21
22 public class CustomComparer : Comparer<TileTexPoint>
23 {
24 public override int Compare(TileTexPoint x, TileTexPoint y)
25 {
26 return x.TileType.CompareTo(y.TileType);
27 }
28 }
29
31
32 private int _holderLength;
33
34 private int _currentCacheIndex;
35
37
39 {
41 _holderLength = 9000;
43 }
44
45 public void reset()
46 {
48 }
49
50 public void Cache(int x, int y, int type)
51 {
52 int num = _currentCacheIndex++;
53 tilesToDraw[num].X = x;
54 tilesToDraw[num].Y = y;
57 {
59 }
60 }
61
62 private void IncreaseArraySize()
63 {
64 _holderLength *= 2;
66 }
67
68 public void Sort()
69 {
71 }
72
73 public int GetAmountToDraw()
74 {
75 return _currentCacheIndex;
76 }
77}
static void Sort(Array array)
Definition Array.cs:2329
override int Compare(TileTexPoint x, TileTexPoint y)
void Cache(int x, int y, int type)