\hypertarget{game_8h_source}{}\doxysection{game.\+h} \label{game_8h_source}\index{headers/game.h@{headers/game.h}} \mbox{\hyperlink{game_8h}{Go to the documentation of this file.}} \begin{DoxyCode}{0} \DoxyCodeLine{\Hypertarget{game_8h_source_l00001}00001 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00013}00013 \textcolor{preprocessor}{\#ifndef GUARD\_GAME\_H}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00014}00014 \textcolor{preprocessor}{\#define GUARD\_GAME\_H}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00015}00015 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{\Hypertarget{game_8h_source_l00016}00016 \textcolor{preprocessor}{\#include "{}mingl/mingl.h"{}}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00017}00017 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{pixel_manager_8h}{pixelManager/pixelManager.h}}"{}}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00018}00018 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{utils_8h}{utils.h}}"{}}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00019}00019 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{player_def_8h}{playerDef.h}}"{}}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00020}00020 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{player_8h}{player.h}}"{}}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00021}00021 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{play_mode_8h}{playMode.h}}"{}}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00022}00022 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{config_data_8h}{configData.h}}"{}}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00023}00023 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{projectiles_8h}{projectiles.h}}"{}}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00024}00024 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{scores_manager_8h}{scoresManager.h}}"{}}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00025}00025 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{god_8h}{god.h}}"{}}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00026}00026 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{invaders_grid_8h}{invadersGrid.h}}"{}}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00027}00027 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00028}00028 \textcolor{keyword}{using namespace }std;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00029}00029 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00034}\mbox{\hyperlink{class_game}{00034}} \textcolor{keyword}{class }\mbox{\hyperlink{class_game}{Game}} \{} \DoxyCodeLine{\Hypertarget{game_8h_source_l00035}00035 \textcolor{keyword}{private}:} \DoxyCodeLine{\Hypertarget{game_8h_source_l00036}00036 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00040}00040 MinGL window;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00041}00041 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00046}00046 unique\_ptr pm;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00047}00047 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00051}00051 \mbox{\hyperlink{struct_config_data}{ConfigData}} confData;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00052}00052 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00056}00056 \mbox{\hyperlink{class_scores_manager}{ScoresManager}} sm;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00057}00057 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00061}00061 \mbox{\hyperlink{class_god}{God}} god;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00062}00062 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00066}00066 \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}} baseInvPos;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00067}00067 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00071}00071 \mbox{\hyperlink{class_invaders_grid}{InvadersGrid}} grid;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00072}00072 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00076}00076 \textcolor{keywordtype}{bool} direction;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00077}00077 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00081}00081 vector missiles;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00082}00082 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00086}00086 vector torpedos;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00087}00087 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00091}00091 \mbox{\hyperlink{play_mode_8h_a188092ed559d356ade9a517d60ec3f34}{PlayMode}} playMode;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00092}00092 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00096}00096 vector players;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00097}00097 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00098}00098 \textcolor{comment}{// invaders related variables}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00099}00099 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00103}00103 \textcolor{keywordtype}{unsigned} fireCooldown=0;} \DoxyCodeLine{\Hypertarget{game_8h_source_l00104}00104 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00105}00105 \textcolor{comment}{// basic methods}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00106}00106 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00111}00111 \textcolor{keywordtype}{void} initGame();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00112}00112 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00118}00118 \textcolor{keywordtype}{bool} areThereInvadersLeft();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00119}00119 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00124}00124 \textcolor{keywordtype}{void} handleScoreSaving();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00125}00125 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00131}00131 \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}} invIndexToPos(\textcolor{keywordtype}{unsigned} x, \textcolor{keywordtype}{unsigned} y) \textcolor{keyword}{const};} \DoxyCodeLine{\Hypertarget{game_8h_source_l00132}00132 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00133}00133 \textcolor{comment}{// drawing methods}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00134}00134 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00139}00139 \textcolor{keywordtype}{void} displayScore() \textcolor{keyword}{const};} \DoxyCodeLine{\Hypertarget{game_8h_source_l00140}00140 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00146}00146 \textcolor{keywordtype}{void} displayAll(\textcolor{keywordtype}{unsigned} fps) \textcolor{keyword}{const};} \DoxyCodeLine{\Hypertarget{game_8h_source_l00147}00147 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00152}00152 \textcolor{keywordtype}{void} displayGod() \textcolor{keyword}{const};} \DoxyCodeLine{\Hypertarget{game_8h_source_l00153}00153 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00160}00160 \textcolor{keywordtype}{void} displayInvader(\textcolor{keyword}{const} \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}}\& baseInvPos, \mbox{\hyperlink{invaders_grid_8h_a28be5c0c3bae3518d94b2ede3633e018}{InvaderType}} type) \textcolor{keyword}{const};} \DoxyCodeLine{\Hypertarget{game_8h_source_l00161}00161 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00166}00166 \textcolor{keywordtype}{void} displayHearts(\mbox{\hyperlink{utils_8h_a19f2f2312637b6ed67b6d24598b6f470}{playerID}}) \textcolor{keyword}{const};} \DoxyCodeLine{\Hypertarget{game_8h_source_l00167}00167 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00168}00168 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00169}00169 \textcolor{comment}{// managers}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00170}00170 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00175}00175 \textcolor{keywordtype}{void} managePlayers();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00176}00176 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00182}00182 \textcolor{keywordtype}{void} manageOnePlayer(\mbox{\hyperlink{utils_8h_a19f2f2312637b6ed67b6d24598b6f470}{playerID}} pID);} \DoxyCodeLine{\Hypertarget{game_8h_source_l00183}00183 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00189}00189 \textcolor{keywordtype}{bool} manageInvaders();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00190}00190 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00191}00191 \textcolor{comment}{// collision things}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00192}00192 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00197}00197 \textcolor{keywordtype}{void} remCollidingProjectiles();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00198}00198 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00203}00203 \textcolor{keywordtype}{void} moveMissiles();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00204}00204 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00209}00209 \textcolor{keywordtype}{void} moveTorpedos();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00210}00210 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00215}00215 \textcolor{keywordtype}{void} checkMissilesAndPlayers();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00216}00216 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00222}00222 \textcolor{keywordtype}{bool} checkTorpedosAndInvaders();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00223}00223 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00229}00229 \textcolor{keywordtype}{bool} invadersTouchPlayer() \textcolor{keyword}{const};} \DoxyCodeLine{\Hypertarget{game_8h_source_l00230}00230 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00235}00235 \textcolor{keywordtype}{void} tryAwakeGod();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00236}00236 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00242}00242 \textcolor{keywordtype}{bool} manageGod();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00243}00243 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00244}00244 \textcolor{keyword}{public}:} \DoxyCodeLine{\Hypertarget{game_8h_source_l00245}00245 \textcolor{comment}{// in case someone wants to mess with the code, here's a minimal API, costs nothing to us}} \DoxyCodeLine{\Hypertarget{game_8h_source_l00246}00246 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00251}00251 \mbox{\hyperlink{class_game_ad59df6562a58a614fda24622d3715b65}{Game}}();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00252}00252 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00257}00257 \textcolor{keywordtype}{void} \mbox{\hyperlink{class_game_a185d2ce9845c75b62064dc6d60f79eab}{managedGames}}();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00258}00258 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00264}00264 \mbox{\hyperlink{utils_8h_acd2eabcda2cfc7902077f1f9a9e318de}{WinValue}} \mbox{\hyperlink{class_game_a74570e2b1a4930b1ab1c957b5e60320e}{enterGameLoop}}();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00265}00265 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00271}00271 \textcolor{keywordtype}{bool} \mbox{\hyperlink{class_game_ac6c18f49964d49c3c5c826ef678f0792}{reloadConfig}}();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00272}00272 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00278}00278 \textcolor{keywordtype}{bool} \mbox{\hyperlink{class_game_aef8202b79983c3b0f8d6db6c01d17fa6}{arePlayersDead}}();} \DoxyCodeLine{\Hypertarget{game_8h_source_l00279}00279 \};} \DoxyCodeLine{\Hypertarget{game_8h_source_l00280}00280 } \DoxyCodeLine{\Hypertarget{game_8h_source_l00281}00281 \textcolor{preprocessor}{\#endif}} \end{DoxyCode}