Files
Sokoban/rapport/latex/function_8h_source.tex
2025-01-05 18:29:43 +01:00

65 lines
4.5 KiB
TeX

\doxysection{function.\+h}
\label{function_8h_source}\index{function.h@{function.h}}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#ifndef\ FONCTION\_H}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#define\ FONCTION\_H}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ <SDL2/SDL.h>}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ <SDL2/SDL\_render.h>}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ <SDL2/SDL\_video.h>}}
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ <stdbool.h>}}
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ <stdlib.h>}}
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <time.h>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#define\ EMPTY\ 1}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#define\ WALL\ 0}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#define\ BOX\ 2}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#define\ TARGET\ 3}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#define\ BOX\_ON\_TARGET\ 4}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#define\ PLAYER\ 5}}
\DoxyCodeLine{00017\ \textcolor{preprocessor}{\#define\ PLAYER\_ON\_TARGET\ 6}}
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#define\ BUTTON\ 7}}
\DoxyCodeLine{00019\ \textcolor{preprocessor}{\#define\ PLAYER\_ON\_BUTTON\ 8}}
\DoxyCodeLine{00020\ }
\DoxyCodeLine{00021\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }Vecteur}
\DoxyCodeLine{00022\ \{}
\DoxyCodeLine{00023\ \ \ \ \ \textcolor{keywordtype}{int}\ x;}
\DoxyCodeLine{00024\ \ \ \ \ \textcolor{keywordtype}{int}\ y;}
\DoxyCodeLine{00025\ \}\ vect;}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }Score}
\DoxyCodeLine{00028\ \{}
\DoxyCodeLine{00029\ \ \ \ \ time\_t\ before;}
\DoxyCodeLine{00030\ \ \ \ \ time\_t\ after;}
\DoxyCodeLine{00031\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ move\_player;}
\DoxyCodeLine{00032\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ move\_box;}
\DoxyCodeLine{00033\ \}\ score;}
\DoxyCodeLine{00034\ }
\DoxyCodeLine{00035\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }essential\_sdl}
\DoxyCodeLine{00036\ \{}
\DoxyCodeLine{00037\ \ \ \ \ SDL\_Window\ *window;}
\DoxyCodeLine{00038\ \ \ \ \ SDL\_Renderer\ *renderer;}
\DoxyCodeLine{00039\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ size\_window;}
\DoxyCodeLine{00040\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ size\_box;}
\DoxyCodeLine{00041\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ size\_menu;}
\DoxyCodeLine{00042\ \}\ dis;}
\DoxyCodeLine{00043\ }
\DoxyCodeLine{00044\ \textcolor{keywordtype}{char}\ **creatArea2D\ (\textcolor{keyword}{const}\ \textcolor{keywordtype}{int}\ x,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{int}\ y);}
\DoxyCodeLine{00045\ \textcolor{keywordtype}{void}\ free2D\ (\textcolor{keywordtype}{char}\ **tab,\ \textcolor{keywordtype}{int}\ x);}
\DoxyCodeLine{00046\ \textcolor{keywordtype}{bool}\ isWin\ (\textcolor{keywordtype}{char}\ **tab2d,\ vect\ *targets,\ \textcolor{keywordtype}{int}\ nbr\_targets);}
\DoxyCodeLine{00047\ \textcolor{keywordtype}{bool}\ islose\ (\textcolor{keywordtype}{char}\ **tab2d,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{int}\ N);}
\DoxyCodeLine{00048\ \textcolor{keywordtype}{bool}\ blockBox\ (\textcolor{keywordtype}{char}\ **tab2d,\ vect\ box\_coor);}
\DoxyCodeLine{00049\ vect\ plusVect\ (vect\ one,\ vect\ two);}
\DoxyCodeLine{00050\ }
\DoxyCodeLine{00051\ \textcolor{keywordtype}{int}\ inGameLoop\ (\textcolor{keywordtype}{char}\ **tab2d,\ vect\ *dim\_tab,\ vect\ *playerPos,\ vect\ *targets,}
\DoxyCodeLine{00052\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ nbr\_targets,\ dis\ *display\_user,\ score\ *score\_user,\ \textcolor{keywordtype}{bool}\ menu);}
\DoxyCodeLine{00053\ \textcolor{keywordtype}{char}\ *timeToText(time\_t\ time);}
\DoxyCodeLine{00054\ \textcolor{keywordtype}{void}\ nullScore(score\ *player\_score);}
\DoxyCodeLine{00055\ \textcolor{keywordtype}{void}\ winOrLoseLoop(dis\ *display\_user,score\ *score\_user,\ \textcolor{keywordtype}{bool}\ win);}
\DoxyCodeLine{00056\ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ scoreCalculator(score\ *score\_user,\ \textcolor{keywordtype}{bool}\ win);}
\DoxyCodeLine{00057\ }
\DoxyCodeLine{00058\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ FONCTION\_H}}
\end{DoxyCode}