Пример #1
0
        public void SupportsAddingAndRemovingEntities()
        {
            var map = new Map2D <float>(16, 16);

            var oldBoot = new Entity {
                Name = "Old Boot"
            };

            map.PutEntity(1, 1, oldBoot);

            Assert.That(map.GetEntitiesAt(1, 1).Any());
            Assert.That(oldBoot.X == 1 && oldBoot.Y == 1);

            map.RemoveEntity(oldBoot);
            Assert.That(map.GetEntitiesAt(1, 1).Any() == false);

            // After removing, items have null coordinates.
            Assert.That(oldBoot.X == null);
            Assert.That(oldBoot.Y == null);
            Assert.That(oldBoot.Z == null);
        }