controls.cpp File Reference

#include <stdio.h>
#include <cstring>
#include <math.h>
#include <stdarg.h>
#include <ctime>
#include "buildingtype.h"
#include "vehicletype.h"
#include "typen.h"
#include "spfst.h"
#include "loaders.h"
#include "controls.h"
#include "attack.h"
#include "gameoptions.h"
#include "errors.h"
#include "viewcalculation.h"
#include "replay.h"
#include "resourcenet.h"
#include "stack.h"

Include dependency graph for controls.cpp:

Go to the source code of this file.

Functions

bool checkUnitsForCrash (Player &player, ASCString &text)
int windbeeline (const MapCoordinate &start, const MapCoordinate &dest, WindMovement *wm)
 return the distance between x1/y1 and x2/y2 using the power of the wind factors precalculated in WindMovement
pair< int, int > calcMoveMalus (const MapCoordinate3D &start, const MapCoordinate3D &dest, const Vehicle *vehicle, WindMovement *wm, bool *inhibitAttack, bool container2container)


Detailed Description

Controlling units (which is graudally moved to vehicletype.cpp and unitctrl.cpp ); Things that are run when starting and ending someones turn

Definition in file controls.cpp.


Function Documentation

pair<int,int> calcMoveMalus ( const MapCoordinate3D start,
const MapCoordinate3D dest,
const Vehicle vehicle,
WindMovement wm = NULL,
bool *  inhibitAttack = NULL,
bool  container2container = false 
)

calculates the movement cost for moving vehicle from start to dest.

Returns:
: first: movement ; second: fuel consumption

Definition at line 82 of file controls.cpp.

References attackpossible28(), beeline(), MapField::building, VehicleType::HeightChangeMethod::canAttack, Player::diplomacy, VehicleType::HeightChangeMethod::dist, fatalError(), MapCoordinate3D::getBitmappedHeight(), MapField::getContainer(), getdirection(), WindMovement::getDist(), GameMap::getField(), Vehicle::getHeightChange(), ContainerBase::getMap(), MapField::getmovemalus(), getnextfield(), MapCoordinate3D::getNumericalHeight(), ContainerBase::getOwner(), GameMap::getPlayer(), DiplomaticStateVector::isHostile(), max(), maxmalq, VehicleType::HeightChangeMethod::moveCost, ContainerBaseType::TransportationIO::movecost, sidenum, submarineMovement, Vehicle::typ, MapField::vehicle, ContainerBase::vehicleUnloadSystem(), GameMap::weather, GameMap::Weather::windSpeed, MapCoordinate::x, and MapCoordinate::y.

Referenced by AStar3D::getMoveCost(), AStar::getMoveCost(), and MoveUnit::runAction().

bool checkUnitsForCrash ( Player player,
ASCString text 
)

Definition at line 49 of file controls.cpp.

References UnitHooveringLogic::getEndurance(), CGameOptions::Instance(), ASCString::toString(), and Player::vehicleList.

Referenced by GuiFunctions::EndTurn::execute().

int windbeeline ( const MapCoordinate start,
const MapCoordinate dest,
WindMovement wm 
)

return the distance between x1/y1 and x2/y2 using the power of the wind factors precalculated in WindMovement

Definition at line 67 of file controls.cpp.

References getdirection(), WindMovement::getDist(), getnextfield(), minmalq, MapCoordinate::x, and MapCoordinate::y.

Referenced by AStar3D::dist().


Generated on Mon May 21 01:33:34 2012 for Advanced Strategic Command by  doxygen 1.5.1