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

◆ Wall()

static void Terraria.WorldGen.Spread.Wall ( int x,
int y,
int wallType )
inlinestatic

Definition at line 104 of file WorldGen.cs.

105 {
106 if (!InWorld(x, y))
107 {
108 return;
109 }
110 ushort wall = (ushort)wallType;
114 list2.Add(new Point(x, y));
115 while (list2.Count > 0)
116 {
117 list.Clear();
119 list2.Clear();
120 while (list.Count > 0)
121 {
122 Point item = list[0];
123 if (!InWorld(item.X, item.Y, 1))
124 {
125 list.Remove(item);
126 continue;
127 }
130 Tile tile = Main.tile[item.X, item.Y];
131 if (SolidTile(item.X, item.Y) || tile.wall != 0)
132 {
133 if (tile.active() && tile.wall == 0)
134 {
135 tile.wall = wall;
136 }
137 continue;
138 }
139 tile.wall = wall;
140 Point item2 = new Point(item.X - 1, item.Y);
141 if (!hashSet.Contains(item2))
142 {
143 list2.Add(item2);
144 }
145 item2 = new Point(item.X + 1, item.Y);
146 if (!hashSet.Contains(item2))
147 {
148 list2.Add(item2);
149 }
150 item2 = new Point(item.X, item.Y - 1);
151 if (!hashSet.Contains(item2))
152 {
153 list2.Add(item2);
154 }
155 item2 = new Point(item.X, item.Y + 1);
156 if (!hashSet.Contains(item2))
157 {
158 list2.Add(item2);
159 }
160 }
161 }
162 }
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void AddRange(IEnumerable< KeyValuePair< TKey, TValue > > collection)
void Add(TKey key, TValue value)
static bool InWorld(int x, int y, int fluff=0)
Definition WorldGen.cs:5816

References Terraria.Tile.active(), System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.AddRange(), System.Collections.Generic.Dictionary< TKey, TValue >.Clear(), System.Collections.Generic.Dictionary< TKey, TValue >.Contains(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, Terraria.WorldGen.InWorld(), System.item, System.list, System.Collections.Generic.Dictionary< TKey, TValue >.Remove(), Terraria.Enums.SolidTile, Terraria.Main.tile, and Terraria.Tile.wall.