Well i don't see the point in coding more than you have to...
Sure this:
public enum Location {
//your pre-definding the value of whatever you need.
AREA_ONE(new Area(3092, 3246, 3095, 3240)),
AREA_TWO (new Area(3215, 9623, 3219, 9620)),
AREA_WHATEVER_YOU WANT (new Area(3207, 3220, 3210, 3216)),
;
//these are the private fields you pre-definded
private Area area;
//constructor add what values you need to pre-define
private Location(Area area){
this.area = area;
}
//these are simple getter methods.
//setter method arent allowed because the values are pre-fined so they are basically static.
public Area getArea(){
return this.area;
}
}
Looks great and all but why when
Area AREA_ONE = new Area(3092, 3246, 3095, 3240);
Area AREA_TWO = new Area(3215, 9623, 3219, 9620);
Area AREA_WHATEVER_YOU_WANT = new Area(3207, 3220, 3210, 3216);
Would do the same thing or even storing it it a lil nooby class like
public class Areas {
static Area AREA_ONE = new Area(3092, 3246, 3095, 3240);
static Area AREA_TWO = new Area(3215, 9623, 3219, 9620);
static Area AREA_WHATEVER_YOU_WANT = new Area(3207, 3220, 3210, 3216);
}
would do the same thing It might just be me being super lazy but i see no point in over complicating the situation
Someone plz enlighten me.