Add pointlog2svg utility for the thesis
[numtypysics.git] / Game.h
blob06fb8904c206d6ac594e7c986f6bf060831ce9e6
1 /*
2 * This file is part of NumptyPhysics
3 * Copyright (C) 2008 Tim Edmonds
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 3 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
17 #ifndef GAME_H
18 #define GAME_H
20 #include "Levels.h"
22 #define MAX_ROPE_PARTS 50
24 /* Strokes with more points than this value can't be canceled */
25 #define CANCEL_THRESHOLD_NUM_POINTS 20
27 /* Strokes with less points than this value can't be finished */
28 #define FINISH_THRESHOLD_NUM_POINTS 4
30 class Widget;
31 class Canvas;
33 struct GameControl
35 GameControl() : m_quit(false),
36 m_edit( false ),
37 m_refresh( true ),
38 m_fade(false),
39 m_colour( 2 ),
40 m_strokeFixed( false ),
41 m_strokeSleep( false ),
42 m_strokeDecor( false ),
43 m_level(0)
45 virtual ~GameControl() {}
46 virtual bool save( const char *file=NULL ) { return false; }
47 virtual bool send() { return false; }
48 virtual bool load( const char* file ) { return false; }
49 virtual void gotoLevel( int l, bool replay=false ) {}
50 Levels& levels() { return *m_levels; }
51 virtual bool renderScene( Canvas& c, int level ) =0;
52 bool m_quit;
53 bool m_edit;
54 bool m_refresh;
55 bool m_fade;
56 int m_colour;
57 bool m_strokeFixed;
58 bool m_strokeSleep;
59 bool m_strokeDecor;
60 Levels*m_levels;
61 int m_level;
65 Widget * createGameLayer( Levels* levels, int width, int height, bool fullscreen );
69 #endif //GAME_H