package app.mar.game.challenges;

import android.app.Activity;

import org.json.JSONException;
import org.json.JSONObject;

import app.mar.activities.QRCodeFragment;
import app.mar.game.Game;
import app.mar.game.Resource;

public class QRCodeTreasure extends Treasure {

    protected String mQRValue;
    protected String mBadQRMessage;
    protected String mComment;


    public static final int REQUEST_CODE=2003;

    public int getResultCode() { return REQUEST_CODE; }

    public QRCodeTreasure(Game g, JSONObject root, Activity a) {
        super(g, root, QRCodeFragment.class, a);

        try {
            mQRValue = root.getString("qr_value");
            mBadQRMessage = root.getString("bad_message");

        } catch (JSONException e) {
            e.printStackTrace();
        }

        try {
            mComment = root.getString("comment");
        }catch(JSONException e)
        {
            mComment="Retrouvez un QR Code proche de cet endroit";
        }
    }


    public String getQRValue() {
        return mQRValue;
    }
    public String getBadQRMessage() {
        return mBadQRMessage;
    }
}
