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

◆ Perform()

override bool Terraria.WorldBuilding.Shapes.Mound.Perform ( Point origin,
GenAction action )
inline

Definition at line 206 of file Shapes.cs.

207 {
208 _ = _height;
209 double num = _halfWidth;
210 for (int i = -_halfWidth; i <= _halfWidth; i++)
211 {
212 int num2 = Math.Min(_height, (int)((0.0 - (double)(_height + 1) / (num * num)) * ((double)i + num) * ((double)i - num)));
213 for (int j = 0; j < num2; j++)
214 {
215 if (!UnitApply(action, origin, i + origin.X, origin.Y - j) && _quitOnFail)
216 {
217 return false;
218 }
219 }
220 }
221 return true;
222 }
static byte Min(byte val1, byte val2)
Definition Math.cs:912
bool UnitApply(GenAction action, Point origin, int x, int y, params object[] args)
Definition GenShape.cs:13

References Terraria.WorldBuilding.Shapes.Mound._halfWidth, Terraria.WorldBuilding.Shapes.Mound._height, Terraria.WorldBuilding.GenShape._quitOnFail, System.action, System.Math.Min(), Terraria.WorldBuilding.GenShape.UnitApply(), Microsoft.Xna.Framework.Point.X, and Microsoft.Xna.Framework.Point.Y.