JS3 Posted August 30, 2018 Share Posted August 30, 2018 Hi Guys, I have been expanding on using Enum for storing multiple points of data, but I am unsure how to call upon certain aspects of them to use. Also @Explv, I see you commonly recommend this when others post, so thank you for explaining in other peoples threads. public enum BoatOptions { NOVICE("Novice", 40, new Area(1, 2, 3, 4), 3), INTERMEDIATE("Intermediate", 70, new Area(2, 3, 4, 5), 4), VETERAN("Veteran", 100, new Area(3,4,5,6), 5); String name; int levelRequired; Area area; int pointBonus; BoatOptions(final String name, final int levelRequired, final Area area, final int pointBonus){ this.name = name; this.levelRequired = levelRequired; this.area = area; this.pointBonus = pointBonus; } @Override public boolean toString(){ return name; } public int getLevelRequired() { return levelRequired; } public int getPointBonus() { return pointBonus; } } I want to set up a few methods based on the BoatOptions. Obvious examples are, area for walking to, pointBonus to display the number of PC points and I was planning to make the bot choose the best boat based on combat level. I'm sure it's simple but I am confused. Any help is appreciated! Quote Link to comment Share on other sites More sharing options...
Chris Posted August 30, 2018 Share Posted August 30, 2018 BoatOptions.NOVICE.getPointsBonus(); or private BoatOptions opt; onStart(){ gui sets option opt = BoatOptions.NOVICE; //can now access getters/setters that are public opt.getBonusPoints(); opt.getLevelReq(); } 1 Quote Link to comment Share on other sites More sharing options...
JS3 Posted August 30, 2018 Author Share Posted August 30, 2018 Thanks, @Chris !! 1 Quote Link to comment Share on other sites More sharing options...