Jump to content

Yar

Sign in to follow this  
  • entries
    208
  • comments
    383
  • views
    65971

Extend vs Implement

Sign in to follow this  
H_o_p_s

92 views

For my event system I have a base class that looks like this:

public class jtEvent {

private JavaTactics j;//HERE FOR REFERENCE
public int ID;//ID CONFIGURED BY THE TRACKER

public jtEvent(JavaTactics j, int id) {
this.j = j;
this.ID = id;
}

public void activate() {
j.log.add("Activated Event: "+this.ID);
}

}




And then when I want to create a new event I just extend it and overwrite the activate() method. However if I made this an abstract class I could just write this as an abstract class and implement it in each of the events that I want to use it on.

SO, what should I use? Extend the jtEvent class or make it an abstract class?
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

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
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!