Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-12-25 12:13:56 +0000
committerStijn Buys <ingar@osirion.org>2008-12-25 12:13:56 +0000
commitbfa10f9990a8a045b03474d11af75984c12a856a (patch)
tree87ff30329be78b8012d545b097b669b746ab0fc0 /src/game/base/shipmodel.h
parent164e3c5b1cd9e6d6f7ca26964df4c54394eb1c84 (diff)
Improved list_zone, list_ships
Ship price and cargo size
Diffstat (limited to 'src/game/base/shipmodel.h')
-rw-r--r--src/game/base/shipmodel.h64
1 files changed, 51 insertions, 13 deletions
diff --git a/src/game/base/shipmodel.h b/src/game/base/shipmodel.h
index 6452b8d..c194dc0 100644
--- a/src/game/base/shipmodel.h
+++ b/src/game/base/shipmodel.h
@@ -19,42 +19,70 @@ public:
ShipModel();
~ShipModel();
+ void print();
+
/// acceleration
- inline float acceleration() const { return shipmodel_acceleration; }
+ inline const float acceleration() const { return shipmodel_acceleration; }
/// maximum speed
- inline float maxspeed() const { return shipmodel_maxspeed; }
+ inline const float maxspeed() const { return shipmodel_maxspeed; }
/// turn speed in rotations per second
- inline float turnspeed() const { return shipmodel_turnspeed; }
+ inline const float turnspeed() const { return shipmodel_turnspeed; }
/// label of the ship model
- inline std::string const &label() const { return shipmodel_label; }
+ inline const std::string &label() const { return shipmodel_label; }
/// name of the ship model
- inline std::string const & name() const { return shipmodel_name; }
+ inline const std::string & name() const { return shipmodel_name; }
/// name of the model of the ship
- inline std::string const & modelname() const { return shipmodel_modelname; }
+ inline const std::string & modelname() const { return shipmodel_modelname; }
+
+ /// price of the ship
+ inline const long price() const { return shipmodel_price; }
+
+ /// size of the cargo hold
+ inline const float maxcargo() const { return shipmodel_maxcargo; }
+
+ /// set acceleration
+ inline void set_acceleration(const float acceleration) { shipmodel_acceleration = acceleration; }
+
+ /// set maximum speed
+ inline void set_maxspeed(const float maxspeed) { shipmodel_maxspeed = maxspeed; }
+
+ /// set turn speed
+ inline void set_turnspeed(const float turnspeed) { shipmodel_turnspeed = turnspeed; }
+
+ /// set price
+ inline void set_price(const long price) { shipmodel_price = price; }
+
+ /// set size of the cargo hold
+ inline void set_maxcargo(const float maxcargo) { shipmodel_maxcargo = maxcargo; }
+
+ /// indicates of this model can be equiped with a jump drive
+ bool shipmodel_jumpdrive;
- float shipmodel_acceleration;
- float shipmodel_maxspeed;
- float shipmodel_turnspeed;
std::string shipmodel_label;
std::string shipmodel_name;
std::string shipmodel_modelname;
- /// indicates of this model can be equiped with a jump drive
- bool shipmodel_jumpdrive;
+ /* ---- static registry ------------------------------------ */
+
+ typedef std::map<std::string, ShipModel *>::iterator iterator;
+ /// find an exact match
static ShipModel *find(ShipModel *shipmodel);
+
+ /// find an exact match
static ShipModel *find(const std::string label);
+ /// search the registry
+ static ShipModel *search(const std::string label);
+
/// the ship model registry
static std::map<std::string, ShipModel *> registry;
- typedef std::map<std::string, ShipModel *>::iterator iterator;
-
/// clear the ship model registry
static void clear();
@@ -63,6 +91,16 @@ public:
/// add a new ship model
static void add(ShipModel *shipmodel);
+
+private:
+
+ float shipmodel_acceleration;
+ float shipmodel_maxspeed;
+ float shipmodel_turnspeed;
+ float shipmodel_maxcargo;
+
+ long shipmodel_price;
+
};
}