Advanced Strategic Command
messages.h
Go to the documentation of this file.
1 /***************************************************************************
2  messages.h - description
3  -------------------
4  begin : Thu Feb 21 2002
5  copyright : (C) 2002 by Martin Bickel
6  email : bickel@asc-hq.org
7  ***************************************************************************/
12 /***************************************************************************
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  ***************************************************************************/
20 
21 
22 #ifndef messages_h_included
23  #define messages_h_included
24 
25  #include "typen.h"
26 
27 class GameMap;
28 
30 class Message {
31  ASCString bitMap2PlayerName( int p, const GameMap* gamemap ) const;
32  public:
34  int from;
35 
36  ASCString getFromText( const GameMap* gamemap ) const;
37  ASCString getCcText( const GameMap* gamemap ) const { return bitMap2PlayerName( cc, gamemap ); };
38  ASCString getToText( const GameMap* gamemap ) const { return bitMap2PlayerName( to, gamemap ); };
39 
41  int to;
42 
44  int cc;
45 
46 
48  time_t time;
49 
52 
54  int id;
55 
58 
60  bool reminder;
61 
62  Message ( GameMap* spfld );
63 
70  Message ( const ASCString& msg, GameMap* gamemap,int rec, int from = 512 );
71 };
72 
74 typedef list<Message*> MessagePntrContainer;
75 
76 
77 
78 #endif
the time in ASC, measured in turns and moves
Definition: typen.h:178
ASCString text
the body of the message
Definition: messages.h:51
time_t time
the real world time the message was written
Definition: messages.h:48
int from
bitmapped variable showing the sender of the message. Bit 0 - 7 are the players, Bit 9 is the system...
Definition: messages.h:34
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
int to
bitmapped variable showing the recipients of the message.
Definition: messages.h:38
ASCString getToText(const GameMap *gamemap) const
Definition: messages.h:38
int cc
bitmapped variable showing the recipients of the message.
Definition: messages.h:44
int id
an id that identifies the message. It is assigned automatically
Definition: messages.h:54
GameTime gametime
the game time the messages was written
Definition: messages.h:57
list< Message * > MessagePntrContainer
Definition: messages.h:74
ASCString getCcText(const GameMap *gamemap) const
Definition: messages.h:37
A Message to a player. It may either be send by another player or by the system.
Definition: messages.h:30
bool reminder
reminders are special messages that the players sends to himself, to be read the next turn ...
Definition: messages.h:60
Message(GameMap *spfld)
Definition: messages.cpp:24
PointerList< Message * > MessageContainer
Definition: messages.h:73
ASCString getFromText(const GameMap *gamemap) const
Definition: messages.cpp:72
The map. THE central structure of ASC, which holds everything not globally available together...
Definition: gamemap.h:182