I have decided to convert to a cleaner programming style, (code re-usability)
Thus, I am relearning class structure and inheritance/polymorphism and all the great protection and clarity they provide
My program in many ways will be like a chess game program.
Opening.JPG
Everything inside a JFrame
The JFrame will be split into 2 JPanels.
The only other objects will be mini JPanels I will call Pieces.
DescribingParts.JPG
These Pieces are mouse drag and drop-able between JPanels
DescribingInteraction.JPG
Breaking bad habits begins here.
I will have a Pieces Class.
Pieces will be a parent Class to two children Classes that extend it. (names not important yet)
I will be making a "Movable Class"
Movable Class will handle the graphics and mobility of my "mini panels"
Movables will be an Interface and Pieces will use this Interface.
Skeleton code of how this all looks would be an amazing and appreciated gift!
Things I think I know.
child1 extends Pieces and child2 extends Pieces
Pieces Implements Movable ?
then this will force Pieces and all children of Pieces to have the methods from Movable correct?
Hope I am correct so far,
The next part gets more confusing for me, mostly because I am very new to GUI's
I am assuming I have another class which will probably use the program name
"BattleGrid" BattleGrid will have the main method, as well as most of the GUI framework? (calling, creating, and storing Pieces as needed) please set me strait here.
Thanks a lot for any involvement!
Jonathan