StarTrekV3_Linux  Version3
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Pages
Communication.h
Go to the documentation of this file.
1 //
2 // ___.--------._____________,------' -----.`----._
3 // \ ` - . _ /\
4 // `.__________ ` - | | __,---"-._
5 // `-----------.______ ,'_/ ________,------'___________`----.___________
6 // `-----.____,' \===========================================/
7 // | :| >--------------.----------.---------------'
8 // / :| _,--' ,--' `--.__.--'
9 // / : |--'______________/_
10 // ,---,' : \__________________`--.
11 // `__________ |/|
12 // `------._ |\|
13 // `--._________,-'
14 //
15 //
16 //
17 // Credits go to Paramount pictures for the star - trek concept and universe.
18 
19 
20 // Copyright (C) 2015 - 2016 E.J.M. Martens
21 //
22 // This program is free software; you can redistribute it and/or
23 // modify it under the terms of the GNU General Public License
24 // as published by the Free Software Foundation; either version 2
25 // of the License, or (at your option) any later version.
26 //
27 // This program is distributed in the hope that it will be useful,
28 // but WITHOUT ANY WARRANTY; without even the implied warranty of
29 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 // GNU General Public License for more details.
31 //
32 // You should have received a copy of the GNU General Public License
33 // along with this program; if not, write to the Free Software
34 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
35 
36 
37 
38 #ifndef _COMMUNICATION_
39 #define _COMMUNICATION_
40 
41 #include <stdio.h>
42 #include <iostream>
43 #include <allegro5/allegro.h>
44 #include <allegro5/allegro_image.h>
45 #include <allegro5/allegro_primitives.h>
46 #include <allegro5/allegro_font.h>
47 #include <allegro5/allegro_ttf.h>
48 #include <allegro5/allegro_audio.h>
49 #include <allegro5/allegro_acodec.h>
50 #include <list>
51 #include <string>
52 #include <vector>
53 #include "types.h"
54 
55 using namespace std;
56 
58 {
59  CREW_KIRK = 0,
64  CREW_SULU = 5,
66 };
67 
68 class Communication;
69 
70 class Message
71 {
72  private:
73  Communication * m_pOwner;
74  int m_nID;
75  crewmember m_crew;
76  string m_strMessage;
77  ALLEGRO_BITMAP * m_pImage;
78 
79  protected:
80 
81  public:
82  Message(int a_nID, string a_strMessage, crewmember a_crew);
83  ~Message();
84 
85  void Draw(int a_nX, int a_nY);
86 
87  static bool Init();
88 
89  friend class Communication;
90 };
91 
92 
93 
94 
95 
96 
97 
98 
100 {
101 friend class Message;
102 
103 private:
104  int m_nX;
105  int m_nY;
106  int m_nPos;
107  int m_nCounter;
108  list <Message *> messagequeue;
109 
110 ALLEGRO_COLOR m_Color;
111 
112 protected:
113 
114 
115 public:
116  Communication(int a_nX, int a_nY);
117  ~Communication();
118 
119  void AddMessage(int a_nID, crewmember a_CrewMember,const char * a_szMessage);
120  void Draw();
121  void Next();
122  static bool Init();
123 };
124 
125 
126 
127 
128 
129 
130 
131 
132 
133 
134 
135 
136 #endif
Definition: Communication.h:63
Definition: Communication.h:59
Definition: Communication.h:60
Definition: Communication.h:61
Definition: Communication.h:65
Definition: Communication.h:64
static bool Init()
Definition: Communication.cpp:37
Definition: Communication.h:62
Definition: Communication.h:70
Definition: Communication.h:99
friend class Communication
Definition: Communication.h:89
void Draw(int a_nX, int a_nY)
Definition: Communication.cpp:29
crewmember
Definition: Communication.h:57