public void DeserializeMultiple_ReturnsMultipleEntities()
        {
            var multipleSerialised = LoadFile("EntityEngineSystem/TestData/ExpectedSerialization_MultipleEntities.txt");

            var entities = EntitySerializer.DeserializeAll(SystemContainer, new[] { multipleSerialised });

            var expected = new List <Entity>
            {
                GetTestEntity(0),
                GetTestEntity(0)
            };

            entities.Should().BeEquivalentTo(expected, options => options.Using(new EntityListEquivalence()));
        }
示例#2
0
        private void SetKeyBindings()
        {
            var keyBindingsData = keyBindingsDataProvider.GetData();

            var bindings = EntitySerializer.DeserializeAll(_systemContainer, keyBindingsData).SingleOrDefault();

            if (bindings != null)
            {
                _keyBindings = bindings.Components.OfType <KeyBinding>().ToList();
            }
            else
            {
                _keyBindings = new List <KeyBinding>();
            }
        }
示例#3
0
        private void LoadEntityData(ISystemContainer systemContainer)
        {
            var worldData = _worldEntityDataProvider.GetData();

            EntitySerializer.DeserializeAll(systemContainer, worldData);
        }