public static DynamicTileBrushCollection FromXProxy(LibraryX.TileBrushCollectionX <LibraryX.DynamicTileBrushX> proxy, TilePoolManager tileManager, DynamicTileBrushClassRegistry registry) { if (proxy == null) { return(null); } return(new DynamicTileBrushCollection(proxy, tileManager, registry)); }
public DynamicTileBrushCollection(LibraryX.TileBrushCollectionX <LibraryX.DynamicTileBrushX> proxy, TilePoolManager tileManager, DynamicTileBrushClassRegistry registry) : base(proxy.Uid, proxy.Name) { if (proxy.Brushes != null) { foreach (var brush in proxy.Brushes) { Brushes.Add(DynamicTileBrush.FromXProxy(brush, tileManager, registry)); } } }
public static DynamicTileBrush FromXProxy(LibraryX.DynamicTileBrushX proxy, TilePoolManager manager, DynamicTileBrushClassRegistry registry) { if (proxy == null) { return(null); } DynamicTileBrush brush = new DynamicTileBrush(proxy, manager, registry); if (brush._brushClass == null) { return(null); } return(brush); }
private DynamicTileBrush(LibraryX.DynamicTileBrushX proxy, TilePoolManager manager, DynamicTileBrushClassRegistry registry) : base(proxy.Uid, proxy.Name, proxy.TileWidth, proxy.TileHeight) { _brushClass = registry.Lookup(proxy.Type); if (_brushClass == null) { return; } _tiles = _brushClass.CreateTileProxyList(); foreach (var entry in proxy.Entries) { TilePool pool = manager.PoolFromItemKey(entry.TileId); if (pool == null) { continue; } SetTile(entry.Slot, pool.GetTile(entry.TileId)); } }
private TileBrushManager(LibraryX.TileBrushGroupX proxy, TilePoolManager tileManager, DynamicTileBrushClassRegistry registry) { _staticBrushCollection = StaticTileBrushCollection.FromXProxy(proxy.StaticBrushes, tileManager); _dynamicBrushCollection = DynamicTileBrushCollection.FromXProxy(proxy.DynamicBrushes, tileManager, registry); Pools.Add(_staticBrushCollection); Pools.Add(_dynamicBrushCollection); }
public static TileBrushManager FromXProxy(LibraryX.TileBrushGroupX proxy, TilePoolManager tileManager, DynamicTileBrushClassRegistry registry) { if (proxy == null) { return(null); } return(new TileBrushManager(proxy, tileManager, registry)); }