typen.cpp File Reference

#include <stdio.h>
#include <cstring>
#include <cmath>
#include "global.h"
#include "ascstring.h"
#include "stringtokenizer.h"
#include "misc.h"
#include "typen.h"
#include "graphicset.h"
#include "vehicletype.h"
#include "buildingtype.h"
#include "textfileparser.h"
#include "textfile_evaluation.h"

Include dependency graph for typen.cpp:

Go to the source code of this file.

Functions

int getheightdelta (int height1, int height2)
 calculate the height difference between two levels of height.
Resources operator- (const Resources &res1, const Resources &res2)
Resources operator- (const Resources &res1)
Resources operator+ (const Resources &res1, const Resources &res2)
Resources operator * (const Resources &res1, float a)
Resources operator/ (const Resources &res1, float a)
vector< IntRangeString2IntRangeVector (const ASCString &t)
 parses a string repesenting a number of int ranges Example input: "10-20; 25 ; 30-125"
ASCString heightToString (int bitmappedHeight)

Variables

const char * choehenstufen [choehenstufennum] = {"deep submerged", "submerged", "floating", "ground level", "low-level flight", "flight", "high-level flight", "orbit"}
 the names of the different levels of height
const char * cmovemalitypes [cmovemalitypenum]
 the names of the different MoveMalusTypes
const char * moveMaliTypeIcons [cmovemalitypenum]
 filenames of icons representing the varios movemalus types
const char * cnetcontrol [cnetcontrolnum]
 The actions that can be used to control a ResourceNet.
const char * cgeneralnetcontrol [4] = { "store", "move out", "stop storing", "stop using" }
const char * cwettertypen [cwettertypennum] = {"dry (standard)","light rain", "heavy rain", "few snow", "lot of snow", "lot of snow + ice"}
 the names of the different weather
const char * resourceNames [3] = {"energy", "material", "fuel"}
 the names of the different resources. Redundent, as we already have Resources::name
const int experienceDecreaseDamageBoundaries [experienceDecreaseDamageBoundaryNum] = { 80, 60, 40, 20 }
 when repairing a unit, the experience of the unit is decreased by one when passing each of these damage levels
const int directionangle [sidenum]
const int csolarkraftwerkleistung [cwettertypennum] = { 1024, 512, 256, 756, 384, 384 }


Function Documentation

int getheightdelta ( int  height1,
int  height2 
)

calculate the height difference between two levels of height.

Since floating and ground based are assumed to be the same effective height, a simple subtraction isn't sufficient. Height is a numeric (and not bitmapped) value

Definition at line 95 of file typen.cpp.

ASCString heightToString ( int  bitmappedHeight  ) 

Definition at line 388 of file typen.cpp.

References choehenstufen.

Referenced by JumpDriveCommand::available().

Resources operator * ( const Resources res1,
float  a 
)

Definition at line 231 of file typen.cpp.

References Resources::resource(), and resourceTypeNum.

Resources operator+ ( const Resources res1,
const Resources res2 
)

Definition at line 224 of file typen.cpp.

Resources operator- ( const Resources res1  ) 

Definition at line 218 of file typen.cpp.

Resources operator- ( const Resources res1,
const Resources res2 
)

Definition at line 211 of file typen.cpp.

Resources operator/ ( const Resources res1,
float  a 
)

Definition at line 239 of file typen.cpp.

References Resources::resource(), and resourceTypeNum.

vector<IntRange> String2IntRangeVector ( const ASCString t  ) 

parses a string repesenting a number of int ranges Example input: "10-20; 25 ; 30-125"

Definition at line 318 of file typen.cpp.

References atoi(), and StringSplit::getNextToken().

Referenced by IntRangeArrayProperty::operation_eq().


Variable Documentation

const char* cgeneralnetcontrol[4] = { "store", "move out", "stop storing", "stop using" }

Definition at line 75 of file typen.cpp.

const char* choehenstufen[choehenstufennum] = {"deep submerged", "submerged", "floating", "ground level", "low-level flight", "flight", "high-level flight", "orbit"}

the names of the different levels of height

Definition at line 39 of file typen.cpp.

Referenced by heightToString(), and AI::showFieldInformation().

const char* cmovemalitypes[cmovemalitypenum]

