CNCMaps.Engine.Map.Map.RedrawOreAndGems C# (CSharp) Метод

RedrawOreAndGems() публичный Метод

public RedrawOreAndGems ( ) : void
Результат void
        public void RedrawOreAndGems()
        {
            var tileCollection = _theater.GetTileCollection();
            var checkFunc = new Func<OverlayObject, bool>(delegate (OverlayObject ovl) { return SpecialOverlays.GetOverlayTibType(ovl, Engine) != OverlayTibType.NotSpecial; });

            // first redraw all required tiles (zigzag method)
            for (int y = 0; y < FullSize.Height; y++) {
                for (int x = FullSize.Width * 2 - 2; x >= 0; x -= 2) {
                    if (_tiles[x, y].AllObjects.OfType<OverlayObject>().Any(checkFunc))
                        _theater.Draw(_tiles.GetTile(x, y), _drawingSurface);
                }
                for (int x = FullSize.Width * 2 - 3; x >= 0; x -= 2) {
                    if (_tiles[x, y].AllObjects.OfType<OverlayObject>().Any(checkFunc))
                        _theater.Draw(_tiles.GetTile(x, y), _drawingSurface);
                }
            }
            for (int y = 0; y < FullSize.Height; y++) {
                for (int x = FullSize.Width * 2 - 2; x >= 0; x -= 2) {
                    if (_tiles[x, y].AllObjects.OfType<OverlayObject>().Any(checkFunc)) {
                        List<GameObject> objs = GetObjectsAt(x, y);
                        foreach (GameObject o in objs)
                            _theater.Draw(o, _drawingSurface);
                    }
                }
                for (int x = FullSize.Width * 2 - 3; x >= 0; x -= 2) {
                    if (_tiles[x, y].AllObjects.OfType<OverlayObject>().Any(checkFunc)) {
                        List<GameObject> objs = GetObjectsAt(x, y);
                        foreach (GameObject o in objs)
                            _theater.Draw(o, _drawingSurface);
                    }
                }
            }
        }