ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
court.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
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.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef SCUMM_HE_BASKETBALL_COURT_H
23 #define SCUMM_HE_BASKETBALL_COURT_H
24 
25 #ifdef ENABLE_HE
26 
27 #include "scumm/he/intern_he.h"
28 
29 #include "scumm/he/basketball/collision/bball_collision_object.h"
30 #include "scumm/he/basketball/collision/bball_collision_box.h"
31 #include "scumm/he/basketball/collision/bball_collision_basketball.h"
32 #include "scumm/he/basketball/collision/bball_collision_player.h"
33 #include "scumm/he/basketball/collision/bball_collision_support_obj.h"
34 #include "scumm/he/basketball/collision/bball_collision_stack.h"
35 #include "scumm/he/basketball/collision/bball_collision_tree.h"
36 
37 #include "scumm/he/logic_he.h"
38 
39 namespace Scumm {
40 
41 // COURT DEFINES
42 
43 #define MAX_PLAYERS_ON_TEAM 5
44 
45 #define NO_PLAYER -1
46 #define FIRST_PLAYER 0
47 #define AWAY_PLAYER_1 5
48 #define LAST_PLAYER 9
49 
50 #define TEAM_HOME 0
51 #define TEAM_AWAY 1
52 
53 #define SHOT_SPOT_RADIUS 13
54 
55 #define NO_COURT 0
56 #define COURT_DOBBAGUCHI 1
57 #define COURT_SMITH_BROS 2
58 #define COURT_SANDY_FLATS 3
59 #define COURT_QUEENS 4
60 #define COURT_PLAYGROUND 5
61 #define COURT_SCHEFFLER 6
62 #define COURT_POLK 7
63 #define COURT_MCMILLAN 8
64 #define COURT_CROWN_HILL 9
65 #define COURT_MEMORIAL 10
66 #define COURT_TECH_STATE 11
67 #define COURT_HUMONGOUS 12
68 #define COURT_MOON 13
69 #define COURT_BARN 14
70 #define COURT_COUNT 15
71 
72 class CBBallCourt {
73 public:
74  CBBallCourt() {
75  _objectCount = 0;
76  _backboardIndex[0] = 0;
77  _backboardIndex[1] = 0;
78  }
79 
80  ~CBBallCourt() = default;
81 
82  int getPlayerIndex(int playerID);
83  CCollisionPlayer *getPlayerPtr(int playerID);
84  CCollisionBasketball *getBallPtr(int ballID);
85 
86  Common::Array<CCollisionPlayer> *getPlayerListPtr(int i) {
87  return (i < AWAY_PLAYER_1) ? &_homePlayerList : &_awayPlayerList;
88  }
89 
90  Common::Array<CCollisionPlayer> *getOpponentListPtr(int i) {
91  return (i < AWAY_PLAYER_1) ? &_awayPlayerList : &_homePlayerList;
92  }
93 
94  Common::String _name;
95 
96  CCollisionBasketball _basketBall;
97  CCollisionBasketball _virtualBall;
98 
99  Common::Array<CCollisionBox> _objectList;
100  CCollisionObjectTree _objectTree;
101  Common::Array<CCollisionPlayer> _homePlayerList;
102  Common::Array<CCollisionPlayer> _awayPlayerList;
103  int _objectCount;
104  int _backboardIndex[2];
105  U32Sphere _shotSpot[2] = {};
106 };
107 
108 } // End of namespace Scumm
109 
110 #endif // ENABLE_HE
111 
112 #endif // SCUMM_HE_BASKETBALL_COURT_H
Definition: str.h:59
Definition: array.h:52
Definition: actor.h:30