Initial value:

 { "default",
                                                 "light tracked vehicle", "medium tracked vehicle", "heavy tracked vehicle",
                                                 "light wheeled vehicle", "medium wheeled vehicle", "heavy wheeled vehicle",
                                                 "trooper",               "rail vehicle",           "medium aircraft",
                                                 "medium ship",           "building / turret / object", "light aircraft",
                                                 "heavy aircraft",        "light ship",             "heavy ship",  "helicopter",
                                                 "hoovercraft"  }
the names of the different MoveMalusTypes

See also:
MoveMalusType

Definition at line 43 of file typen.cpp.

Referenced by DataTab::setData(), UnitInfoDialog::UnitInfoDialog(), CargoDialog::updateVariables(), CargoDialog::userHandler(), and viewterraininfo().

const char* cnetcontrol[cnetcontrolnum]

Initial value:

 { "store energy",           "store material",           "store fuel",
                                            "move out all energy",           "move out all material",           "move out all fuel",
                                            "stop storing energy", "stop storing material", "stop storing fuel",
                                            "stop energy extraction", "stop material extraction", "stop fuelextraction" }
The actions that can be used to control a ResourceNet.

Definition at line 71 of file typen.cpp.

const int csolarkraftwerkleistung[cwettertypennum] = { 1024, 512, 256, 756, 384, 384 }

Definition at line 90 of file typen.cpp.

Referenced by SolarPowerplant::getPlus().

const char* cwettertypen[cwettertypennum] = {"dry (standard)","light rain", "heavy rain", "few snow", "lot of snow", "lot of snow + ice"}

the names of the different weather

Definition at line 78 of file typen.cpp.

Referenced by AddWeatherAreaDialog::AddWeatherAreaDialog(), chooseWeather(), WeatherAreaInformation::getInformation(), Maped_MainScreenWidget::Maped_MainScreenWidget(), viewterraininfo(), and WeatherDialog::WeatherDialog().

const int directionangle[sidenum]

Initial value:

 
 { 0, -53, -127, -180, -180 -53 , -180 -127 }

Definition at line 84 of file typen.cpp.

Referenced by UnitPropertyEditor::init(), and ContainerBase::paintField().

const int experienceDecreaseDamageBoundaries[experienceDecreaseDamageBoundaryNum] = { 80, 60, 40, 20 }

when repairing a unit, the experience of the unit is decreased by one when passing each of these damage levels

Definition at line 82 of file typen.cpp.

Referenced by RepairUnitCommand::go(), and Vehicle::postRepair().

const char* moveMaliTypeIcons[cmovemalitypenum]

Initial value:

 { "pad_symbol_default.png",
                                 "pad_symbol_lighttracked.png",
                                 "pad_symbol_mediumtracked.png",
                                 "pad_symbol_heavytracked.png",
                                 "pad_symbol_lightwheeled.png",
                                 "pad_symbol_mediumwheeled.png",
                                 "pad_symbol_heavywheeled.png",
                                 "pad_symbol_trooper.png",
                                 "pad_symbol_rail.png",
                                 "pad_symbol_mediumair.png",
                                 "pad_symbol_mediumship.png",
                                 "pad_symbol_turret.png",
                                 "pad_symbol_lightair.png",
                                 "pad_symbol_heavyair.png",
                                 "pad_symbol_lightship.png",
                                 "pad_symbol_heavyship.png",
                                 "pad_symbol_helicopter.png",
                                 "pad_symbol_hoovercraft.png" }
filenames of icons representing the varios movemalus types

See also:
MoveMalusType

Definition at line 51 of file typen.cpp.

Referenced by CargoDialog::updateVariables(), and CargoDialog::userHandler().

const char* resourceNames[3] = {"energy", "material", "fuel"}

the names of the different resources. Redundent, as we already have Resources::name

Definition at line 79 of file typen.cpp.

Referenced by PutResource::checkbuilding(), GetResource::checkbuilding(), compareMapResources(), getPlayerStrength(), ttributepayments::init(), Resources::name(), resourceComparison(), MiningStation::run(), and Resources::toString().


Generated on Mon May 21 01:44:26 2012 for Advanced Strategic Command by  doxygen 1.5.1