MAK RTIspy API Documentation for HLA 1.3
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:

List of all members.

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

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 
) [inline, private]
void controllers.ShotManager.checkIfShotExitsBoard ( Shot  shot,
E_Alignment  alignment,
Board  board 
) [inline, private]

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().

static ShotManager controllers.ShotManager.getInstance ( ) [inline, static]

Gets the my rti.

Returns:
the my rti

References controllers.ShotManager.myRti.

Gets the shot factory.

Returns:
the shot factory

References controllers.ShotManager.shotFactory.

Referenced by controllers.ShotManager.generateInitialShotPool().

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 
) [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).

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 
) [inline, static]
void controllers.ShotManager.performIntenseDetonationCheck ( Shot  shot,
E_Alignment  alignment,
Board  board 
) [inline, private]
void controllers.ShotManager.removeShot ( Shot  shot,
E_Alignment  alignment 
) [inline]

Return shot to shot pool.

Parameters:
shotthe shot
Returns:
true, if successful

References controllers.ShotManager.shotPool.

Referenced by controllers.ShotManager.removeShot().

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

final int controllers.ShotManager.SHIP_EXPLOSION_DURATION = 500 [static, 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 Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)