File: GameBridge.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 (41 lines) | stat: -rw-r--r-- 1,273 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
#ifndef GAMEBRIDGE_H
#define GAMEBRIDGE_H

#include "GameInterface.h"

//----------------------------------------------------------------------------
class GameBridge : public GameInterface
{
    SINGLETON_OBJECT(GameBridge);

  public:
    //------------------------------------------------------------------------
    GameBridge();
    ~GameBridge();

    //------------------------------------------------------------------------
    Uint16 getPlayGroundXTiles() const;
    Uint16 getPlayGroundYTiles() const;

    void addXGravityToPlayGround(Uint16 x, Uint16 y, int increment);
    void addYGravityToPlayGround(Uint16 x, Uint16 y, int increment);

    int getXGravity(const SDL_Rect &r) const;
    int getYGravity(const SDL_Rect &r) const;
    int getXVelocity(const SDL_Rect &r) const;
    int getYVelocity(const SDL_Rect &r) const;
    unsigned getFriction(const SDL_Rect &r) const;

    bool isBackgroundBetween(Uint16 x1, Uint16 y1, Uint16 x2, Uint16 y2) const;

    const Platform *isInLandingZone(const Ship *s) const;

    const Ship *getPlayerShip() const;

    void onShipTakeoff(const Ship *s);
    void onShipLanded(Ship *s, const Platform *platform);
    void onShipFiring(const Ship *s);
    void onShipOutOfFuel(const Ship *s);
};

#endif //GAMEBRIDGE_H