Updated to include tests for Gentoo installation
[crack-attack.git] / src / WinRecord.h
blobc7889b7e7df0dae77b27544470546a1daea7d436
1 /*
2 * WinRecord.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 WINRECORD_H
27 #define WINRECORD_H
29 using namespace std;
31 #include "Game.h"
32 #include "MetaState.h"
34 // game results
35 #define GR_NOT_PLAYED (1 << 0)
36 #define GR_BEING_PLAYED (1 << 1)
37 #define GR_WON (1 << 2)
38 #define GR_LOST (1 << 3)
40 class Star {
41 public:
42 GLfloat a;
43 GLfloat v_a;
44 GLfloat size;
45 GLfloat v_size;
48 /* static */ class WinRecord {
49 public:
50 static void initialize ( );
51 static void timeStep ( );
52 static void gameStart ( );
53 static void gameWon ( );
54 static void gameLoss ( );
56 static inline bool isMatchFinished ( )
58 if (concession) return true;
59 if (MetaState::mode & CM_SOLO) return true;
60 if (won) {
61 if (games_won == 1 + GC_GAMES_PER_MATCH / 2)
62 return true;
63 } else
64 if (games_lost == 1 + GC_GAMES_PER_MATCH / 2)
65 return true;
66 return false;
69 static inline void matchConceded ( )
71 concession = true;
74 static int current_game;
75 static bool won;
76 static bool concession;
77 static int games_won;
78 static int games_lost;
80 static int record[GC_GAMES_PER_MATCH];
82 static Star stars[GC_GAMES_PER_MATCH];
84 static int dynamic_star;
85 static int displaced_star;
86 static GLfloat win_star_x;
87 static GLfloat win_star_y;
88 static GLfloat win_star_v_x;
89 static GLfloat win_star_v_y;
90 static GLfloat old_star_a;
91 static GLfloat old_star_size;
93 static bool draw_old_star;
96 #endif