/*
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

package macampcorp.macamp.utils;

import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;

import macampcorp.macamp.activities.viewers.ImageViewerActivity;
import macampcorp.macamp.activities.viewers.MediaViewerAcitvity;
import macampcorp.macamp.game.Game;
import macampcorp.macamp.game.Resource;

/**
 * Created by ptitcois on 14/03/17.
 */
public class AndroidResources {



    public static Drawable getImage()
    {
        return null;
    }

    public static int getViewerRequestCode( Resource re)
    {
        if(re.isAudio() || re.isVideo())
            return MediaViewerAcitvity.REQUEST_CODE;
        else
            return ImageViewerActivity.REQUEST_CODE;
    }
    public static Intent getViewerIntent(Context c, Resource re)
    {
        return getViewerIntent(c, re, false);
    }


    public static Intent getViewerIntent(Context c, Resource re, boolean autopass)
    {
        Intent intent =null ;
        if(re.isAudio() || re.isVideo())
            intent = new Intent(c, MediaViewerAcitvity.class);
        else if(re.isImage())
            intent= new Intent(c, ImageViewerActivity.class);

        intent.putExtra("resource", re);
        intent.putExtra("autopass", autopass);
        return intent;
    }



    public static Intent getMapIntent(Context c, Game g)
    {
        Intent intent = new Intent(c, ImageViewerActivity.class);
        intent.putExtra("map", g.getName()+"_map");
        return intent;
    }
    //ImageViewerActivity.class
}
