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

◆ WallDungeon()

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

Definition at line 529 of file WorldGen.cs.

530 {
531 if (!InWorld(x, y))
532 {
533 return;
534 }
535 ushort num = (ushort)wallType;
539 list2.Add(new Point(x, y));
540 while (list2.Count > 0)
541 {
542 list.Clear();
544 list2.Clear();
545 while (list.Count > 0)
546 {
547 Point item = list[0];
548 if (!InWorld(item.X, item.Y, 1))
549 {
550 list.Remove(item);
551 continue;
552 }
555 Tile tile = Main.tile[item.X, item.Y];
556 if (!SolidTile(item.X, item.Y) && tile.wall != num && tile.wall > 0 && tile.wall != 244)
557 {
558 tile.wall = num;
559 Point item2 = new Point(item.X - 1, item.Y);
560 if (!hashSet.Contains(item2))
561 {
562 list2.Add(item2);
563 }
564 item2 = new Point(item.X + 1, item.Y);
565 if (!hashSet.Contains(item2))
566 {
567 list2.Add(item2);
568 }
569 item2 = new Point(item.X, item.Y - 1);
570 if (!hashSet.Contains(item2))
571 {
572 list2.Add(item2);
573 }
574 item2 = new Point(item.X, item.Y + 1);
575 if (!hashSet.Contains(item2))
576 {
577 list2.Add(item2);
578 }
579 }
580 else if (tile.active())
581 {
582 tile.wall = num;
583 }
584 }
585 }
586 }
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.

Referenced by Terraria.WorldGen.MakeDungeon().