OK so I thought I get some input here since I honestly I have a small infantile knowledge of the Java language (I'm learning as I go). Without giving out too much info, the game is in short a "Mega Man Chip Challenge" or basically an RPG-Like game that uses cards. I was wonder how I should go about implementing the cards...I believe making a class for the cards is the only way to go about it. Each card knows general info about itself, but in battle they can carry out a wide variety of actions.....I was thinking having a method that can read the cards ID number and thus, using a crap ton of else if statements, perform the required actions. I guess what I want to know is basically if there is an easier way to go about the entire thing. Any suggestions?
You are indeed missing the whole point of OOP design... but this is the perfect problem to help you grasp it. You shouldn't be using conditions to implement each card's behavior, instead...
1.) Make an abstract class called Card which contains all of the code that all cards share in common. Abstract classes cannot be instantiated but they can be extended by other classes.
2.) Now make a class for each type of card you want in your game, and have each one extend the Card class. Your subclasses will inherit all of the implemented methods of the parent "Card" class.
3.) Now, put an abstract method in the Card class, such as "doActions". Notice that this prevents your child classes from compiling... abstract methods must be implemented by child classes.
4.) Have each one of the child classes override "doActions"... this is where you can specify the individual behaviors of each card.
Now, whenever you have a variable of type Card, you can store any of the child classes of Card inside of it. You can even store all of your cards in an ArrayList<Card> (or any other generic container class), no matter which type of card it is.
You can call card.doActions() and it will perform the appropriate actions for whichever type of card it is. Try testing it out with debug messages.