|
|
@@ -72,6 +72,7 @@ namespace TechbloxModdingAPI.Blocks |
|
|
|
public static IEnumerator<TaskContract> TestBlockProperties() |
|
|
|
{ //Uses the result of the previous test case |
|
|
|
var blocks = Game.CurrentGame().GetBlocksInGame(); |
|
|
|
yield return Yield.It; |
|
|
|
for (var index = 0; index < blocks.Length; index++) |
|
|
|
{ |
|
|
|
if (index % 50 == 0) yield return Yield.It; //The material or flipped status can only be changed 130 times per submission |
|
|
@@ -140,8 +141,8 @@ namespace TechbloxModdingAPI.Blocks |
|
|
|
Block newBlock = Block.PlaceNew(BlockIDs.DampedSpring, Unity.Mathematics.float3.zero + 1); |
|
|
|
DampedSpring b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler |
|
|
|
Assert.Errorless(() => { b = (DampedSpring) newBlock; }, "Casting block to DampedSpring raised an exception: ", "Casting block to DampedSpring completed without issue."); |
|
|
|
if (!Assert.CloseTo(b.Stiffness, 30f, $"DampedSpring.Stiffness {b.Stiffness} does not equal default value, possibly because it failed silently.", "DampedSpring.Stiffness is close enough to default.")) return; |
|
|
|
if (!Assert.CloseTo(b.Damping, 30f, $"DampedSpring.Damping {b.Damping} does not equal default value, possibly because it failed silently.", "DampedSpring.Damping is close enough to default.")) return; |
|
|
|
if (!Assert.CloseTo(b.Stiffness, 1f, $"DampedSpring.Stiffness {b.Stiffness} does not equal default value, possibly because it failed silently.", "DampedSpring.Stiffness is close enough to default.")) return; |
|
|
|
if (!Assert.CloseTo(b.Damping, 0.1f, $"DampedSpring.Damping {b.Damping} does not equal default value, possibly because it failed silently.", "DampedSpring.Damping is close enough to default.")) return; |
|
|
|
if (!Assert.CloseTo(b.MaxExtension, 0.3f, $"DampedSpring.MaxExtension {b.MaxExtension} does not equal default value, possibly because it failed silently.", "DampedSpring.MaxExtension is close enough to default.")) return; |
|
|
|
} |
|
|
|
|
|
|
|