![]() |
MAK RTIspy API Documentation for HLA Evolved
|
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.
| controllers.ShotManager.ShotManager | ( | ) | [inline] |
Instantiates a new shot manager.
References controllers.ShotManager.shotList.
Referenced by controllers.ShotManager.getInstance().
| void controllers.ShotManager.addNewShot | ( | Shot | shot | ) | [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().
| void controllers.ShotManager.checkIfShotDetonates | ( | Shot | shot, |
| E_Alignment | alignment, | ||
| Board | board | ||
| ) | [inline, private] |
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().
| void controllers.ShotManager.checkIfShotExitsBoard | ( | Shot | shot, |
| E_Alignment | alignment, | ||
| Board | board | ||
| ) | [inline, private] |
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().
| void controllers.ShotManager.generateInitialShotPool | ( | ) | [inline, private] |
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().
| static ShotManager controllers.ShotManager.getInstance | ( | ) | [inline, static] |
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().
| IMakShooterRTI controllers.ShotManager.getMyRti | ( | ) | [inline] |
| Ship controllers.ShotManager.getShipFactory | ( | ) | [inline] |
References controllers.ShotManager.shipFactory.
Referenced by controllers.ShotManager.generateInitialShotPool().
| Shot controllers.ShotManager.getShotFactory | ( | ) | [inline] |
Gets the shot factory.
References controllers.ShotManager.shotFactory.
Referenced by controllers.ShotManager.generateInitialShotPool().
| Shot controllers.ShotManager.getShotFromShotPool | ( | ) | [inline] |
Gets the shot from shot pool.
References controllers.ShotManager.shotPool.
Referenced by controllers.KeyboardShipController.shoot().
| ConcurrentHashMap<UUID, Shot> controllers.ShotManager.getShotList | ( | ) | [inline] |
Gets the shot list.
References controllers.ShotManager.shotList.
Referenced by ui.GraphicsPanel.paintComponent(), and federate.RTI1516e.MakShooterRTI1516eFederateAmbassador.removeInstanceObjectShot().
| void controllers.ShotManager.incrementAllShots | ( | E_Alignment | alignment, |
| Board | board | ||
| ) | [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().
| void controllers.ShotManager.incrementShot | ( | Shot | shot, |
| E_Alignment | alignment, | ||
| Board | board | ||
| ) | [inline, private] |
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().
| static void controllers.ShotManager.performDetonationGraphic | ( | final Board | board, |
| final Ship | ship | ||
| ) | [inline, static] |
| void controllers.ShotManager.performIntenseDetonationCheck | ( | Shot | shot, |
| E_Alignment | alignment, | ||
| Board | board | ||
| ) | [inline, private] |
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().
| void controllers.ShotManager.reinitialize | ( | ) | [inline] |
References controllers.ShotManager.instance, controllers.ShotManager.shotList, and controllers.ShotManager.shotPool.
Referenced by ui.RTIActionHelper.resetShotManager().
| void controllers.ShotManager.removeShot | ( | Shot | shot, |
| E_Alignment | alignment | ||
| ) | [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().
| void controllers.ShotManager.removeShotFromUI | ( | Shot | shot | ) | [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().
| boolean controllers.ShotManager.returnShotToShotPool | ( | Shot | shot | ) | [inline] |
Return shot to shot pool.
| shot | the shot |
References controllers.ShotManager.shotPool.
Referenced by controllers.ShotManager.removeShot().
| void controllers.ShotManager.setMyRti | ( | IMakShooterRTI | myRti | ) | [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().
| void controllers.ShotManager.setShipFactory | ( | Ship | shipFactory | ) | [inline] |
References controllers.ShotManager.shipFactory.
| void controllers.ShotManager.setShotFactory | ( | Shot | shotFactory | ) | [inline] |
Sets the shot factory.
| shotFactory | the new shot factory |
References controllers.ShotManager.shotFactory.
| ConcurrentLinkedQueue<Shot> controllers.ShotManager.setupShotPoolForFederation | ( | ) | [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().
ShotManager controllers.ShotManager.instance = null [static, private] |
The instance.
Referenced by controllers.ShotManager.getInstance(), and controllers.ShotManager.reinitialize().
IMakShooterRTI controllers.ShotManager.myRti [private] |
final int controllers.ShotManager.SHIP_EXPLOSION_DURATION = 500 [static, private] |
Referenced by controllers.ShotManager.performDetonationGraphic().
Ship controllers.ShotManager.shipFactory [private] |
Referenced by controllers.ShotManager.getShipFactory(), and controllers.ShotManager.setShipFactory().
Shot controllers.ShotManager.shotFactory [private] |
The shot factory.
Referenced by controllers.ShotManager.getShotFactory(), and controllers.ShotManager.setShotFactory().
ConcurrentHashMap<UUID, Shot> controllers.ShotManager.shotList [private] |
ConcurrentLinkedQueue<Shot> controllers.ShotManager.shotPool [private] |