#include <attackcommand.h>
Inheritance diagram for AttackCommand:

Public Types | |
| typedef map< MapCoordinate, AttackWeap > | FieldList |
Public Member Functions | |
| AttackCommand (Vehicle *unit) | |
| ActionResult | searchTargets () |
| Vehicle * | getAttacker () |
| void | setTarget (const MapCoordinate &target, int weapon=-1) |
| ActionResult | go (const Context &context) |
| ASCString | getCommandString () const |
| const FieldList & | getAttackableUnits () |
| const FieldList & | getAttackableBuildings () |
| const FieldList & | getAttackableObjects () |
Static Public Member Functions | |
| static bool | avail (Vehicle *eht) |
Protected Member Functions | |
| void | readData (tnstream &stream) |
| void | writeData (tnstream &stream) const |
| GameActionID | getID () const |
| ASCString | getDescription () const |
Friends | |
| template<class Child> | |
| GameAction * | GameActionCreator (GameMap *map) |
Definition at line 30 of file attackcommand.h.
| typedef map<MapCoordinate,AttackWeap > AttackCommand::FieldList |
Definition at line 34 of file attackcommand.h.
| AttackCommand::AttackCommand | ( | Vehicle * | unit | ) |
Definition at line 45 of file attackcommand.cpp.
| bool AttackCommand::avail | ( | Vehicle * | eht | ) | [static] |
Definition at line 34 of file attackcommand.cpp.
References Vehicle::attacked, Vehicle::hasMoved(), Vehicle::typ, VehicleType::wait, and Vehicle::weapexist().
Referenced by GuiFunctions::Attack::available(), and unitAttack().
| void AttackCommand::readData | ( | tnstream & | stream | ) | [protected, virtual] |
Reimplemented from UnitCommand.
Definition at line 217 of file attackcommand.cpp.
References MapCoordinate::read(), UnitCommand::readData(), and tnstream::readInt().
| void AttackCommand::writeData | ( | tnstream & | stream | ) | const [protected, virtual] |
Reimplemented from UnitCommand.
Definition at line 233 of file attackcommand.cpp.
References MapCoordinate::write(), UnitCommand::writeData(), and tnstream::writeInt().
| GameActionID AttackCommand::getID | ( | ) | const [protected, virtual] |
Implements GameAction.
Definition at line 251 of file attackcommand.cpp.
References ActionRegistry::AttackCommand.
| ASCString AttackCommand::getDescription | ( | ) | const [protected, virtual] |
Implements GameAction.
Definition at line 256 of file attackcommand.cpp.
References Vehicle::getName(), UnitCommand::getUnit(), and MapCoordinate::toString().
| ActionResult AttackCommand::searchTargets | ( | ) |
Definition at line 51 of file attackcommand.cpp.
References GameMap::actplayer, Vehicle::ammo, Vehicle::attacked, UnitWeapon::count, fieldvisiblenow(), GameAction::getMap(), Vehicle::getPosition(), Vehicle::ReactionFire::getStatus(), UnitCommand::getUnit(), Vehicle::height, max(), SingleWeapon::maxdistance, maxmalq, min(), SingleWeapon::mindistance, Vehicle::reactionfire, Vehicle::ReactionFire::ready, SingleWeapon::shootable(), SingleWeapon::sourceheight, Vehicle::typ, VehicleType::wait, UnitWeapon::weapon, and VehicleType::weapons.
Referenced by go().
| Vehicle* AttackCommand::getAttacker | ( | ) | [inline] |
Definition at line 66 of file attackcommand.h.
References UnitCommand::getUnit().
Referenced by GuiFunctions::AttackGui::getName().
| void AttackCommand::setTarget | ( | const MapCoordinate & | target, | |
| int | weapon = -1 | |||
| ) |
Definition at line 152 of file attackcommand.cpp.
References GameMap::getField(), GameAction::getMap(), Vehicle::networkid, Command::setState(), Command::SetUp, and MapField::vehicle.
| ActionResult AttackCommand::go | ( | const Context & | context | ) | [virtual] |
Implements Command.
Definition at line 168 of file attackcommand.cpp.
References MapField::building, GameAction::execute(), Command::Failed, Command::Finished, GameMap::getField(), GameAction::getMap(), Vehicle::getPosition(), Command::getState(), GameMap::getUnit(), UnitCommand::getUnitID(), searchTargets(), Command::setState(), Command::SetUp, ActionResult::successful(), and MapCoordinate::valid().
| ASCString AttackCommand::getCommandString | ( | ) | const [virtual] |
Implements Command.
Definition at line 244 of file attackcommand.cpp.
References ASCString::format(), UnitCommand::getUnitID(), MapCoordinate::x, and MapCoordinate::y.
| const FieldList& AttackCommand::getAttackableUnits | ( | ) | [inline] |
Definition at line 72 of file attackcommand.h.
| const FieldList& AttackCommand::getAttackableBuildings | ( | ) | [inline] |
Definition at line 73 of file attackcommand.h.
| const FieldList& AttackCommand::getAttackableObjects | ( | ) | [inline] |
Definition at line 74 of file attackcommand.h.
| GameAction* GameActionCreator | ( | GameMap * | map | ) | [friend] |
1.5.1