70 namespace GuiFunctions
77 pair<const AttackWeap*, int> getEntry(
const MapCoordinate& pos,
int num );
79 void mapDeleted(
GameMap& map ) {
89 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num );
105 if ( key->keysym.sym == SDLK_ESCAPE || key->keysym.unicode ==
'c' ) {
113 pair<const AttackWeap*, int> AttackGui::getEntry(
const MapCoordinate& pos,
int num )
118 if ( attackEngine ) {
120 for (
int i = 0; i < 3; ++i ) {
133 AttackCommand::FieldList::const_iterator it = afl->find( pos );
134 if ( it != afl->end() ) {
136 for (
int a = 0; a < aw->
count; ++a ) {
137 if ( counter == num )
138 return make_pair( aw, a );
154 if ( getEntry(pos,num).first )
164 pair<const AttackWeap*, int> p = getEntry(pos,num);
168 attack->
setTarget ( pos, p.first->num[p.second] );
191 pair<const AttackWeap*, int> p = getEntry(pos,num);
192 switch ( p.first->typ[p.second] ) {
217 if ( num == -1 || attackEngine == NULL )
224 pair<const AttackWeap*, int> p = getEntry(pos,num);
249 while ( getEntry( mc, num).first ) {
289 return ( key->keysym.sym == SDLK_ESCAPE || key->keysym.unicode ==
'c' );
307 return ( key->keysym.sym == SDLK_SPACE );
317 return "move unit (~space~)";
335 if ( path.size() == 0 )
338 return path.rbegin()->x == pos.
x && path.rbegin()->y == pos.
y;
430 for ( AStar3D::Path::const_iterator i = move->
getPath().begin(); i != move->
getPath().end(); ++i )
448 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
449 return ( key->keysym.unicode ==
's' );
486 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
487 return ( key->keysym.unicode ==
'd' );
518 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
519 return ( key->keysym.unicode ==
'e' );
543 ASCString message =
"The following units are about to crash\n\n";
545 if ( crashWarning ) {
546 if (
choiceDialog( message,
"continue",
"cancel",
"AircraftCrashWarning" ) == 2 )
552 static int autosave = 0;
559 autosave = !autosave;
575 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
576 return ( key->keysym.unicode ==
'a' );
603 if ( !result.successful() ) {
608 AttackCommand::FieldList::const_iterator i;
642 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
643 return ( key->keysym.unicode ==
'p' );
647 pgsc->setNewState( newState );
670 return "enable ~p~ower generation";
680 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
681 return ( key->keysym.unicode ==
'p' );
689 return "disable ~p~ower generation";
706 return "unit ~i~nfo";
708 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
709 return ( key->keysym.unicode ==
'i' );
738 return "destruct building";
768 vector<MapCoordinate> fields = db->getFields();
770 if ( fields.empty() ) {
774 for ( vector<MapCoordinate>::iterator i = fields.begin(); i != fields.end(); ++i )
802 static int containeractive;
834 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
835 return ( key->keysym.unicode ==
'l' );
839 return "view ~l~oaded units";
843 int OpenContainer::containeractive = 0;
860 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
861 return ( key->keysym.unicode ==
'x' );
867 rf->setNewState(
true );
882 return "enable reaction fire (~x~)";
899 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
900 return ( key->keysym.unicode ==
'x' );
905 rf->setNewState(
false );
921 return "disable reaction fire (~x~)";
947 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
948 return ( key->keysym.unicode ==
'j' );
965 vector<MapCoordinate> fields = jdc->getDestinations();
966 for ( vector<MapCoordinate>::const_iterator i = fields.begin(); i != fields.end(); ++i )
969 if ( fields.size() ) {
998 return "activate jump drive (~j~)";
1017 if ( service && fld->
vehicle )
1024 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
1025 return ( key->keysym.unicode ==
'r' );
1031 vector<Vehicle*> targets = rp->getExternalTargets();
1034 for ( vector<Vehicle*>::iterator i = targets.begin(); i != targets.end(); ++i ) {
1038 if ( !fieldCount ) {
1079 return "~r~epair unit (cost: " + r.
toString() +
")";
1082 return "~r~epair a unit";
1104 return find( destinations.begin(), destinations.end(), fld->
getContainer() ) != destinations.end();
1111 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
1112 return ( key->keysym.unicode ==
'f' );
1117 auto_ptr<ServiceCommand> service (
new ServiceCommand( subject ));
1123 for ( ServiceTargetSearcher::Targets::const_iterator i = destinations.begin(); i != destinations.end(); ++i ) {
1125 if ( targetPos != srcPos ) {
1131 if ( !fieldCount ) {
1164 return "re~f~uel a unit";
1178 return find( destinations.begin(), destinations.end(), fld->
getContainer() ) != destinations.end();
1183 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
1184 return ( key->keysym.unicode ==
'f' && (modifier & KMOD_SHIFT) );
1207 return "re~F~uel dialog ";
1224 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
1225 return ( key->keysym.unicode ==
'm' );
1234 vector<MapCoordinate> fields = poc->getFields();
1235 for ( vector<MapCoordinate>::iterator i = fields.begin(); i != fields.end(); ++i )
1244 MessagingHub::Instance().statusInformation(
"can't build or remove any objects here");
1253 return "put / remove ~m~ines";
1275 for ( vector<MineTypes>::const_iterator i = mines.begin(); i != mines.end(); ++i )
1309 return "put anti-tank mine";
1324 return "put anti-personnel mine";
1341 return "put anti-ship mine";
1355 return "put anti-submarine mine";
1394 return "remove mine";
1407 void mapDeleted(
GameMap& map ) {
1420 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num );
1487 if ( o.GetPixelFormat().BitsPerPixel() == 32 ) {
1489 blitter.setSize( o.w(), o.h(), s.w(), s.h() );
1490 blitter.
blit( o, s,
SPoint(
int((s.w() - blitter.getZoomX() * o.w())/2), int((s.h() - blitter.getZoomY() * o.h())/2)));
1493 blitter.setSize( o.w(), o.h(), s.w(), s.h() );
1494 blitter.
blit( o, s,
SPoint(
int((s.w() - blitter.getZoomX() * o.w())/2), int((s.h() - blitter.getZoomY() * o.h())/2)));
1500 blitter.
blit( removegui, s,
SPoint((s.w() - removegui.w())/2, (s.h() - removegui.h())/2));
1511 return ( key->keysym.sym == SDLK_ESCAPE || key->keysym.unicode ==
'c' );
1524 static map<int,Surface> removeIconRepository;
1526 if ( removeIconRepository.find( num ) != removeIconRepository.end() )
1527 return removeIconRepository[num];
1530 return removeIconRepository[num];
1572 for ( set<int>::const_iterator i = creatable.begin(); i != creatable.end(); ++i ) {
1578 for ( set<int>::const_iterator i = removable.begin(); i != removable.end(); ++i ) {
1606 return "~c~onstruct / remove objects";
1608 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
1609 return ( key->keysym.unicode ==
'c' );
1630 vector<MapCoordinate> fields = poc->getFields();
1631 for ( vector<MapCoordinate>::iterator i = fields.begin(); i != fields.end(); ++i )
1641 MessagingHub::Instance().statusInformation(
"can't build or remove any objects here");
1658 return "Unit construction Command";
1696 for ( ConstructUnitCommand::Producables::const_iterator i = buildables.begin(); i != buildables.end(); ++i )
1697 if ( i->type == v ) {
1704 ASCString message =
"Not enough movement to build unit";
1719 constructCommand->setVehicleType( v );
1720 vector<MapCoordinate> fields = constructCommand->getFields();
1722 if ( fields.size() ) {
1723 for ( vector<MapCoordinate>::const_iterator i = fields.begin(); i != fields.end(); ++i )
1762 for (
int y = 0; y <= 5; y++)
1763 for (
int x = 0; x <= 3; x++)
1792 blitter.setSrcRectangle(
SPoint( minx, miny ), maxx-minx, maxy-miny );
1819 return "Building construction";
1821 return "Select building entrance position";
1851 selectedType = type;
1856 return selectedType;
1874 for ( ConstructBuildingCommand::Producables::const_iterator i = producables.begin(); i != producables.end(); ++i )
1876 buildings.push_back( i->type );
1878 if ( buildings.empty() ) {
1894 vector<MapCoordinate> fields = cbc->getFields();
1895 if ( fields.size() == 0 ) {
1900 for ( vector<MapCoordinate>::iterator i = fields.begin(); i != fields.end(); ++i )
1949 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
1950 return ( key->keysym.unicode ==
't' && (modifier & KMOD_SHIFT) );
1964 return "internal Ammo ~T~ransfer dialog ";
1970 static int containeractive;
1983 if (
choice_dlg(
"do you really want to destruct this unit?",
"~y~es",
"~n~o") == 1) {
1987 destructor.release();
1999 bool checkForKey(
const SDL_KeyboardEvent* key,
int modifier,
int num ) {
2004 return "self destruct";
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
Player & getCurrentPlayer()
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
void disableButtons(int i)
disables all button from i onward
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
void setCreationTarget(const MapCoordinate &target, MineTypes mineType)
sigc::signal< void, GameMap * > mapChanged
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
void paintSingleField(Surface &s, SPoint pos, const LocalCoordinate &localCoordinate, const PlayerColor &player, int weather=0, int constructionStep=0) const
const set< int > & getRemovableObjects(const MapCoordinate &pos)
void setaTemp(Uint8 atemp)
Various algorithms need to store some information in the fields they process.
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
GuiButton * getButton(int i)
ItemRepositoryLoader< ObjectType > objectTypeRepository("objecttype")
void setTargetPosition(const MapCoordinate &pos)
void cleartemps(int b=-1, int value=0)
Player & getPlayer(PlayerID p)
MapDisplayInterface & getDefaultMapDisplay()
int maxLoadableUnits
the maximum number of units that can be loaded
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
const AStar3D::Path & getPath()
map accessing and usage routines used by ASC and the mapeditor
struct tfight::tavalues dv
int maxMovement() const
the maximum distance that the unit can drive in a single turn on the current level of height ...
const vector< MineTypes > & getCreatableMines(const MapCoordinate &pos)
map< MapCoordinate, AttackWeap > FieldList
int getResource(int amount, int resourcetype, bool queryonly, int scope=1, int player=-1)
int getMaxRepair(const ContainerBase *item) const
returns the maximum amount of damage that the given item can be repaired
static bool avail(const Vehicle *unit, bool newState)
the command is totally done
int getVerticalDirection()
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
bool isFieldUsable(const MapCoordinate &pos)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
Structure to store the weapons which a unit can use to perform an attack.
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
void registerUserFunction(GuiFunction *function)
registers a user function.
struct tfight::tavalues av
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
void ammoTransferWindow(ContainerBase *source, ContainerBase *destination, ServiceCommand *command)
void move(Vehicle *veh, const MapCoordinate &dest)
void blit(const Surface &src, Surface &dst, SPoint dstPos)
void setRemovalTarget(const MapCoordinate &target)
void setDestination(ContainerBase *destination)
static bool avail(const Vehicle *eht)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
GuiIconHandler primaryGuiIcons
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
int getFirstBit(int zahl)
Count the number of zero bits on the LSB side of "zahl".
ASCString toString() const
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
Context createContext(GameMap *gamemap)
int choiceDialog(const ASCString &text, const ASCString &button1, const ASCString &button2, const ASCString &shortLabel)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
DiplomaticStateVector diplomacy
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
we want only results on a certain level of height
ObjectBuildingGui objectBuildingGui
int getOwner() const
returns the number of the player this vehicle/building belongs to
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
int build_movecost
The movement points that are needed to build this object.
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
A local coordinate referencing a single field that a building covers.
void internalAmmoTransferWindow(Vehicle *vehicle)
const char * cwaffentypen[weaponTypeNum]
static bool avail(const ContainerBase *unit)
void setTarget(Vehicle *target)
static bool avail(Vehicle *eht)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
void warningMessage(const ASCString &str)
static Surface createSurface(int width, int height, SDLmm::Color color=255)
static Command * pendingCommand
the action would be available, if not some prerequisites are missing which the user could provide ...
sigc::signal< void > repaintMap
}@
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
ContainerBase * getContainer()
returns a pointer to the ContainerBase of the field or NULL if there is none
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
a single field of the map
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
void eval(const MapCoordinate &mc, ContainerBase *subject)
checks evaluates the field on which the cursor resides
ASCString & format(const charT *pFormat,...)
sigc::signal< void, Player & > sigPlayerUserInteractionEnds
const set< MapCoordinate3D > & getReachableFieldsIndirect()
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
int getCompletion() const
returns the completion of the building.
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
bool isFieldUsable(const MapCoordinate &pos)
The ASCString class provides an abstract way to manipulate strings.
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
const FieldList & getAttackableObjects()
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
void dispmessage2(const ActionResult &result)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
void setupWeapons(AttackCommand *va)
void calc(void)
Performs the calculation of the attack. The result is only stored in the av and dv structures and is ...
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
int getNeutralPlayerNum() const
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
void setTarget(const MapCoordinate &target, int objectID)
static void popIconHandler()
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
const Surface & getPicture(int i=0, int weather=0) const
returns the pointer to the image i
Interface for various global functions and variables.
int remove_movecost
The movement points that are needed to remove this object.
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
bool fieldvisiblenow(const MapField *pe, Vehicle *veh, int player)
{@
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
bool fieldExists(const LocalCoordinate &localCoordinate) const
returns whether this building covers the given field
The class describing properties that are common to all vehicles of a certain kind.
Resources buildcost
The resources required to construct the object with a unit; Note that units usually don't have any en...
void next_turn(GameMap *gamemap, const NextTurnStrategy &nextTurnStrategy, MapDisplayInterface *display, int playerView)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
static ASCString toString(int i)
converts the parameter to a String
const ContainerBase * getRepairingUnit() const
void BuildingTypeSelected(const BuildingType *type)
Player & getOwningPlayer() const
returns the player this vehicle/building belongs to
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
bool longDistAvailable(const MapCoordinate &pos)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
The class describing properties that are common to all buildings of a certain kind.
ActionResult execute(const Context &context)
vector< ConstructBuildingCommand::ProductionEntry > Producables
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
char * strrr(int a)
converts a to a string.
Surface generate_gui_build_icon(BuildingType *bld)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
static GuiIconHandler * getIconHandler()
ASCString toString(bool brief=true) const
PutMineStage2(MineTypes type)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
static bool descendAvail(Vehicle *eht)
void setTargetPosition(const MapCoordinate &pos)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
enum Player::PlayerStatus stat
const set< int > & getCreatableObjects(const MapCoordinate &pos)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
BuildingConstructionSelection(Resources plantResources, const Container &types, const Player &player)
An object that can be placed on fields. Roads, pipelines and ditches are examples of objects...
static ActionAvailability available(const Vehicle *unit)
Coordinate on the twodimensional map.
const FieldList & getAttackableBuildings()
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
static bool avail(const Vehicle *unit)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
static sigc::signal< void, GameMap & > sigMapDeletion
Interface for all the fighting routines of ASC.
Surface & getImage(const MapCoordinate &po, ContainerBase *subject, int nums)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
int unitConstructionMoveCostPercentage
if this unit constructs another unit externally (for example a turret), it costs this much of its mov...
ContainerBase * getRefueller()
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
static bool avail(Vehicle *eht)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
Surface & getImage(const MapCoordinate &po, ContainerBase *subject, int nums)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
void cargoDialog(ContainerBase *cb)
void setDestination(const MapCoordinate &position)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
sigc::signal< void > updateFieldInfo
static bool avail(Vehicle *eht)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
signed char actplayer
the player who is currently making his moves (may be human or AI)
bool isFieldUsable(const MapCoordinate &pos)
static bool ascendAvail(Vehicle *eht)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
static bool availExternally(const Vehicle *servicer)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
static CGameOptions * Instance()
returns the only Instance
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
vector< const BuildingType * > Container
static bool avail(const Vehicle *eht)
void setVerticalDirection(int dir)
defines whether we want to end up either at the same level of height (0), lower(<0), or heigher(>0)
void setDestination(const MapCoordinate &destination)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
void attack(Vehicle *veh, const MapCoordinate &target)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
const FieldList & getAttackableUnits()
TransferHandler & getTransferHandler()
each call to getTransferHandler will deallocate the previous handler and create a new one Make sure t...
Surface & getImage(const MapCoordinate &po, ContainerBase *subject, int nums)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
bool isKeyPressed(SDLKey key)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
Interface for all the dialog boxes used by the game and the mapeditor.
static bool externalConstructionAvail(const ContainerBase *eht)
int color
The owner of the container.
static bool avail(Vehicle *eht)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
bool fieldReachable(const MapCoordinate &dest)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
void registerGuiFunctions(GuiIconHandler &handler)
ActionResult searchFields(int height=-1, int capabilities=0)
int construction_steps
the number of stages that are required to construct a building using a construction unit...
procedure for loading and writing savegames, maps etc.
bool isAllied(PlayerID towardsPlayer) const
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
static Surface & getIcon(const ASCString &name)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
virtual int getVerticalDirection()=0
vector< ContainerBase * > Targets
A 3D path finding algorithm, based on the 2D algorithm by Amit J. Patel.
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
int getVerticalDirection()
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
the unit will not change its height even if that would provide a shortcut
void addButton(int &num, const MapCoordinate &mc, ContainerBase *subject, int id)
void eval(const MapCoordinate &mc, ContainerBase *subject)
checks evaluates the field on which the cursor resides
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
The parent class of Vehicle and Building; The name Container originates from Battle Isle...
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
static bool avail(const Vehicle *unit, bool newState)
void setaTemp2(Uint8 atemp2)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
the different players in ASC. There may be 8 players (0..7) and neutral units (8) ...
int getVerticalDirection() const
Resources are basically the currency of ASC.
ActionResult searchTargets()
bool validTarget(const Vehicle *target)
void displayActionError(const ActionResult &result, const ASCString &additionalInfo)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
int getVerticalDirection()
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
ASCString getMessage() const
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
void setTargetPosition(const MapCoordinate &pos)
const BuildingType * getSelectedType()
void setTarget(const MapCoordinate &target, int weapon=-1)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
int choice_dlg(const ASCString &title, const ASCString &leftButton, const ASCString &rightButton)
bool init(Vehicle *vehicle)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
const set< MapCoordinate3D > & getReachableFields()
this will return a 2D representation of the reachable fields.
bool checkUnitsForCrash(Player &player, ASCString &text)
virtual void parametrizePathFinder(AStar3D &pathFinder)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
Resources removecost
The resources required to remove the object with a unit; Note that units usually don't have any energ...
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
Availability getAvailability() const
TerrainAccess terrainaccess
the terrain this unit can move to
bool isFieldReachable(const MapCoordinate &pos, bool direct)
checks if the field can be reached by the unit this turn Precondition: searchFields(int,int) was called
virtual void parametrizePathFinder(AStar3D &pathFinder)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
static void pushIconHandler(GuiIconHandler *iconHandler)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
static bool availExternally(ContainerBase *source)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
const ServiceTargetSearcher::Targets & getDestinations()
bool getRemovableMines(const MapCoordinate &pos)
Surface buildGuiIcon(const Surface &image, bool remove=false)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
const char * savegameextension
void executeUserAction(tuseractions action)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
vector< ConstructUnitCommand::ProductionEntry > Producables
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
const VehicleType * getVehicletype()
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
The map. THE central structure of ASC, which holds everything not globally available together...
void savegame(const ASCString &name, GameMap *gamemap)
saves the game located in actmap to the savegame file name
MapField * getField(int x, int y)
ASCString name
The name of the object.
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
virtual MapCoordinate3D getPosition() const =0