Desterrando el parámetro covered de update y draw
[angry-tux:angry-tux.git] / include / stateInitialDeveloperScreen.h
1 /**
2  * @file stateInitialDeveloperScreen.h
3  * 
4  * @author José Tomás Tocino García
5  * @date 2010
6  *
7  * Copyright (C) 2010 José Tomás Tocino García <theom3ga@gmail.com>
8  * 
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301, USA.
23  */
24
25 #ifndef _STATEINITIALDEVELOPERSCREEN_H_
26 #define _STATEINITIALDEVELOPERSCREEN_H_
27
28 #include "state.h"
29 #include "crono.h"
30
31 #include <boost/scoped_ptr.hpp>
32 #include <Gosu/Gosu.hpp>
33
34 #include "mainMenuState.h"
35
36 class StateDeveloperScreen : public State{
37 public:
38     StateDeveloperScreen(){
39         lDEBUG << Log::CON("StateDeveloperScreen");
40     }
41
42     ~StateDeveloperScreen(){
43         lDEBUG << Log::DES("StateDeveloperScreen");
44     }
45
46     void cleanup(){
47         lDEBUG << "Cleanup...";
48     }
49
50     void loadResources(){
51         image.reset(new Gosu::Image(stateManager_ -> graphics(),
52                                     L"media/developerImage.png"));
53         c.restart();
54     }
55
56     void update(){
57         if(c.elapsed() > 2000){
58             stateManager_ -> popState();
59             stateManager_ -> pushState(boost::make_shared<MainMenuState>());
60             stateManager_ -> pushState(boost::make_shared<PopupState>());
61
62             //stateManager_ -> changeState(boost::make_shared<MainMenuState>());
63         }
64     }
65
66     void draw(){
67         image -> draw(0,0,0);
68     }
69 private:
70     boost::scoped_ptr<Gosu::Image> image;
71     Crono c;
72
73 };
74
75 #endif /* _STATEINITIALDEVELOPERSCREEN_H_ */