Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Cargo Class Reference

#include <images.h>

Public Member Functions

 Cargo ()
 
 Cargo (std::string name, std::string cc, float pp, int qq, float mm, float vv, float func, float maxfunc)
 
 Cargo (std::string name, std::string cc, float pp, int qq, float mm, float vv)
 
float GetFunctionality ()
 
float GetMaxFunctionality ()
 
void SetFunctionality (float func)
 
void SetMaxFunctionality (float func)
 
void SetMissionFlag (bool flag)
 
void SetPrice (float price)
 
void SetMass (float mass)
 
void SetVolume (float vol)
 
void SetQuantity (int quantity)
 
void SetContent (const std::string &content)
 
void SetCategory (const std::string &category)
 
bool GetMissionFlag () const
 
const std::string & GetCategory () const
 
const std::string & GetContent () const
 
const std::string & GetDescription () const
 
std::string GetCategoryPython ()
 
std::string GetContentPython ()
 
std::string GetDescriptionPython ()
 
int GetQuantity () const
 
float GetVolume () const
 
float GetMass () const
 
float GetPrice () const
 
bool operator== (const Cargo &other) const
 
bool operator< (const Cargo &other) const
 

Public Attributes

StringPool::Reference content
 
StringPool::Reference category
 
StringPool::Reference description
 
int quantity
 
float price
 
float mass
 
float volume
 
bool mission
 
bool installed
 
float functionality
 
float maxfunctionality
 

Detailed Description

Definition at line 131 of file images.h.

Constructor & Destructor Documentation

Cargo::Cargo ( )
inline

Definition at line 145 of file images.h.

References functionality, installed, mass, maxfunctionality, mission, price, quantity, and volume.

146  {
147  mass = 0;
148  volume = 0;
149  price = 0;
150  quantity = 1;
151  mission = false;
152  installed = false;
154  }
Cargo::Cargo ( std::string  name,
std::string  cc,
float  pp,
int  qq,
float  mm,
float  vv,
float  func,
float  maxfunc 
)
inline

Definition at line 155 of file images.h.

References functionality, installed, mass, maxfunctionality, mission, price, quantity, and volume.

155  :
156  content( name )
157  , category( cc )
158  {
159  quantity = qq;
160  price = pp;
161  mass = mm;
162  volume = vv;
163  mission = false;
164  installed = false;
165  functionality = func;
166  maxfunctionality = maxfunc;
167  }
Cargo::Cargo ( std::string  name,
std::string  cc,
float  pp,
int  qq,
float  mm,
float  vv 
)
inline

Definition at line 168 of file images.h.

References installed, mass, mission, price, quantity, and volume.

168  :
169  content( name )
170  , category( cc )
171  {
172  quantity = qq;
173  price = pp;
174  mass = mm;
175  volume = vv;
176  mission = false;
177  installed = false;
178  }

Member Function Documentation

std::string Cargo::GetCategoryPython ( )
inline

Definition at line 240 of file images.h.

References GetCategory().

241  {
242  return GetCategory();
243  }
std::string Cargo::GetContentPython ( )
inline

Definition at line 244 of file images.h.

References GetContent().

245  {
246  return GetContent();
247  }
const std::string& Cargo::GetDescription ( ) const
inline
std::string Cargo::GetDescriptionPython ( )
inline

Definition at line 248 of file images.h.

References GetDescription().

249  {
250  return GetDescription();
251  }
float Cargo::GetFunctionality ( )
inline

Definition at line 179 of file images.h.

References functionality.

180  {
181  return functionality;
182  }
float Cargo::GetMass ( ) const
inline

Definition at line 260 of file images.h.

References mass.

Referenced by NetServer::addUnitCargoSnapshot().

261  {
262  return mass;
263  }
float Cargo::GetMaxFunctionality ( )
inline

Definition at line 183 of file images.h.

References maxfunctionality.

184  {
185  return maxfunctionality;
186  }
bool Cargo::GetMissionFlag ( ) const
inline

Definition at line 224 of file images.h.

References mission.

Referenced by NetServer::addUnitCargoSnapshot().

225  {
226  return this->mission;
227  }
float Cargo::GetPrice ( ) const
inline

Definition at line 264 of file images.h.

References price.

Referenced by NetServer::addUnitCargoSnapshot().

265  {
266  return price;
267  }
int Cargo::GetQuantity ( ) const
inline

Definition at line 252 of file images.h.

References quantity.

Referenced by NetServer::addUnitCargoSnapshot().

253  {
254  return quantity;
255  }
float Cargo::GetVolume ( ) const
inline

Definition at line 256 of file images.h.

References volume.

Referenced by NetServer::addUnitCargoSnapshot().

257  {
258  return volume;
259  }
bool Cargo::operator< ( const Cargo other) const
inline

Definition at line 272 of file images.h.

References category, and content.

273  {
274  return (category == other.category) ? (content < other.content) : (category < other.category);
275  }
bool Cargo::operator== ( const Cargo other) const
inline

Definition at line 268 of file images.h.

References content.

269  {
270  return content == other.content;
271  }
void Cargo::SetCategory ( const std::string &  category)
inline

Definition at line 219 of file images.h.

References category.

220  {
221  this->category = category;
222  }
void Cargo::SetContent ( const std::string &  content)
inline

Definition at line 215 of file images.h.

References content.

216  {
217  this->content = content;
218  }
void Cargo::SetFunctionality ( float  func)
inline

Definition at line 187 of file images.h.

References functionality.

188  {
189  functionality = func;
190  }
void Cargo::SetMass ( float  mass)
inline

Definition at line 203 of file images.h.

References mass.

204  {
205  this->mass = mass;
206  }
void Cargo::SetMaxFunctionality ( float  func)
inline

Definition at line 191 of file images.h.

References maxfunctionality.

192  {
193  maxfunctionality = func;
194  }
void Cargo::SetMissionFlag ( bool  flag)
inline

Definition at line 195 of file images.h.

References mission.

196  {
197  this->mission = flag;
198  }
void Cargo::SetPrice ( float  price)
inline

Definition at line 199 of file images.h.

References price.

200  {
201  this->price = price;
202  }
void Cargo::SetQuantity ( int  quantity)
inline

Definition at line 211 of file images.h.

References quantity.

212  {
213  this->quantity = quantity;
214  }
void Cargo::SetVolume ( float  vol)
inline

Definition at line 207 of file images.h.

References volume.

208  {
209  this->volume = vol;
210  }

Member Data Documentation

float Cargo::functionality

Definition at line 143 of file images.h.

Referenced by AddCarg(), Cargo(), GetFunctionality(), SetFunctionality(), and Unit::WriteUnitString().

bool Cargo::installed

Definition at line 142 of file images.h.

Referenced by AddCarg(), Cargo(), Unit::Upgrade(), and Unit::WriteUnitString().

float Cargo::maxfunctionality

The documentation for this class was generated from the following file: