public void setViewOnTank(thegame.model.ModelPlayer player) {
        for (ModelObject o : model) {
            if (o instanceof Tank) {
                Tank tank = (Tank) o;
                if (tank.getPlayer().equals(player)) {
                    this.currentWindowX = tank.getX() - GameData.WINDOW_WIDTH / 2;
                    this.currentWindowY = tank.getY() - GameData.WINDOW_HEIGTH / 2;
                }
            }
        }

        if (currentWindowY < 0) {
            currentWindowY = 0;
        }
        if (currentWindowY > GameData.GAME_HEIGTH - GameData.WINDOW_HEIGTH) {
            currentWindowY = GameData.GAME_HEIGTH - GameData.WINDOW_HEIGTH;
        }

        if (currentWindowX < 0) {
            this.currentWindowX = 0;
        }
        if (currentWindowX > GameData.GAME_WIDTH - GameData.WINDOW_WIDTH) {
            currentWindowX = GameData.GAME_WIDTH - GameData.WINDOW_WIDTH;
        }
        
    }