OpenRA.Map.UpdateProjection C# (CSharp) Method

UpdateProjection() public method

public UpdateProjection ( CPos cell ) : void
cell CPos
return void
        void UpdateProjection(CPos cell)
        {
            MPos uv;

            if (Grid.MaximumTerrainHeight == 0)
            {
                uv = cell.ToMPos(Grid.Type);
                cellProjection[cell] = new[] { (PPos)uv };
                var inverse = inverseCellProjection[uv];
                inverse.Clear();
                inverse.Add(uv);
                return;
            }

            if (!initializedCellProjection)
                InitializeCellProjection();

            uv = cell.ToMPos(Grid.Type);

            // Remove old reverse projection
            foreach (var puv in cellProjection[uv])
                inverseCellProjection[(MPos)puv].Remove(uv);

            var projected = ProjectCellInner(uv);
            cellProjection[uv] = projected;

            foreach (var puv in projected)
                inverseCellProjection[(MPos)puv].Add(uv);
        }