/// <summary> /// /// </summary> /// <param name="continent"></param> /// <param name="x"></param> /// <param name="y"></param> /// <param name="padding">You can pad from 0 up to an mcnk sized strip around the adt.</param> /// <returns></returns> public Scene BuildTile(string continent, int x, int y, float padding = MapChunk.TileSize) { var chunkBuilder = new ChunkBuilder(GetLiquidMaterialProperties); var doodadBuilder = new DoodadBuilder(_files); var wmoBuilder = new WmoBuilder(_files, doodadBuilder, GetLiquidMaterialProperties); var terrain = new List <SceneObject>(); var liquids = new List <SceneObject>(); var doodads = new List <SceneObject>(); var wmos = new List <SceneObject>(); var centerAdt = _files.GetAdt(continent, x, y); var bounds = GetSceneBounds(centerAdt, padding); foreach (var p in AdtRegion(continent, x, y)) { var curX = (int)p.X; var curY = (int)p.Y; var adt = _files.GetAdt(continent, curX, curY); terrain.AddRange(chunkBuilder.BuildTerrain(adt, bounds)); liquids.AddRange(chunkBuilder.BuildLiquid(adt, bounds)); doodads.AddRange(doodadBuilder.BuildDoodads(DefinedDoodads(adt), adt.DoodadReferences, bounds)); var wmoResults = wmoBuilder.BuildWmos(DefinedWmos(adt), adt.WmoReferences, bounds); wmos.AddRange(wmoResults.GroupObjects); doodads.AddRange(wmoResults.Doodads); liquids.AddRange(wmoResults.Liquids); } return(MergeIntoScene(centerAdt, terrain, liquids, doodads, wmos)); }
/// <summary> /// /// </summary> /// <param name="continent"></param> /// <param name="x"></param> /// <param name="y"></param> /// <param name="padding">You can pad from 0 up to an mcnk sized strip around the adt.</param> /// <returns></returns> public Scene BuildTile(string continent, int x, int y, float padding = MapChunk.TileSize) { var chunkBuilder = new ChunkBuilder(GetLiquidMaterialProperties); var doodadBuilder = new DoodadBuilder(_files); var wmoBuilder = new WmoBuilder(_files, doodadBuilder, GetLiquidMaterialProperties); var terrain = new List<SceneObject>(); var liquids = new List<SceneObject>(); var doodads = new List<SceneObject>(); var wmos = new List<SceneObject>(); var centerAdt = _files.GetAdt(continent, x, y); var bounds = GetSceneBounds(centerAdt, padding); foreach (var p in AdtRegion(continent, x, y)) { var curX = (int)p.X; var curY = (int)p.Y; var adt = _files.GetAdt(continent, curX, curY); terrain.AddRange(chunkBuilder.BuildTerrain(adt, bounds)); liquids.AddRange(chunkBuilder.BuildLiquid(adt, bounds)); doodads.AddRange(doodadBuilder.BuildDoodads(DefinedDoodads(adt), adt.DoodadReferences, bounds)); var wmoResults = wmoBuilder.BuildWmos(DefinedWmos(adt), adt.WmoReferences, bounds); wmos.AddRange(wmoResults.GroupObjects); doodads.AddRange(wmoResults.Doodads); liquids.AddRange(wmoResults.Liquids); } return MergeIntoScene(centerAdt, terrain, liquids, doodads, wmos); }
public WmoBuilder(FilePool files, DoodadBuilder doodadBuilder, Func<int, MaterialFlags> getLiquidMaterial) : base(files) { _doodadBuilder = doodadBuilder; _getLiquidMaterial = getLiquidMaterial; }
public WmoBuilder(FilePool files, DoodadBuilder doodadBuilder, Func <int, MaterialFlags> getLiquidMaterial) : base(files) { _doodadBuilder = doodadBuilder; _getLiquidMaterial = getLiquidMaterial; }