How to configure simple game AI setting with jtable
- by Asgard
I'm developing an application that has methods of this kind:
attackIfIsFar();
protectIfIsNear();
helpAfterDeadOf();
helpBeforeAttackOf();
etc.
The initialization of my application for n players is something like
player1.attackIfIsFar(player2);
player2.protectIfIsNear(player4);
player3.helpAfterDeadOf(player1);
player4.helpBeforeAttackOf(player3);
etc.
I don't know how to configure a jtable that that can allow me to set the equivalent of this code-block
In others words I need simply a way to create a jtable with 3 column and n row, were I can set in the column 1 and 3, the player, and in the central column one of the available methods that each player on the column 1 must invoke on each player of column 3