File: SinglePlayerGame.h

package info (click to toggle)
moagg 0.18-6
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,924 kB
  • ctags: 4,059
  • sloc: cpp: 23,814; sh: 2,652; makefile: 283
file content (62 lines) | stat: -rw-r--r-- 1,639 bytes parent folder | download | duplicates (3)
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
54
55
56
57
58
59
60
61
62
#ifndef SINGLEPLAYERGAME_H
#define SINGLEPLAYERGAME_H

#include <string>
#include <list>

#include "LevelReader.h"

//----------------------------------------------------------------------------
class SinglePlayerGame
{
  public:
    //------------------------------------------------------------------------
    ~SinglePlayerGame();

    //------------------------------------------------------------------------
    bool hasMoreLevels() const;

    //------------------------------------------------------------------------
    void nextLevel();


    //------------------------------------------------------------------------
    inline const std::string &getMission() const
    {
        return m_mission;
    }

    inline const std::string &getLevel() const
    {
        return *m_levelIter;
    }


    //------------------------------------------------------------------------
    static void init(const char *mission, unsigned level);

    //------------------------------------------------------------------------
    static void destroy();

    //------------------------------------------------------------------------
    static inline SinglePlayerGame *getInstance()
    {
        return sm_instance;
    }

  protected:

    //------------------------------------------------------------------------
    SinglePlayerGame(const char *mission, unsigned level);

  private:

    //------------------------------------------------------------------------
    static SinglePlayerGame *sm_instance;

    std::string m_mission;
    LevelReader m_levelReader;
    LevelReader::iterator m_levelIter;
};

#endif //SINGLEPLAYERGAME_H