rl.common.game.elements
Interface FiringCapableElement

All Known Implementing Classes:
CapitalShip, InfantrySquad, Vehicle

public interface FiringCapableElement


Method Summary
 void applyFiringSummary(GameElementFiringSummary gefs)
          function called to apply firing summary to element.
 boolean canFire(int turn)
          Returns whether this unit can make a firing attempt on a particular turn
 boolean canFireIndirect(int turn)
          Returns whether this unit can make an indirect firing attempt on a particular turn
 GameElementFiringSummary getFiringSummary(int turn)
          get a new GameElementFiringSummary object appropriate to the object implementing this interface
 void weaponFired(java.lang.String weaponName, java.lang.String ammoType, int weaponIndex)
          This is called when an element fires a weapon
 

Method Detail

canFire

boolean canFire(int turn)
Returns whether this unit can make a firing attempt on a particular turn

Parameters:
turn - The turn that we're checking the element can fire
Returns:
If the element can fire on the turn supplied

canFireIndirect

boolean canFireIndirect(int turn)
Returns whether this unit can make an indirect firing attempt on a particular turn

Parameters:
turn - The turn that we're checking the element can fire indirectly
Returns:
If the element can fire indirectly on the turn supplied

getFiringSummary

GameElementFiringSummary getFiringSummary(int turn)
get a new GameElementFiringSummary object appropriate to the object implementing this interface

Returns:
A GameElementFiringSummary object containing all of the information for all of the outgoing fire from this element

applyFiringSummary

void applyFiringSummary(GameElementFiringSummary gefs)
function called to apply firing summary to element. This is used as a synch between the element on the server and one on the client.

Parameters:
gefs - Applies all of the firing information contained in the GameElementFiringSummary. This is primarily used to capture ammunition expenditure

weaponFired

void weaponFired(java.lang.String weaponName,
                 java.lang.String ammoType,
                 int weaponIndex)
This is called when an element fires a weapon

Parameters:
weaponName - The name of the weapon system firing
ammoType - The ammo type used in the firing attempt
weaponIndex - The index of the weapon system firing