Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
GenSearch.cs
Go to the documentation of this file.
2
4
5public abstract class GenSearch : GenBase
6{
7 public static Point NOT_FOUND = new Point(int.MaxValue, int.MaxValue);
8
9 private bool _requireAll = true;
10
12
13 public GenSearch Conditions(params GenCondition[] conditions)
14 {
15 _conditions = conditions;
16 return this;
17 }
18
19 public abstract Point Find(Point origin);
20
21 protected bool Check(int x, int y)
22 {
23 for (int i = 0; i < _conditions.Length; i++)
24 {
25 if (_requireAll ^ _conditions[i].IsValid(x, y))
26 {
27 return !_requireAll;
28 }
29 }
30 return _requireAll;
31 }
32
33 public GenSearch RequireAll(bool mode)
34 {
35 _requireAll = mode;
36 return this;
37 }
38}
GenSearch RequireAll(bool mode)
Definition GenSearch.cs:33
GenSearch Conditions(params GenCondition[] conditions)
Definition GenSearch.cs:13