Updates for a new interface to the networking
[crack-attack.git] / src / Controller.h
blob35fe63100589e0c6b3be2b1e23c88e1305609674
1 /*
2 * Controller.h
3 * Daniel Nelson - 8/24/0
5 * Copyright (C) 2000 Daniel Nelson
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * Daniel Nelson - aluminumangel.org
22 * 174 W. 18th Ave.
23 * Columbus, OH 43210
26 #ifndef CONTORLLER_H
27 #define CONTORLLER_H
29 using namespace std;
31 #define CC_LEFT (1 << 0)
32 #define CC_RIGHT (1 << 1)
33 #define CC_UP (1 << 2)
34 #define CC_DOWN (1 << 3)
35 #define CC_SWAP (1 << 4)
36 #define CC_ADVANCE (1 << 5)
37 #define CC_PAUSE (1 << 6)
39 /* static */ class Controller {
40 public:
41 static void gameStart ( );
42 static void keyboardPlay ( unsigned char key, int x, int y );
43 static void keyboardUpPlay ( unsigned char key, int x, int y );
44 static void specialPlay ( int key, int x, int y );
45 static void specialUpPlay ( int key, int x, int y );
46 static void keyboardMeta ( unsigned char key, int x, int y );
47 static void keyboardUpMeta ( unsigned char key, int x, int y );
48 static void specialMeta ( int key, int x, int y );
49 static void specialUpMeta ( int key, int x, int y );
50 static void entry ( int mouse_state );
52 static inline int moveCommand ( )
53 { return state & (CC_LEFT | CC_RIGHT | CC_UP | CC_DOWN); }
55 static inline bool swapCommand ( )
56 { return state & CC_SWAP; }
58 static inline bool advanceCommand ( )
59 { return state & CC_ADVANCE; }
61 static inline bool pauseCommand ( )
62 { return state & CC_PAUSE; }
64 private:
65 static int state;
68 #endif