I'm having problems trying to get the index of a specific item from a 2D int array in Java.
So here's what I have ...
private int[][] mobPoints = {
{9300127,2},{9300128,2},{9300129,2},{9300130,3},{9300131,3},
{9300132,3},{9300133,3},{9300134,4},{9300135,4},{9300136,5}};
The first number in each of the arrays is the mob identification number, and the second number is the number of points it's worth. How I want it to work is when a player kills a mob, the server detects that and sends it through a method that increments a variable with the amount of points the mob is worth. Example:
public void addPoints(int mobid) {
}
What I'm having trouble doing is using the given mobid and retrieving the value it is worth. I don't want to use HashMaps or ArrayLists because I can't seem to predefine them (I have to create a new ArrayList and then add each and every value upon creation).