CSWWeapon Class Reference

Inheritance diagram for CSWWeapon:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual bool arm (double fArmDelay)
virtual bool fire (double fFireDelay)

Detailed Description

This is the base class for all weapons within the world. A weapon is a thing that can causes damage to other damagable objects. The damage height to other objects is depend on its size. Larger weapon causes higher damage. This has the property to emit sound on its explosion that is depend on the explosion power.
Warning:
Weapons can only be launched through a weaponbattery! Otherwise the object will not inserted into the object tree.


Member Function Documentation

bool CSWWeapon::arm ( double  fArmDelay  )  [virtual]

Sets the relative time from now when the weapon will be armed. Only if a weapon is armed it could explode. This is only available if the weapon was not launched.

Parameters:
fArmDelay The time from now in seconds when the weapon is armed.
Returns:
True on success.
Warning:
If the absolute time for fire is earlier than the absolute arm time, the fire time will be set to arm time.

bool CSWWeapon::fire ( double  fFireDelay  )  [virtual]

Sets the relative time from now when the weapon will be fired. This time should be larger than the arm delay. This is only available if the weapon was not launched.

Parameters:
fFireDelay The time from now in seconds when the weapon is fired.
Returns:
True on success.
Warning:
If the absolute time for fire is earlier than the absolute arm time, the arm time will be set to fire time.


Generated at 2 Jan 2007 for project CodeSubWars. www.codesubwars.org