Jump to content
JS3

Using Strings and Ints from Enums

Recommended Posts

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!

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing   0 members

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