Beispiel #1
0
        public void Does_not_support_a_null_dictionary()
        {
            Dictionary <Guid, Vector3> initialBodies = null;

            Assert.Throws <ArgumentNullException>(() =>
            {
                InMemoryBodies.From(initialBodies);
            });
        }
Beispiel #2
0
 public BodiesComponent(
     Dictionary <Guid, float> initialMovementSpeeds,
     Dictionary <Guid, Vector3> initialBodies,
     Dictionary <Guid, GameObject> initialGameObjects)
 {
     movementSpeeds =
         InMemoryMovementSpeeds.From(initialMovementSpeeds);
     bodies      = InMemoryBodies.From(initialBodies);
     gameObjects = InMemoryGameObjects.From(initialGameObjects);
 }
Beispiel #3
0
        private static InMemoryBodies ExistingBodies()
        {
            var entity         = new Guid("eddc06dc-e22f-450b-a270-2c395716d1d9");
            var entityLocation = new Vector3(0.0f, 0.0f, 0.0f);
            var initialBodies  = new Dictionary <Guid, Vector3>
            {
                { entity, entityLocation }
            };

            return(InMemoryBodies.From(initialBodies));
        }
Beispiel #4
0
        public void Includes_those_entries()
        {
            var entity         = new Guid("eddc06dc-e22f-450b-a270-2c395716d1d9");
            var entityLocation = new Vector3(0.0f, 0.0f, 0.0f);
            var body           = Body.ForEntityLocatedAt(
                entity,
                entityLocation);
            var initialBodies = new Dictionary <Guid, Vector3>
            {
                { entity, entityLocation }
            };
            var bodies     = InMemoryBodies.From(initialBodies);
            var actualBody = bodies.BodyForEntity(entity);

            Assert.AreEqual(
                body.Entity,
                actualBody.Entity);
            Assert.AreEqual(
                body.Location,
                actualBody.Location);
        }