summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/SimEvent.h
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-04-03 01:31:01 +0200
committerAki <please@ignore.pl>2024-04-03 01:31:01 +0200
commite0f9f411056c235947b809cb21c477aa5acca1b4 (patch)
tree1371e376659d66ec0c881032b6001630aa4f964b /StarsEx/SimEvent.h
parent7f1e5f578ec184ebcbbdcd9f7725619ea426d5e4 (diff)
downloadstarshatter-e0f9f411056c235947b809cb21c477aa5acca1b4.zip
starshatter-e0f9f411056c235947b809cb21c477aa5acca1b4.tar.gz
starshatter-e0f9f411056c235947b809cb21c477aa5acca1b4.tar.bz2
Fixed mission points reward calculation
Diffstat (limited to 'StarsEx/SimEvent.h')
-rw-r--r--StarsEx/SimEvent.h46
1 files changed, 28 insertions, 18 deletions
diff --git a/StarsEx/SimEvent.h b/StarsEx/SimEvent.h
index 66d6342..c8bd092 100644
--- a/StarsEx/SimEvent.h
+++ b/StarsEx/SimEvent.h
@@ -11,14 +11,11 @@
Simulation Universe and Region classes
*/
-#ifndef SimEvent_h
-#define SimEvent_h
+#pragma once
-#include "Types.h"
-#include "List.h"
-#include "Text.h"
+#include <List.h>
+#include <Text.h>
-// +--------------------------------------------------------------------+
class Sim;
class SimRegion;
@@ -28,19 +25,32 @@ class SimHyper;
class CombatGroup;
class CombatUnit;
-// +--------------------------------------------------------------------+
class SimEvent
{
public:
static const char* TYPENAME() { return "SimEvent"; }
- enum EVENT { LAUNCH=1, DOCK, LAND, EJECT, CRASH, COLLIDE, DESTROYED,
- MAKE_ORBIT, BREAK_ORBIT, QUANTUM_JUMP,
- LAUNCH_SHIP, RECOVER_SHIP,
- FIRE_GUNS, FIRE_MISSILE, DROP_DECOY,
- GUNS_KILL, MISSILE_KILL,
- LAUNCH_PROBE, SCAN_TARGET
+ enum EVENT {
+ LAUNCH=1,
+ DOCK,
+ LAND,
+ EJECT,
+ CRASH,
+ COLLIDE,
+ DESTROYED,
+ MAKE_ORBIT,
+ BREAK_ORBIT,
+ QUANTUM_JUMP,
+ LAUNCH_SHIP,
+ RECOVER_SHIP,
+ FIRE_GUNS,
+ FIRE_MISSILE,
+ DROP_DECOY,
+ GUNS_KILL,
+ MISSILE_KILL,
+ LAUNCH_PROBE,
+ SCAN_TARGET,
};
SimEvent(int event, const char* tgt=0, const char* info=0);
@@ -66,7 +76,6 @@ private:
int count;
};
-// +--------------------------------------------------------------------+
class ShipStats
{
@@ -104,6 +113,8 @@ public:
int GetGunHits() const { return gun_hits; }
int GetMissileShots() const { return missile_shots; }
int GetMissileHits() const { return missile_hits; }
+ long double FlightTime() const;
+ int EffectivePoints() const;
bool IsPlayer() const { return player; }
@@ -111,7 +122,7 @@ public:
GetEvents() { return events; }
SimEvent* AddEvent(SimEvent* e);
SimEvent* AddEvent(int event, const char* tgt=0, const char* info=0);
- bool HasEvent(int event);
+ bool HasEvent(int event) const;
void SetShipClass(int c) { ship_class = c; }
void SetIFF(int i) { iff = i; }
@@ -129,6 +140,7 @@ public:
void AddMissileHit() { missile_hits++; }
void AddPoints(int p) { points += p; }
void AddCommandPoints(int p) { cmd_points += p; }
+ void SetFlightTime(long double seconds);
private:
Text name;
@@ -155,8 +167,6 @@ private:
int points;
int cmd_points;
+ long double flight_time;
List<SimEvent> events;
};
-
-#endif // SimEvent_h
-