MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
controllers.ShotManager Class Reference

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, ShotgetShotList ()
 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< ShotsetupShotPoolForFederation ()
 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, ShotshotList
 The shot list.
ConcurrentLinkedQueue< ShotshotPool
 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.

Detailed Description

The Class ShotManager.

Author
snandi

Constructor & Destructor Documentation

controllers.ShotManager.ShotManager ( )
inline

Instantiates a new shot manager.

References controllers.ShotManager.shotList.

Referenced by controllers.ShotManager.getInstance().

Member Function Documentation

void controllers.ShotManager.addNewShot ( Shot  shot)
inline
void controllers.ShotManager.checkIfShotDetonates ( Shot  shot,
E_Alignment  alignment,
Board  board 
)
inlineprivate
void controllers.ShotManager.checkIfShotExitsBoard ( Shot  shot,
E_Alignment  alignment,
Board  board 
)
inlineprivate

Check if shot exits board.

Parameters
shotthe shot
alignmentthe alignment
boardthe board

References ui.MakShooterUIConstants.DEFAULT_BOARD_WIDTH, common.Drawable.getX(), and controllers.ShotManager.removeShot().

Referenced by controllers.ShotManager.incrementShot().

void controllers.ShotManager.generateInitialShotPool ( )
inlineprivate
static ShotManager controllers.ShotManager.getInstance ( )
inlinestatic
IMakShooterRTI controllers.ShotManager.getMyRti ( )
inline

Gets the my rti.

Returns
the my rti

References controllers.ShotManager.myRti.

Ship controllers.ShotManager.getShipFactory ( )
inline
Shot controllers.ShotManager.getShotFactory ( )
inline

Gets the shot factory.

Returns
the shot factory

References controllers.ShotManager.shotFactory.

Referenced by controllers.ShotManager.generateInitialShotPool().

Shot controllers.ShotManager.getShotFromShotPool ( )
inline

Gets the shot from shot pool.

Returns
the shot from shot pool

References controllers.ShotManager.shotPool.

Referenced by controllers.KeyboardShipController.shoot().

ConcurrentHashMap<UUID, Shot> controllers.ShotManager.getShotList ( )
inline
void controllers.ShotManager.incrementAllShots ( E_Alignment  alignment,
Board  board 
)
inline

This basically moves all shots in the system that belong to the current player.

Parameters
alignmentthe alignment
boardthe 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 
)
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).

Parameters
shotthe shot
alignmentthe alignment
boardthe 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 
)
inlinestatic
void controllers.ShotManager.performIntenseDetonationCheck ( Shot  shot,
E_Alignment  alignment,
Board  board 
)
inlineprivate
void controllers.ShotManager.reinitialize ( )
inline
void controllers.ShotManager.removeShot ( Shot  shot,
E_Alignment  alignment 
)
inline
void controllers.ShotManager.removeShotFromUI ( Shot  shot)
inline
boolean controllers.ShotManager.returnShotToShotPool ( Shot  shot)
inline

Return shot to shot pool.

Parameters
shotthe shot
Returns
true, if successful

References controllers.ShotManager.shotPool.

Referenced by controllers.ShotManager.removeShot().

void controllers.ShotManager.setMyRti ( IMakShooterRTI  myRti)
inline

Sets the my rti.

Parameters
myRtithe 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
void controllers.ShotManager.setShotFactory ( Shot  shotFactory)
inline

Sets the shot factory.

Parameters
shotFactorythe new shot factory

References controllers.ShotManager.shotFactory.

ConcurrentLinkedQueue<Shot> controllers.ShotManager.setupShotPoolForFederation ( )
inline

This generates the initial shotPool and registers all the shots.

Returns
the concurrent linked queue

References controllers.ShotManager.generateInitialShotPool(), controllers.ShotManager.getInstance(), and controllers.ShotManager.shotPool.

Referenced by ui.TestMain.main(), federate.RTI1516e.Test.main(), and ui.RTIActionHelper.startNewGame().

Member Data Documentation

ShotManager controllers.ShotManager.instance = null
staticprivate
IMakShooterRTI controllers.ShotManager.myRti
private
final int controllers.ShotManager.SHIP_EXPLOSION_DURATION = 500
staticprivate
Ship controllers.ShotManager.shipFactory
private
Shot controllers.ShotManager.shotFactory
private
ConcurrentHashMap<UUID, Shot> controllers.ShotManager.shotList
private
ConcurrentLinkedQueue<Shot> controllers.ShotManager.shotPool
private

The documentation for this class was generated from the following file:

Document ID: Generated on Wed Mar 11 20:26:49 EDT 2015 from SVN revision 150939
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)