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

◆ Moss()

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

Definition at line 274 of file WorldGen.cs.

275 {
276 if (!InWorld(x, y))
277 {
278 return;
279 }
280 ushort mossWall = GenVars.mossWall;
281 ushort mossTile = GenVars.mossTile;
285 list2.Add(new Point(x, y));
286 while (list2.Count > 0)
287 {
288 list.Clear();
290 list2.Clear();
291 while (list.Count > 0)
292 {
293 Point item = list[0];
294 if (!InWorld(item.X, item.Y, 1))
295 {
296 list.Remove(item);
297 continue;
298 }
301 Tile tile = Main.tile[item.X, item.Y];
302 if (SolidTile(item.X, item.Y) || tile.wall != 0)
303 {
304 if (tile.active())
305 {
306 if (tile.wall == 0)
307 {
308 tile.wall = mossWall;
309 }
310 if (tile.type == 1)
311 {
312 tile.type = mossTile;
313 }
314 }
315 continue;
316 }
317 tile.wall = mossWall;
318 Point item2 = new Point(item.X - 1, item.Y);
319 if (!hashSet.Contains(item2))
320 {
321 list2.Add(item2);
322 }
323 item2 = new Point(item.X + 1, item.Y);
324 if (!hashSet.Contains(item2))
325 {
326 list2.Add(item2);
327 }
328 item2 = new Point(item.X, item.Y - 1);
329 if (!hashSet.Contains(item2))
330 {
331 list2.Add(item2);
332 }
333 item2 = new Point(item.X, item.Y + 1);
334 if (!hashSet.Contains(item2))
335 {
336 list2.Add(item2);
337 }
338 }
339 }
340 }
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, Terraria.WorldBuilding.GenVars.mossTile, Terraria.WorldBuilding.GenVars.mossWall, System.Collections.Generic.Dictionary< TKey, TValue >.Remove(), Terraria.Enums.SolidTile, Terraria.Main.tile, Terraria.Tile.type, and Terraria.Tile.wall.