Updated to include tests for Gentoo installation
[crack-attack.git] / src / MetaState.h
blobc85a8504436b166fc7fcea08fcb800623f4b6d63
1 /*
2 * MetaState.h
3 * Daniel Nelson - 8/24/0
5 * Copyright (C) 2000 Daniel Nelson
6 * Copyright (C) 2004 Andrew Sayman
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 * Daniel Nelson - aluminumangel.org
23 * 174 W. 18th Ave.
24 * Columbus, OH 43210
27 #ifndef METASTATE_H
28 #define METASTATE_H
30 using namespace std;
32 #include "Game.h"
34 // program states
35 #define MS_BOTH_KEY_WAIT (1 << 0)
36 #define MS_REMOTE_KEY_WAIT (1 << 1)
37 #define MS_LOCAL_KEY_WAIT (1 << 2)
38 #define MS_GAME_OVER_KEY_WAIT (1 << 3)
39 #define MS_GAME_OVER_ANY_KEY_WAIT (1 << 4)
40 #define MS_READY_GAME_START (1 << 5)
41 #define MS_CELEBRATION_WAIT (1 << 6)
42 #define MS_GAME_PLAY (1 << 7)
43 #define MS_CONCESSION (1 << 8)
45 /* static */ class MetaState {
46 public:
47 static void programStart ( int _mode,
48 char player_name[GC_PLAYER_NAME_LENGTH],
49 int width,
50 int height);
51 static void programEnd ( );
52 static void gameStart ( );
53 static void gameWon ( );
54 static void gameLoss ( );
55 static void gameFinish ( );
57 static void celebrationComplete ( );
59 static void localKeyPressed ( bool esc );
60 static void remoteKeyPressed ( );
61 static void remoteReady ( );
63 // set to Game::time_step upon game finish
64 static int final_time_step;
66 // current game state - playing, local key wait, ...
67 static int state;
69 // global game mode - server, client, solo, ...
70 static int mode;
72 // player name
73 static char player_name[GC_PLAYER_NAME_LENGTH];
76 #endif