summaryrefslogtreecommitdiff
path: root/source/logic/Checkpoint.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/logic/Checkpoint.h')
-rw-r--r--source/logic/Checkpoint.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/source/logic/Checkpoint.h b/source/logic/Checkpoint.h
new file mode 100644
index 0000000..f6dfeb3
--- /dev/null
+++ b/source/logic/Checkpoint.h
@@ -0,0 +1,53 @@
+#ifndef CHECKPOINT_H
+#define CHECKPOINT_H
+
+#include "../logic/GameObject.h"
+#include "../presentation/BitmapStore.h"
+
+/**
+* @brief GameObject that the player needs to pick up by driving over.
+*
+* The level is complete when all checkpoints have been collected.
+*
+* @author Justin Wernick
+* @author David Schneider
+*/
+class Checkpoint: public GameObject
+{
+ public:
+ /**
+ * @brief Function for accessing the number of checkpoints that currently exist.
+ *
+ * @return The number of checkpoints that currently exist.
+ */
+ static int checkpointCount();
+
+ /**
+ * @brief Creates a checkpoint at the given coordinates.
+ *
+ * @param [in] x x coordinate of Checkpoint's position.
+ * @param [in] y y coordinate of Checkpoint's position.
+ */
+ Checkpoint(double x, double y);
+ /**
+ * @brief Copy constuctor, overwritten to include in the counting of Checkpoints.
+ */
+ Checkpoint(const Checkpoint& ref);
+
+ //assignment operator has been left with the compiler generated version.
+
+ /**
+ * @brief Destructor, decreases the number of Checkpoints in existence.
+ */
+ ~Checkpoint();
+
+ /**
+ * @brief Function to be called when a PlayerCar collects the Checkpoint.
+ */
+ void collect();
+
+ private:
+ static int _checkpointCount; ///< Count of the number of Checkpoints currently in existence.
+};
+
+#endif // CHECKPOINT_H