package com.rs.utils;

import java.io.BufferedReader;
import java.io.FileReader;

public class GEPrices {
    
    private static char[] id;

    public static int getGrandExchangePrice() {
	try (BufferedReader buf = new BufferedReader(new FileReader("./data/items/prices.json"))) {
	    String line;
	    while ((line = buf.readLine()) != null) {

		String[] regex = line.split("=:");
		if (line.startsWith(String.valueOf(id))) {
		    int itemValue = Integer.valueOf(regex[1].replace(" ", "")); // accidently added a space when I was dumping
		    return itemValue;
		}
	    }
	    buf.close();
	} catch (Exception ex) {
	    ex.printStackTrace();
	}
	return getPrice();
    }

    private static int getPrice() {
	// TODO Auto-generated method stub
	return 0;
    }

	public static final void init() {
	    getGrandExchangePrice();
	}
}