Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AnchoredEntitiesCollection.cs
Go to the documentation of this file.
3
5
7{
8 private struct IndexPointPair
9 {
10 public int index;
11
12 public Point coords;
13 }
14
16
18
20
26
27 public void ClearNPCAnchors()
28 {
30 }
31
32 public void ClearPlayerAnchors()
33 {
35 }
36
37 public void AddNPC(int npcIndex, Point coords)
38 {
40 {
41 index = npcIndex,
42 coords = coords
43 });
44 }
45
47 {
48 return GetEntitiesInCoords(coords);
49 }
50
52 {
55 {
56 index = playerIndex,
57 coords = coords
58 });
59 }
60
61 private int GetEntitiesInCoords(Point coords)
62 {
63 int num = 0;
64 for (int i = 0; i < _anchoredNPCs.Count; i++)
65 {
66 if (_anchoredNPCs[i].coords == coords)
67 {
68 num++;
69 }
70 }
71 for (int j = 0; j < _anchoredPlayers.Count; j++)
72 {
73 if (_anchoredPlayers[j].coords == coords)
74 {
75 num++;
76 }
77 }
78 return num;
79 }
80}
void Add(TKey key, TValue value)
void AddPlayerAndGetItsStackedIndexInCoords(int playerIndex, Point coords, out int stackedIndexInCoords)