Exemplo n.º 1
0
        private void CalculateFOV()
        {
            if (CurrentMap == null || MapHelper.FogMap == null)
            {
                return;                                                 // failsafe, should not occur
            }
            foreach (var cell in CurrentMap.FOV.CurrentFOV)
            {
                MapHelper.FogMap.SetCell(cell.X, cell.Y, 1);
            }

            CurrentMap.CalculateFOV(MapPosition.ToCoord(), 30);
            MapHelper.PlayerFOV = CurrentMap.FOV.CurrentFOV.ToList();

            foreach (var cell in CurrentMap.FOV.CurrentFOV)
            {
                MapHelper.FogMap.SetCell(cell.X, cell.Y, -1);
            }
        }