private static void LoadGridNode(IMapManager mapMan, IMap map, ref GridId?newId, YamlMappingNode gridNode)
        {
            var info  = (YamlMappingNode)gridNode["settings"];
            var chunk = (YamlSequenceNode)gridNode["chunks"];

            YamlGridSerializer.DeserializeGrid(mapMan, map, ref newId, info, chunk);
        }
Exemple #2
0
            void WriteGridSection()
            {
                var grids = new YamlSequenceNode();

                RootNode.Add("grids", grids);

                foreach (var grid in Grids)
                {
                    var entry = YamlGridSerializer.SerializeGrid(grid);
                    grids.Add(entry);
                }
            }
        private YamlSequenceNode SaveBpNode(IMapGrid grid)
        {
            var root = new YamlSequenceNode();

            var node = YamlGridSerializer.SerializeGrid(grid);

            root.Add(node);

            var ents = new YamlEntitySerializer();

            _entityMan.SaveGridEntities(ents, grid.Index);
            root.Add(ents.GetRootNode());
            return(root);
        }
Exemple #4
0
            void ReadGridSection()
            {
                var grids  = RootNode.GetNode <YamlSequenceNode>("grids");
                var mapMan = IoCManager.Resolve <IMapManager>();

                foreach (var grid in grids)
                {
                    var newId = new GridId?();
                    YamlGridSerializer.DeserializeGrid(
                        mapMan, TargetMap, ref newId,
                        (YamlMappingNode)grid["settings"],
                        (YamlSequenceNode)grid["chunks"]
                        );

                    Grids.Add(mapMan.GetGrid(newId.Value));
                }
            }
Exemple #5
0
            void ReadGridSection()
            {
                var grids = RootNode.GetNode <YamlSequenceNode>("grids");

                foreach (var grid in grids)
                {
                    var newId = new GridId?();
                    YamlGridSerializer.DeserializeGrid(
                        _mapManager, TargetMap, ref newId,
                        (YamlMappingNode)grid["settings"],
                        (YamlSequenceNode)grid["chunks"],
                        _tileMap,
                        _tileDefinitionManager
                        );

                    Grids.Add(_mapManager.GetGrid(newId.Value));
                }
            }