1 #ifndef STADIUM_H
2 #define STADIUM_H
3 
4 #define MAX_TURN 3
5 
6 #include <string>
7 
8 #include "actor.h"
9 #include "goal.h"
10 #include "ball.h"
11 #include "game.h"
12 #include "team.h"
13 #include "line.h"
14 #include "timeboard.h"
15 #include "select.h"
16 #include "soccergame.h"
17 #include "collision.h"
18 #include "activecap.h"
19 #include "theme.h"
20 #include "pass.h"
21 #include "messenger.h"
22 
23 //Clase que se encarga del campo
24 class Stadium
25 {
26 	public:
27 		Stadium(Game* ag);
28 		virtual ~Stadium();
29 
30 		void init();
31 		bool update();
32 		void shutdown();
33 
34 		void getCollision(Collision &c);
35 
36 	private:
37 
changeTeam()38 		void changeTeam(){s->changeTeam();}
changeTeam(SG::team_t t)39 		void changeTeam(SG::team_t t){s->changeTeam(t);}
40 		void startTurn();
41 
isMoving()42 		bool isMoving(){return Cap::anyMoving()||ball->isMoving();}
43 
44 		Cap* isAPass();
45 
46 		typedef enum
47 		{
48 			WAITING,
49 			MOVING,
50 			GOAL,
51 			FAULT,
52 			BALL
53 		}state_t;
54 
55 		state_t state;
56 
57 		Game *g;
58 		Goal *g_left,*g_right;
59 		Ball *ball;
60 
61 		Theme *theme;
62 		//Timers
63 		TimeBoard* time;
64 		TimeBoard* seconds;
65 		TimeBoard* minutes;
66 
67 		//Scoresboards
68 		Score* s_left;
69 		Score* s_right;
70 
71 		//Para los equipos
72 		Team teams[2];
73 		int turn;
74 
75 		//Selector de equipos
76 		Select *s;
77 
78 		//Pase
79 		Pass *pass;
80 
81 		//Pasador
82 		Cap *cap_pass;
83 		Cap *cap_fault;
84 
85 		Messenger *messenger;
86 
87 		bool goldengoal;
88 		bool finish;
89 };
90 
91 #endif
92