Example #1
0
            private void FinishEntitiesLoad()
            {
                foreach (var(entity, data) in _entitiesToDeserialize)
                {
                    CurrentReadingEntityComponents = new Dictionary <string, YamlMappingNode>();
                    if (data.TryGetNode("components", out YamlSequenceNode componentList))
                    {
                        foreach (var compData in componentList)
                        {
                            CurrentReadingEntityComponents[compData["type"].AsString()] = (YamlMappingNode)compData;
                        }
                    }

                    _serverEntityManager.FinishEntityLoad(entity, this);
                }
            }
Example #2
0
            private void FinishEntitiesLoad()
            {
                var entityData = RootNode.GetNode <YamlSequenceNode>("entities");

                foreach (var(entity, data) in Entities.Zip(entityData, (a, b) => (a, (YamlMappingNode)b)))
                {
                    CurrentReadingEntityComponents = new Dictionary <string, YamlMappingNode>();
                    if (data.TryGetNode("components", out YamlSequenceNode componentList))
                    {
                        foreach (var compData in componentList)
                        {
                            CurrentReadingEntityComponents[compData["type"].AsString()] = (YamlMappingNode)compData;
                        }
                    }

                    _serverEntityManager.FinishEntityLoad(entity, this);
                }
            }