Example #1
0
            public void MultipleEntitiesAutoDefinedGetSameNumber()
            {
                Map collapsed = Map.Collapse();

                MapObject spikeface = collapsed.MapObjects.Find(o =>
                                                                o.Definition.ClassName == "monster_demon1" &&
                                                                MathUtilities.ApproximatelyEquivalent(
                                                                    o.Position, new Vector3(512, 128, 0), Tolerance));

                MapObject blobbie = collapsed.MapObjects.Find(o =>
                                                              o.Definition.ClassName == "monster_tarbaby" &&
                                                              MathUtilities.ApproximatelyEquivalent(
                                                                  o.Position, new Vector3(640, 0, 0), Tolerance));

                MapObject fishlips = collapsed.MapObjects.Find(o =>
                                                               o.Definition.ClassName == "monster_fish" &&
                                                               MathUtilities.ApproximatelyEquivalent(
                                                                   o.Position, new Vector3(512, -128, 0), Tolerance));

                string actualNameSpikeface = spikeface.KeyVals["targetname"].Value;
                string actualNameBlobbie   = blobbie.KeyVals["targetname"].Value;
                string actualNameFishlips  = fishlips.KeyVals["targetname"].Value;

                Assert.Multiple(() =>
                {
                    Assert.That(actualNameSpikeface, Is.EqualTo("AutoInstance3spikeface"));
                    Assert.That(actualNameBlobbie, Is.EqualTo("AutoInstance3blobbie"));
                    Assert.That(actualNameFishlips, Is.EqualTo("AutoInstance3fishlips"));
                });
            }
Example #2
0
            public void UserDefinedPrefix()
            {
                Map collapsed = Map.Collapse();

                MapObject light = collapsed.MapObjects.Find(o =>
                                                            o.Definition.ClassName == "light" &&
                                                            MathUtilities.ApproximatelyEquivalent(
                                                                o.Position, new Vector3(64, -64, 64), Tolerance));

                string actualName = light.KeyVals["targetname"].Value;

                Assert.That(actualName, Is.EqualTo("APrefixFor-MyFunnyTargetname"));
            }