\doxysection{Obstacles\+Tic\+Tac\+Toe.\+h}
\hypertarget{_obstacles_tic_tac_toe_8h_source}{}\label{_obstacles_tic_tac_toe_8h_source}\mbox{\hyperlink{_obstacles_tic_tac_toe_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#ifndef\ OBSTACLESTICTACTOE\_H}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#define\ OBSTACLESTICTACTOE\_H}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{_board_game___classes_8h}{BoardGame\_Classes.h}}"{}}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ <iostream>}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ <cstdlib>}}
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ <ctime>}}
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{00009\ \textcolor{keyword}{using\ namespace\ }std;}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{comment}{//\ Obstacles\ Tic\ Tac\ Toe\ Board}}
\DoxyCodeLine{00012\ \textcolor{keyword}{class\ }\mbox{\hyperlink{class_obstacles_tic_tac_toe_board_a81f60144c8ce63de591f63d661c64543}{ObstaclesTicTacToeBoard}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{class_board_ae5dfded241ee3644196e2f6074d1d0b1}{Board}}<char>\ \{}
\DoxyCodeLine{00013\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00014\ \ \ \ \ vector<pair<int,\ int>>\ obstacles;}
\DoxyCodeLine{00015\ \ \ \ \ \textcolor{keywordtype}{int}\ moves\_since\_last\_obstacle\ =\ 0;}
\DoxyCodeLine{00016\ }
\DoxyCodeLine{00017\ \ \ \ \ \textcolor{keywordtype}{void}\ add\_random\_obstacle()\ \{}
\DoxyCodeLine{00018\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ x,\ y;}
\DoxyCodeLine{00019\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{do}\ \{}
\DoxyCodeLine{00020\ \ \ \ \ \ \ \ \ \ \ \ \ x\ =\ rand()\ \%\ 6;}
\DoxyCodeLine{00021\ \ \ \ \ \ \ \ \ \ \ \ \ y\ =\ rand()\ \%\ 6;}
\DoxyCodeLine{00022\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{while}\ (\mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[x][y]\ !=\ \textcolor{charliteral}{'\ '}\ ||\ is\_obstacle(x,\ y));}
\DoxyCodeLine{00023\ }
\DoxyCodeLine{00024\ \ \ \ \ \ \ \ \ obstacles.push\_back(\{\ x,\ y\ \});}
\DoxyCodeLine{00025\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[x][y]\ =\ \textcolor{charliteral}{'\#'};\ \textcolor{comment}{//\ Obstacle\ symbol}}
\DoxyCodeLine{00026\ \ \ \ \ \}}
\DoxyCodeLine{00027\ }
\DoxyCodeLine{00028\ \ \ \ \ \textcolor{keywordtype}{bool}\ is\_obstacle(\textcolor{keywordtype}{int}\ x,\ \textcolor{keywordtype}{int}\ y)\ \{}
\DoxyCodeLine{00029\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\&\ obs\ :\ obstacles)\ \{}
\DoxyCodeLine{00030\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (obs.first\ ==\ x\ \&\&\ obs.second\ ==\ y)}
\DoxyCodeLine{00031\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{00032\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00033\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{00034\ \ \ \ \ \}}
\DoxyCodeLine{00035\ }
\DoxyCodeLine{00036\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00037\ \ \ \ \ \mbox{\hyperlink{class_obstacles_tic_tac_toe_board_a81f60144c8ce63de591f63d661c64543}{ObstaclesTicTacToeBoard}}()\ :\ \mbox{\hyperlink{class_board_ae5dfded241ee3644196e2f6074d1d0b1}{Board}}(6,\ 6)\ \{}
\DoxyCodeLine{00038\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ 6;\ i++)\ \{}
\DoxyCodeLine{00039\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ j\ =\ 0;\ j\ <\ 6;\ j++)\ \{}
\DoxyCodeLine{00040\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i][j]\ =\ \textcolor{charliteral}{'\ '};}
\DoxyCodeLine{00041\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00042\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00043\ \ \ \ \ \ \ \ \ srand(time(0));}
\DoxyCodeLine{00044\ \ \ \ \ \}}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00046\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_obstacles_tic_tac_toe_board_a5a25efe920ed39f9fab04d76fe1906f2}{update\_board}}(\mbox{\hyperlink{class_move}{Move<char>}}*\ move)\textcolor{keyword}{\ override\ }\{}
\DoxyCodeLine{00047\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ x\ =\ move-\/>\mbox{\hyperlink{class_move_a9d4f543a81e361f872d37bcfb64d5b55}{get\_x}}();}
\DoxyCodeLine{00048\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ y\ =\ move-\/>\mbox{\hyperlink{class_move_a96469802a55c9083a1e93c7edec8a00c}{get\_y}}();}
\DoxyCodeLine{00049\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{char}\ symbol\ =\ move-\/>\mbox{\hyperlink{class_move_a595bf740852c05a1cb425ef2640fd4ff}{get\_symbol}}();}
\DoxyCodeLine{00050\ }
\DoxyCodeLine{00051\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (x\ <\ 0\ ||\ x\ >=\ 6\ ||\ y\ <\ 0\ ||\ y\ >=\ 6)\ \{}
\DoxyCodeLine{00052\ \ \ \ \ \ \ \ \ \ \ \ \ cout\ <<\ \textcolor{stringliteral}{"{}Invalid\ position!\ Use\ 0-\/5.\(\backslash\)n"{}};}
\DoxyCodeLine{00053\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{00054\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00055\ }
\DoxyCodeLine{00056\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (is\_obstacle(x,\ y))\ \{}
\DoxyCodeLine{00057\ \ \ \ \ \ \ \ \ \ \ \ \ cout\ <<\ \textcolor{stringliteral}{"{}Cell\ is\ an\ obstacle!\(\backslash\)n"{}};}
\DoxyCodeLine{00058\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{00059\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00060\ }
\DoxyCodeLine{00061\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[x][y]\ !=\ \textcolor{charliteral}{'\ '})\ \{}
\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ \ \ \ \ cout\ <<\ \textcolor{stringliteral}{"{}Cell\ already\ occupied!\(\backslash\)n"{}};}
\DoxyCodeLine{00063\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{00064\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00065\ }
\DoxyCodeLine{00066\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[x][y]\ =\ symbol;}
\DoxyCodeLine{00067\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_board_a5952baefabced65fecec333de638408d}{n\_moves}}++;}
\DoxyCodeLine{00068\ \ \ \ \ \ \ \ \ moves\_since\_last\_obstacle++;}
\DoxyCodeLine{00069\ }
\DoxyCodeLine{00070\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Add\ obstacles\ every\ 2\ moves}}
\DoxyCodeLine{00071\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (moves\_since\_last\_obstacle\ >=\ 2)\ \{}
\DoxyCodeLine{00072\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ 2;\ i++)\ \{}
\DoxyCodeLine{00073\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ add\_random\_obstacle();}
\DoxyCodeLine{00074\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00075\ \ \ \ \ \ \ \ \ \ \ \ \ moves\_since\_last\_obstacle\ =\ 0;}
\DoxyCodeLine{00076\ \ \ \ \ \ \ \ \ \ \ \ \ cout\ <<\ \textcolor{stringliteral}{"{}Two\ new\ obstacles\ added!\(\backslash\)n"{}};}
\DoxyCodeLine{00077\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00078\ }
\DoxyCodeLine{00079\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{00080\ \ \ \ \ \}}
\DoxyCodeLine{00081\ }
\DoxyCodeLine{00082\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_obstacles_tic_tac_toe_board_a0f78d14ff4384f7dfc2e88230b94ba9a}{is\_win}}(\mbox{\hyperlink{class_player}{Player<char>}}*\ player)\textcolor{keyword}{\ override\ }\{}
\DoxyCodeLine{00083\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{char}\ symbol\ =\ player-\/>\mbox{\hyperlink{class_player_af56f0bf98c0423a3a75b0848607d03a4}{get\_symbol}}();}
\DoxyCodeLine{00084\ }
\DoxyCodeLine{00085\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Check\ 4\ in\ a\ row}}
\DoxyCodeLine{00086\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Horizontal}}
\DoxyCodeLine{00087\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ 6;\ i++)\ \{}
\DoxyCodeLine{00088\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ j\ =\ 0;\ j\ <\ 3;\ j++)\ \{}
\DoxyCodeLine{00089\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i][j]\ ==\ symbol\ \&\&\ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i][j\ +\ 1]\ ==\ symbol\ \&\&}
\DoxyCodeLine{00090\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i][j\ +\ 2]\ ==\ symbol\ \&\&\ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i][j\ +\ 3]\ ==\ symbol)}
\DoxyCodeLine{00091\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{00092\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00093\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00094\ }
\DoxyCodeLine{00095\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Vertical}}
\DoxyCodeLine{00096\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ j\ =\ 0;\ j\ <\ 6;\ j++)\ \{}
\DoxyCodeLine{00097\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ 3;\ i++)\ \{}
\DoxyCodeLine{00098\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i][j]\ ==\ symbol\ \&\&\ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i\ +\ 1][j]\ ==\ symbol\ \&\&}
\DoxyCodeLine{00099\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i\ +\ 2][j]\ ==\ symbol\ \&\&\ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i\ +\ 3][j]\ ==\ symbol)}
\DoxyCodeLine{00100\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{00101\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00102\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00103\ }
\DoxyCodeLine{00104\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Diagonals}}
\DoxyCodeLine{00105\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ 3;\ i++)\ \{}
\DoxyCodeLine{00106\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ j\ =\ 0;\ j\ <\ 3;\ j++)\ \{}
\DoxyCodeLine{00107\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i][j]\ ==\ symbol\ \&\&\ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i\ +\ 1][j\ +\ 1]\ ==\ symbol\ \&\&}
\DoxyCodeLine{00108\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i\ +\ 2][j\ +\ 2]\ ==\ symbol\ \&\&\ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i\ +\ 3][j\ +\ 3]\ ==\ symbol)}
\DoxyCodeLine{00109\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{00110\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00111\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00112\ }
\DoxyCodeLine{00113\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ 3;\ i++)\ \{}
\DoxyCodeLine{00114\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ j\ =\ 3;\ j\ <\ 6;\ j++)\ \{}
\DoxyCodeLine{00115\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i][j]\ ==\ symbol\ \&\&\ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i\ +\ 1][j\ -\/\ 1]\ ==\ symbol\ \&\&}
\DoxyCodeLine{00116\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i\ +\ 2][j\ -\/\ 2]\ ==\ symbol\ \&\&\ \mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i\ +\ 3][j\ -\/\ 3]\ ==\ symbol)}
\DoxyCodeLine{00117\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{00118\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00119\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00120\ }
\DoxyCodeLine{00121\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{00122\ \ \ \ \ \}}
\DoxyCodeLine{00123\ }
\DoxyCodeLine{00124\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_obstacles_tic_tac_toe_board_a1916c534795eeb7033f6ab93febfe1d3}{is\_lose}}(\mbox{\hyperlink{class_player}{Player<char>}}*\ player)\textcolor{keyword}{\ override\ }\{}
\DoxyCodeLine{00125\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{00126\ \ \ \ \ \}}
\DoxyCodeLine{00127\ }
\DoxyCodeLine{00128\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_obstacles_tic_tac_toe_board_af083328e40733ffc001dd1e9b4c6723b}{is\_draw}}(\mbox{\hyperlink{class_player}{Player<char>}}*\ player)\textcolor{keyword}{\ override\ }\{}
\DoxyCodeLine{00129\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Check\ if\ board\ is\ full\ (no\ empty\ cells\ except\ obstacles)}}
\DoxyCodeLine{00130\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ 6;\ i++)\ \{}
\DoxyCodeLine{00131\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ j\ =\ 0;\ j\ <\ 6;\ j++)\ \{}
\DoxyCodeLine{00132\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{class_board_af00c1fc363eb640ca276b8a572040040}{board}}[i][j]\ ==\ \textcolor{charliteral}{'\ '})\ \{}
\DoxyCodeLine{00133\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{00134\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00135\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00136\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00137\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ !\mbox{\hyperlink{class_obstacles_tic_tac_toe_board_a0f78d14ff4384f7dfc2e88230b94ba9a}{is\_win}}(player);}
\DoxyCodeLine{00138\ \ \ \ \ \}}
\DoxyCodeLine{00139\ }
\DoxyCodeLine{00140\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{class_obstacles_tic_tac_toe_board_a4a961b56be7ca90c8b13ab8a1ac5eca3}{game\_is\_over}}(\mbox{\hyperlink{class_player}{Player<char>}}*\ player)\textcolor{keyword}{\ override\ }\{}
\DoxyCodeLine{00141\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{class_obstacles_tic_tac_toe_board_a0f78d14ff4384f7dfc2e88230b94ba9a}{is\_win}}(player)\ ||\ \mbox{\hyperlink{class_obstacles_tic_tac_toe_board_af083328e40733ffc001dd1e9b4c6723b}{is\_draw}}(player);}
\DoxyCodeLine{00142\ \ \ \ \ \}}
\DoxyCodeLine{00143\ \};}
\DoxyCodeLine{00144\ }
\DoxyCodeLine{00145\ \textcolor{comment}{//\ Obstacles\ Player}}
\DoxyCodeLine{00146\ \textcolor{keyword}{class\ }\mbox{\hyperlink{class_obstacles_tic_tac_toe___player_a0ecac8619933d7c3d5858f2304440a67}{ObstaclesTicTacToe\_Player}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{class_player_adb4e803a7ac0356b111b8ca79d766976}{Player}}<char>\ \{}
\DoxyCodeLine{00147\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00148\ \ \ \ \ \mbox{\hyperlink{class_obstacles_tic_tac_toe___player_a0ecac8619933d7c3d5858f2304440a67}{ObstaclesTicTacToe\_Player}}(\textcolor{keywordtype}{string}\ \mbox{\hyperlink{class_player_af0ad0d4ca8584d23a98c723cd703a4f6}{name}},\ \textcolor{keywordtype}{char}\ \mbox{\hyperlink{class_player_a272d6c4dab769930d4f8074918e7708a}{symbol}})\ :\ \mbox{\hyperlink{class_player_adb4e803a7ac0356b111b8ca79d766976}{Player}}(\mbox{\hyperlink{class_player_af0ad0d4ca8584d23a98c723cd703a4f6}{name}},\ \mbox{\hyperlink{class_player_a272d6c4dab769930d4f8074918e7708a}{symbol}},\ \mbox{\hyperlink{_board_game___classes_8h_abe590f3c9109f404f003d5d7e4f0fccf}{PlayerType}}::\mbox{\hyperlink{_board_game___classes_8h_abe590f3c9109f404f003d5d7e4f0fccfaa36c6719f4d3207d858cf956ef1e93b6}{HUMAN}})\ \{\}}
\DoxyCodeLine{00149\ \};}
\DoxyCodeLine{00150\ }
\DoxyCodeLine{00151\ \textcolor{comment}{//\ Obstacles\ Random\ Player}}
\DoxyCodeLine{00152\ \textcolor{keyword}{class\ }\mbox{\hyperlink{class_obstacles_tic_tac_toe___random_player_a5b73934301ed0f65bfdf2c542429766a}{ObstaclesTicTacToe\_RandomPlayer}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{class_player_adb4e803a7ac0356b111b8ca79d766976}{Player}}<char>\ \{}
\DoxyCodeLine{00153\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00154\ \ \ \ \ \mbox{\hyperlink{class_obstacles_tic_tac_toe___random_player_a5b73934301ed0f65bfdf2c542429766a}{ObstaclesTicTacToe\_RandomPlayer}}(\textcolor{keywordtype}{char}\ \mbox{\hyperlink{class_player_a272d6c4dab769930d4f8074918e7708a}{symbol}})\ :\ \mbox{\hyperlink{class_player_adb4e803a7ac0356b111b8ca79d766976}{Player}}(\textcolor{stringliteral}{"{}Random\ Computer"{}},\ \mbox{\hyperlink{class_player_a272d6c4dab769930d4f8074918e7708a}{symbol}},\ \mbox{\hyperlink{_board_game___classes_8h_abe590f3c9109f404f003d5d7e4f0fccf}{PlayerType}}::\mbox{\hyperlink{_board_game___classes_8h_abe590f3c9109f404f003d5d7e4f0fccfad19cbc472227d1e3d1d276c2cbc0e513}{COMPUTER}})\ \{}
\DoxyCodeLine{00155\ \ \ \ \ \ \ \ \ srand(time(0));}
\DoxyCodeLine{00156\ \ \ \ \ \}}
\DoxyCodeLine{00157\ \};}
\DoxyCodeLine{00158\ }
\DoxyCodeLine{00159\ \textcolor{comment}{//\ Obstacles\ UI}}
\DoxyCodeLine{00160\ \textcolor{keyword}{class\ }\mbox{\hyperlink{class_obstacles_tic_tac_toe___u_i_a21dd74c777b89e5ac8810fa80402e31b}{ObstaclesTicTacToe\_UI}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{class_u_i_ae50eed41905ca2f8dc103d9bef427fe6}{UI}}<char>\ \{}
\DoxyCodeLine{00161\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00162\ \ \ \ \ \mbox{\hyperlink{class_obstacles_tic_tac_toe___u_i_a21dd74c777b89e5ac8810fa80402e31b}{ObstaclesTicTacToe\_UI}}()\ :\ \mbox{\hyperlink{class_u_i_ae50eed41905ca2f8dc103d9bef427fe6}{UI}}(\textcolor{stringliteral}{"{}Welcome\ to\ Obstacles\ Tic-\/Tac-\/Toe!\ (4\ in\ a\ row,\ obstacles\ appear)"{}},\ 3)\ \{\}}
\DoxyCodeLine{00163\ }
\DoxyCodeLine{00164\ \ \ \ \ \mbox{\hyperlink{class_move}{Move<char>}}*\ \mbox{\hyperlink{class_obstacles_tic_tac_toe___u_i_a636cfc09a5dbbce163b9c0abc2cc0541}{get\_move}}(\mbox{\hyperlink{class_player}{Player<char>}}*\ player)\textcolor{keyword}{\ override\ }\{}
\DoxyCodeLine{00165\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (player-\/>\mbox{\hyperlink{class_player_a2df3bd299bf7aecfa2275ec6902a60f8}{get\_type}}()\ ==\ \mbox{\hyperlink{_board_game___classes_8h_abe590f3c9109f404f003d5d7e4f0fccfaa36c6719f4d3207d858cf956ef1e93b6}{PlayerType::HUMAN}})\ \{}
\DoxyCodeLine{00166\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ x,\ y;}
\DoxyCodeLine{00167\ \ \ \ \ \ \ \ \ \ \ \ \ cout\ <<\ player-\/>\mbox{\hyperlink{class_player_aed2af19790ba73190e3ebeea589518e1}{get\_name}}()\ <<\ \textcolor{stringliteral}{"{}\ ("{}}\ <<\ player-\/>\mbox{\hyperlink{class_player_af56f0bf98c0423a3a75b0848607d03a4}{get\_symbol}}()}
\DoxyCodeLine{00168\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ <<\ \textcolor{stringliteral}{"{}),\ enter\ your\ move\ (row\ and\ column\ 0-\/5):\ "{}};}
\DoxyCodeLine{00169\ \ \ \ \ \ \ \ \ \ \ \ \ cin\ >>\ x\ >>\ y;}
\DoxyCodeLine{00170\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{new}\ \mbox{\hyperlink{class_move}{Move<char>}}(x,\ y,\ player-\/>\mbox{\hyperlink{class_player_af56f0bf98c0423a3a75b0848607d03a4}{get\_symbol}}());}
\DoxyCodeLine{00171\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00172\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00173\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ x\ =\ rand()\ \%\ 6;}
\DoxyCodeLine{00174\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ y\ =\ rand()\ \%\ 6;}
\DoxyCodeLine{00175\ \ \ \ \ \ \ \ \ \ \ \ \ cout\ <<\ player-\/>\mbox{\hyperlink{class_player_aed2af19790ba73190e3ebeea589518e1}{get\_name}}()\ <<\ \textcolor{stringliteral}{"{}\ chooses\ position\ ("{}}\ <<\ x\ <<\ \textcolor{stringliteral}{"{},\ "{}}\ <<\ y\ <<\ \textcolor{stringliteral}{"{})\(\backslash\)n"{}};}
\DoxyCodeLine{00176\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{new}\ \mbox{\hyperlink{class_move}{Move<char>}}(x,\ y,\ player-\/>\mbox{\hyperlink{class_player_af56f0bf98c0423a3a75b0848607d03a4}{get\_symbol}}());}
\DoxyCodeLine{00177\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00178\ \ \ \ \ \}}
\DoxyCodeLine{00179\ \};}
\DoxyCodeLine{00180\ }
\DoxyCodeLine{00181\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ OBSTACLESTICTACTOE\_H}}

\end{DoxyCode}
