| 1 |
|
| 2 |
|
| 3 |
#ifndef MESSAGES_H |
| 4 |
#define MESSAGES_H |
| 5 |
|
| 6 |
#include <string> |
| 7 |
#include <map> |
| 8 |
|
| 9 |
#include <SDL/SDL.h> |
| 10 |
|
| 11 |
class Universe; |
| 12 |
class Game; |
| 13 |
|
| 14 |
class Message { |
| 15 |
private: |
| 16 |
Uint8 r, g, b; |
| 17 |
Uint32 displayTime; |
| 18 |
std::string message; |
| 19 |
public: |
| 20 |
Message( Uint32, std::string message, Uint32 displayTime, Uint8 r, Uint8 g, Uint8 b ); |
| 21 |
Message( Uint32, std::string message, Uint32 displayTime, Uint32 color ); |
| 22 |
Message( Uint32, std::string message, Uint8 r, Uint8 g, Uint8 b ); |
| 23 |
Message( Uint32, std::string message, Uint32 color ); |
| 24 |
void render(int &x, int &y, int time ); |
| 25 |
Uint32 getDisplayTime(); |
| 26 |
}; |
| 27 |
|
| 28 |
class Messages : std::multimap< Uint32, Message > { |
| 29 |
|
| 30 |
private: |
| 31 |
Message fleetStrengthMessage; |
| 32 |
|
| 33 |
public: |
| 34 |
Messages(); |
| 35 |
~Messages(); |
| 36 |
void addMessage( Uint32 time, Message m ); |
| 37 |
void cleanup(Uint32); |
| 38 |
void render(Uint32); |
| 39 |
|
| 40 |
|
| 41 |
void setFleetStrengthMessage( Message m ); |
| 42 |
|
| 43 |
}; |
| 44 |
|
| 45 |
void MSGwon(Game *, int, int); |
| 46 |
void MSGlost(Game *); |
| 47 |
void MSGstart(Game *); |
| 48 |
#endif |