Jump to content

ExperienceTable Class / snippet


Botre

Recommended Posts

Because I decided that's where that inheritance branch should end ph34r.png

There's no need for it to been extendable.

 

 

Making a class final really just makes it unextendable ^^

And there's no need for it not to be? I could think of plenty of methods/properties to add, making a class final should only be done when it's absolutely critical that nothing be overriden/extended for the functionality of the class to stay intact (which isn't the case here).

Link to comment
Share on other sites

And there's no need for it not to be? I could think of plenty of methods/properties to add, making a class final should only be done when it's absolutely critical that nothing be overriden/extended for the functionality of the class to stay intact (which isn't the case here).

 

What kind of methods/properties would justify an extended class instead of just adding them to this one? I make my classes immutable and final by default, only making them mutable / extendable when it's absolutely necessary.

Link to comment
Share on other sites

And there's no need for it not to be? I could think of plenty of methods/properties to add, making a class final should only be done when it's absolutely critical that nothing be overriden/extended for the functionality of the class to stay intact (which isn't the case here).

he didn't make all the methods final so we can still override ph34r.png

only the table generation cant be overriden because it's private

 

RSExperienceTable table = new RSExperienceTable() {

 

public int getXp(int level) {

        return 1337;

    }

 

}

Edited by VladBots
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...