Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Passes.cs
Go to the documentation of this file.
1using Terraria.IO;
2
4
5public static class Passes
6{
7 public class Clear : GenPass
8 {
9 public Clear()
10 : base("clear", 1.0)
11 {
12 }
13
14 protected override void ApplyPass(GenerationProgress progress, GameConfiguration configuration)
15 {
16 for (int i = 0; i < GenBase._worldWidth; i++)
17 {
18 for (int j = 0; j < GenBase._worldHeight; j++)
19 {
20 if (GenBase._tiles[i, j] == null)
21 {
22 GenBase._tiles[i, j] = new Tile();
23 }
24 else
25 {
26 GenBase._tiles[i, j].ClearEverything();
27 }
28 }
29 }
30 }
31 }
32
33 public class ScatterCustom : GenPass
34 {
35 private CustomPerUnitAction _perUnit;
36
37 private int _count;
38
39 public ScatterCustom(string name, double loadWeight, int count, CustomPerUnitAction perUnit = null)
40 : base(name, loadWeight)
41 {
42 _perUnit = perUnit;
43 _count = count;
44 }
45
46 public void SetCustomAction(CustomPerUnitAction perUnit)
47 {
48 _perUnit = perUnit;
49 }
50
51 protected override void ApplyPass(GenerationProgress progress, GameConfiguration configuration)
52 {
53 int num = _count;
54 while (num > 0)
55 {
57 {
58 num--;
59 }
60 }
61 }
62 }
63}
static UnifiedRandom _random
Definition GenBase.cs:9
override void ApplyPass(GenerationProgress progress, GameConfiguration configuration)
Definition Passes.cs:14
void SetCustomAction(CustomPerUnitAction perUnit)
Definition Passes.cs:46
override void ApplyPass(GenerationProgress progress, GameConfiguration configuration)
Definition Passes.cs:51
ScatterCustom(string name, double loadWeight, int count, CustomPerUnitAction perUnit=null)
Definition Passes.cs:39