summaryrefslogtreecommitdiff
path: root/source/logic/Checkpoint.h
blob: f6dfeb37d393d56e03e6c6541d007d2a319a40a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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