![]() |
MAK RTIspy API Documentation for HLA 1516
|
The Class ShotManager. More...
Collaboration diagram for controllers.ShotManager:Public Member Functions | |
| ShotManager () | |
| Instantiates a new shot manager. | |
| void | addNewShot (Shot shot) |
| Adds the new shot. | |
| void | removeShot (Shot shot, E_Alignment alignment) |
| Removes the shot. | |
| void | removeShotFromUI (Shot shot) |
| Removes the shot from ui. | |
| void | incrementAllShots (E_Alignment alignment, Board board) |
| This basically moves all shots in the system that belong to the current player. | |
| ConcurrentHashMap< UUID, Shot > | getShotList () |
| Gets the shot list. | |
| Shot | getShotFromShotPool () |
| Gets the shot from shot pool. | |
| boolean | returnShotToShotPool (Shot shot) |
| Return shot to shot pool. | |
| void | setShotFactory (Shot shotFactory) |
| Sets the shot factory. | |
| Shot | getShotFactory () |
| Gets the shot factory. | |
| void | setShipFactory (Ship shipFactory) |
| Ship | getShipFactory () |
| ConcurrentLinkedQueue< Shot > | setupShotPoolForFederation () |
| This generates the initial shotPool and registers all the shots. | |
| void | setMyRti (IMakShooterRTI myRti) |
| Sets the my rti. | |
| IMakShooterRTI | getMyRti () |
| Gets the my rti. | |
| void | reinitialize () |
Static Public Member Functions | |
| static ShotManager | getInstance () |
| Gets the single instance of ShotManager. | |
| static void | performDetonationGraphic (final Board board, final Ship ship) |
Private Member Functions | |
| void | incrementShot (Shot shot, E_Alignment alignment, Board board) |
| Changes the X coordinate of a shot by a fixed increment (if shot alignment is RIGHT, you multiply by -1 to make it go left). | |
| void | checkIfShotExitsBoard (Shot shot, E_Alignment alignment, Board board) |
| Check if shot exits board. | |
| void | checkIfShotDetonates (Shot shot, E_Alignment alignment, Board board) |
| Check if shot detonates. | |
| void | performIntenseDetonationCheck (Shot shot, E_Alignment alignment, Board board) |
| Perform intense detonation check. | |
| void | generateInitialShotPool () |
| Generate initial shot pool. | |
Private Attributes | |
| ConcurrentHashMap< UUID, Shot > | shotList |
| The shot list. | |
| ConcurrentLinkedQueue< Shot > | shotPool |
| The shot pool. | |
| Shot | shotFactory |
| The shot factory. | |
| Ship | shipFactory |
| IMakShooterRTI | myRti |
| The my rti. | |
Static Private Attributes | |
| static final int | SHIP_EXPLOSION_DURATION = 500 |
| static ShotManager | instance = null |
| The instance. | |
The Class ShotManager.
|
inline |
Instantiates a new shot manager.
References controllers.ShotManager.shotList.
Referenced by controllers.ShotManager.getInstance().
|
inline |
Adds the new shot.
| shot | the shot |
References common.Shot.getUuid(), and controllers.ShotManager.shotList.
Referenced by federate.RTI1516e.MakShooterRTI1516eFederateAmbassador.discoverNewShot(), controllers.KeyboardShipController.shoot(), and controllers.KeyboardShipController.TestShoot().
|
inlineprivate |
Check if shot detonates.
| shot | the shot |
| alignment | the alignment |
| board | the board |
References ui.MakShooterUIConstants.DEFAULT_SHIP_LEFT_X, ui.MakShooterUIConstants.DEFAULT_SHIP_RIGHT_X, ui.MakShooterUIConstants.DEFAULT_SHIP_SIZE, common.Shot.getAlignment(), common.Drawable.getX(), common.E_Alignment.LEFT, controllers.ShotManager.performIntenseDetonationCheck(), and common.E_Alignment.RIGHT.
Referenced by controllers.ShotManager.incrementShot().
|
inlineprivate |
Check if shot exits board.
| shot | the shot |
| alignment | the alignment |
| board | the board |
References ui.MakShooterUIConstants.DEFAULT_BOARD_WIDTH, common.Drawable.getX(), and controllers.ShotManager.removeShot().
Referenced by controllers.ShotManager.incrementShot().
|
inlineprivate |
Generate initial shot pool.
References common.Shot.createShot(), controllers.ShotManager.getShipFactory(), controllers.ShotManager.getShotFactory(), controllers.MakShooterControllerConstants.MAX_SHOT_POOL_SIZE, common.Drawable.setVisible(), and controllers.ShotManager.shotPool.
Referenced by controllers.ShotManager.setupShotPoolForFederation().
|
inlinestatic |
Gets the single instance of ShotManager.
References controllers.ShotManager.instance, and controllers.ShotManager.ShotManager().
Referenced by federate.RTI1516e.MakShooterRTI1516eFederateAmbassador.discoverNewShot(), ui.TestMain.main(), federate.RTI1516e.Test.main(), ui.GraphicsPanel.paintComponent(), controllers.ShotManager.performIntenseDetonationCheck(), federate.RTI1516e.MakShooterRTI1516eFederateAmbassador.removeInstanceObjectShot(), controllers.ShotManager.removeShot(), ui.RTIActionHelper.resetShotManager(), controllers.ShotIncrementingThread.run(), controllers.ShotManager.setupShotPoolForFederation(), controllers.KeyboardShipController.shoot(), ui.RTIActionHelper.startNewGame(), and controllers.KeyboardShipController.TestShoot().
|
inline |
|
inline |
References controllers.ShotManager.shipFactory.
Referenced by controllers.ShotManager.generateInitialShotPool().
|
inline |
Gets the shot factory.
References controllers.ShotManager.shotFactory.
Referenced by controllers.ShotManager.generateInitialShotPool().
|
inline |
Gets the shot from shot pool.
References controllers.ShotManager.shotPool.
Referenced by controllers.KeyboardShipController.shoot().
|
inline |
Gets the shot list.
References controllers.ShotManager.shotList.
Referenced by ui.GraphicsPanel.paintComponent(), and federate.RTI1516e.MakShooterRTI1516eFederateAmbassador.removeInstanceObjectShot().
|
inline |
This basically moves all shots in the system that belong to the current player.
| alignment | the alignment |
| board | the board |
References controllers.ShotManager.incrementShot(), and controllers.ShotManager.shotList.
Referenced by controllers.ShotIncrementingThread.run().
|
inlineprivate |
Changes the X coordinate of a shot by a fixed increment (if shot alignment is RIGHT, you multiply by -1 to make it go left).
| shot | the shot |
| alignment | the alignment |
| board | the board |
References controllers.ShotManager.checkIfShotDetonates(), controllers.ShotManager.checkIfShotExitsBoard(), ui.MakShooterUIConstants.DEFAULT_SHOT_X_SHIFT, common.Shot.getAlignment(), common.Drawable.getX(), controllers.ShotManager.myRti, common.E_Alignment.RIGHT, common.Drawable.setX(), and federate.IMakShooterRTI.updateShotAttributes().
Referenced by controllers.ShotManager.incrementAllShots().
|
inlineprivate |
Perform intense detonation check.
| shot | the shot |
| alignment | the alignment |
| board | the board |
References common.Shot.getAlignment(), controllers.ShotManager.getInstance(), ui.Board.getLeftShip(), ui.Board.getRightShip(), common.Drawable.getShape(), controllers.ShotManager.myRti, controllers.ShotManager.performDetonationGraphic(), controllers.ShotManager.removeShot(), and federate.IMakShooterRTI.sendDetonationInteraction().
Referenced by controllers.ShotManager.checkIfShotDetonates().
|
inline |
References controllers.ShotManager.instance, controllers.ShotManager.shotList, and controllers.ShotManager.shotPool.
Referenced by ui.RTIActionHelper.resetShotManager().
|
inline |
Removes the shot.
| shot | the shot |
| alignment | the alignment |
References common.Shot.getAlignment(), controllers.ShotManager.getInstance(), common.Shot.getUuid(), controllers.ShotManager.removeShotFromUI(), controllers.ShotManager.returnShotToShotPool(), and controllers.ShotManager.shotList.
Referenced by controllers.ShotManager.checkIfShotExitsBoard(), and controllers.ShotManager.performIntenseDetonationCheck().
|
inline |
Removes the shot from ui.
| shot | the shot |
References controllers.ShotManager.myRti, common.Drawable.setVisible(), and federate.IMakShooterRTI.updateShotAttributes().
Referenced by controllers.ShotManager.removeShot().
|
inline |
Return shot to shot pool.
| shot | the shot |
References controllers.ShotManager.shotPool.
Referenced by controllers.ShotManager.removeShot().
|
inline |
Sets the my rti.
| myRti | the new my rti |
References controllers.ShotManager.myRti.
Referenced by ui.TestMain.main(), federate.RTI1516e.Test.main(), and ui.RTIActionHelper.startNewGame().
|
inline |
References controllers.ShotManager.shipFactory.
|
inline |
Sets the shot factory.
| shotFactory | the new shot factory |
References controllers.ShotManager.shotFactory.
|
inline |
This generates the initial shotPool and registers all the shots.
References controllers.ShotManager.generateInitialShotPool(), controllers.ShotManager.getInstance(), and controllers.ShotManager.shotPool.
Referenced by ui.TestMain.main(), federate.RTI1516e.Test.main(), and ui.RTIActionHelper.startNewGame().
|
staticprivate |
The instance.
Referenced by controllers.ShotManager.getInstance(), and controllers.ShotManager.reinitialize().
|
private |
|
staticprivate |
Referenced by controllers.ShotManager.performDetonationGraphic().
|
private |
Referenced by controllers.ShotManager.getShipFactory(), and controllers.ShotManager.setShipFactory().
|
private |
The shot factory.
Referenced by controllers.ShotManager.getShotFactory(), and controllers.ShotManager.setShotFactory().
|
private |
|
private |