Jump to content
  • Advertisement

Yar

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

Extend vs Implement

Sign in to follow this  
H_o_p_s

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!