original 1.0.1 release
[xwelltris.git] / src / main.cxx
blobd5abf1502f6d4dfbbdb2fb02d2b48d07e1579449
1 // docm_prefix(///)
2 /****************************************************************************
3 * Copyright (C) 2002 by Leo Khramov
4 * email: leo@xnc.dubna.su
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 ****************************************************************************/
16 // $Id: main.cxx,v 1.3 2003/02/19 09:51:39 leo Exp $
18 /// module description
19 /// Main module - init the game, create main objects and entering in event loop
21 #include "wellengine.h"
22 #include "wellclass.h"
23 #include "wellintro.h"
25 WellBase *game_object;
26 WellIntro *game_intro;
28 //===========================================================================
29 /// global main(int, char**)
30 /// main function - start of the game
31 /// tags main
32 int main(int argc, char** argv)
34 default_well_engine=new_well_engine(argc,argv);
36 game_intro= default_well_engine->new_well_intro();
37 default_top_nine=default_well_engine->new_well_top_nine();
38 game_object= default_well_engine->new_well_base();
40 default_top_nine->load_scores();
41 game_intro->set_well_base(game_object);
42 game_object->init(default_well_engine);
44 game_object->set_object_on_game_over(ObjectCaller(default_top_nine,
45 &WellObject::show_by_call));
47 game_intro->set_object_on_new_game(ObjectCaller(game_object,
48 &WellObject::process_event));
50 game_intro->set_object_on_top_nine(ObjectCaller(default_top_nine,
51 &WellObject::show_by_call));
53 default_top_nine->set_object_on_exit(ObjectCaller(game_intro,
54 &WellObject::show_by_call));
55 default_well_engine->show_main();
56 game_intro->show();
58 default_well_engine->event_loop();
60 default_top_nine->save_scores();
61 game_intro->save_options();
63 delete game_object;
64 delete default_top_nine;
65 delete default_well_engine;
66 return 0;