Exemplo n.º 1
0
        public static BasicAssetConfig Extract(FullAssetConfig full)
        {
            var min = new BasicAssetConfig();

            foreach (var kvp in full.Xlds)
            {
                var old    = kvp.Value;
                var newXld = new BasicXldInfo(old);

                foreach (var asset in old.Assets.Values)
                {
                    var newAsset = new BasicAssetInfo(asset)
                    {
                        Parent = newXld
                    };
                    if (newAsset.ContainsData)
                    {
                        newXld.Assets[asset.Id] = newAsset;
                    }
                }

                min.Xlds[kvp.Key] = newXld;
            }

            return(min);
        }
Exemplo n.º 2
0
        public AssetInfo GetAsset(string xldName, int xldSubObject, int id)
        {
            if (!Xlds.TryGetValue(xldName, out var xld))
            {
                return(null);
            }

            if (!xld.Assets.TryGetValue(xldSubObject, out var asset))
            {
                asset = new BasicAssetInfo {
                    Parent = xld, Id = id
                };
                xld.Assets[xldSubObject] = asset;
            }

            return(asset);
        }