Jump to content

Using Strings and Ints from Enums


Recommended Posts

Posted

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!

 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...