TerrainDisplay.MPQ.MpqTerrainManager.CalcIntArraySize C# (CSharp) Method

CalcIntArraySize() private method

private CalcIntArraySize ( bool includeTerrain, bool includeLiquid, bool includeWMO, bool includeM2 ) : int
includeTerrain bool
includeLiquid bool
includeWMO bool
includeM2 bool
return int
        private int CalcIntArraySize(bool includeTerrain, bool includeLiquid, bool includeWMO, bool includeM2)
        {
            var count = 0;
            List<int> renderIndices;
            for (var t = 0; t < _adtManager.MapTiles.Count; t++)
            {
                var tile = _adtManager.MapTiles[t];
                if (includeTerrain)
                {
                    renderIndices = tile.Indices;
                    if (renderIndices != null)
                    {
                        count += renderIndices.Count;
                    }
                }

                if (includeLiquid)
                {
                    renderIndices = tile.LiquidIndices;
                    if (renderIndices == null) continue;
                    count += renderIndices.Count;
                }
            }

            // Get the WMO triangles
            if (includeWMO)
            {

                renderIndices = _wmoManager.WmoIndices;
                if (renderIndices != null)
                {
                    count += renderIndices.Count;
                }
            }

            // Get the M2 triangles
            if (includeM2)
            {
                renderIndices = _m2Manager.RenderIndices;
                if (renderIndices != null)
                {
                    count += renderIndices.Count;
                }
            }

            return count;
        }