public void AddLandscape(LandscapeNode landscapeNode) { if (_landscapeNodes == null) { _landscapeNodes = new List <LandscapeNode>(); } _landscapeNodes.Add(landscapeNode); }
public LandscapeJob(Chunk chunk, LandscapeNode node, ILandscapeCreatedListener listener) : base(chunk, node.Id) { _chunk = chunk; _listener = listener; _node = node; _sizeX = chunk.SizeX; _sizeZ = chunk.SizeZ; _heightValuesSizeX = _sizeX + 1 + OverlapBorderWidth * 2; _heightValuesSizeZ = _sizeZ + 1 + OverlapBorderWidth * 2; _requestOffsetX = chunk.X * _sizeX; _requestOffsetZ = chunk.Z * _sizeZ; }
public void StartLandscapeJob(LandscapeNode node) { if (!IsInitialized) { return; } if (_landscapeMeshList == null) { _landscapeMeshList = new Dictionary <int, AbstractGridMesh>(); } if (IsWorkingOnLandscape(node.Id)) { return; } if (_landscapeMeshList.ContainsKey(node.Id)) { return; } LandscapeJob landscapeJob = new LandscapeJob(this, node, this); _landscapeJobQueue.Start(landscapeJob); }