doxy
This commit is contained in:
264
latex/function_8c.tex
Normal file
264
latex/function_8c.tex
Normal file
@@ -0,0 +1,264 @@
|
||||
\doxysection{Référence du fichier function.\+c}
|
||||
\label{function_8c}\index{function.c@{function.c}}
|
||||
{\ttfamily \#include "{}function.\+h"{}}\newline
|
||||
{\ttfamily \#include "{}display.\+h"{}}\newline
|
||||
{\ttfamily \#include $<$SDL2/\+SDL\+\_\+events.\+h$>$}\newline
|
||||
{\ttfamily \#include $<$SDL2/\+SDL\+\_\+keycode.\+h$>$}\newline
|
||||
{\ttfamily \#include $<$SDL2/\+SDL\+\_\+render.\+h$>$}\newline
|
||||
{\ttfamily \#include $<$SDL2/\+SDL\+\_\+scancode.\+h$>$}\newline
|
||||
{\ttfamily \#include $<$SDL2/\+SDL\+\_\+timer.\+h$>$}\newline
|
||||
{\ttfamily \#include $<$stdbool.\+h$>$}\newline
|
||||
{\ttfamily \#include $<$stdio.\+h$>$}\newline
|
||||
{\ttfamily \#include $<$stdlib.\+h$>$}\newline
|
||||
{\ttfamily \#include $<$time.\+h$>$}\newline
|
||||
Graphe des dépendances par inclusion de function.\+c\+:\nopagebreak
|
||||
\begin{figure}[H]
|
||||
\begin{center}
|
||||
\leavevmode
|
||||
\includegraphics[width=350pt]{function_8c__incl}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\doxysubsubsection*{Fonctions}
|
||||
\begin{DoxyCompactItemize}
|
||||
\item
|
||||
char $\ast$$\ast$ \textbf{ creat\+Area2D} (const unsigned int N)
|
||||
\begin{DoxyCompactList}\small\item\em Cette fonction permet de creer une liste 2D carre. \end{DoxyCompactList}\item
|
||||
void \textbf{ free2D} (char $\ast$$\ast$tab, int N)
|
||||
\begin{DoxyCompactList}\small\item\em Cette fontion permet de liberer l\textquotesingle{}espace tu tableau 2D de char. \end{DoxyCompactList}\item
|
||||
char \textbf{ can\+IGo\+Direction} (char value\+Of\+NCase, char value\+Of\+NPlus\+One\+Case)
|
||||
\begin{DoxyCompactList}\small\item\em La fontction permet de savoir si le joueur peut ce deplacer dans une direction. \end{DoxyCompactList}\item
|
||||
void \textbf{ move} (char $\ast$$\ast$tab, \textbf{ vect} $\ast$player\+Pos, \textbf{ vect} direction, \textbf{ score} $\ast$score\+\_\+user)
|
||||
\begin{DoxyCompactList}\small\item\em Cette fonction effectue les deplacements du joueur et des boites en fonction de la situation. \end{DoxyCompactList}\item
|
||||
void \textbf{ in\+Game\+Loop} (char $\ast$$\ast$tab2d, int N, \textbf{ vect} $\ast$player\+Pos, \textbf{ vect} $\ast$targets, int nbr\+\_\+targets, \textbf{ dis} $\ast$display\+\_\+user, \textbf{ score} $\ast$score\+\_\+user)
|
||||
\begin{DoxyCompactList}\small\item\em La fonction permet de faire la boucle de jeu. \end{DoxyCompactList}\item
|
||||
bool \textbf{ is\+Win} (char $\ast$$\ast$tab2d, \textbf{ vect} $\ast$targets, int nbr\+\_\+targets)
|
||||
\begin{DoxyCompactList}\small\item\em Cette fonction verrifie si la partie est gagnante. \end{DoxyCompactList}\item
|
||||
bool \textbf{ islose} (char $\ast$$\ast$tab2d, const int N)
|
||||
\begin{DoxyCompactList}\small\item\em La fonction renvois si la partie est perdante. \end{DoxyCompactList}\item
|
||||
\textbf{ vect} \textbf{ plus\+Vect} (\textbf{ vect} one, \textbf{ vect} two)
|
||||
\begin{DoxyCompactList}\small\item\em La fonction fait une addition de vecteur, (x1+x2, y1+y2). \end{DoxyCompactList}\item
|
||||
\label{function_8c_a74650c59d33ff53d62ca3a3f8f56a68c}
|
||||
int {\bfseries length\+Vect} (\textbf{ vect} vector)
|
||||
\begin{DoxyCompactList}\small\item\em Renvois la longeur Manhattan. \end{DoxyCompactList}\item
|
||||
bool \textbf{ block\+Box} (char $\ast$$\ast$tab2d, \textbf{ vect} box\+\_\+coor)
|
||||
\begin{DoxyCompactList}\small\item\em La fonction permet de savoir si une boite est dans une situation ou le joueur ne poura pas la debloqué. \end{DoxyCompactList}\item
|
||||
char $\ast$ \textbf{ time\+To\+Text} (time\+\_\+t time)
|
||||
\begin{DoxyCompactList}\small\item\em Cette fonction renvois transforme le forma time en texte. (min\+:sec) \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||||
|
||||
|
||||
\doxysubsection{Description détaillée}
|
||||
Ce fichier contient toute les fonction utile pour le jeu. Sauf pour l\textquotesingle{}affichage.
|
||||
|
||||
\doxysubsection{Documentation des fonctions}
|
||||
\index{function.c@{function.c}!blockBox@{blockBox}}
|
||||
\index{blockBox@{blockBox}!function.c@{function.c}}
|
||||
\doxysubsubsection{blockBox()}
|
||||
{\footnotesize\ttfamily \label{function_8c_ac51249b2f7941ca06e6a614e071dd444}
|
||||
bool block\+Box (\begin{DoxyParamCaption}\item[{char $\ast$$\ast$}]{tab2d}{, }\item[{\textbf{ vect}}]{box\+\_\+coor}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
La fonction permet de savoir si une boite est dans une situation ou le joueur ne poura pas la debloqué.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Paramètres}
|
||||
{\em tab2d} & Le tableau 2D carre du plateau de jeu. \\
|
||||
\hline
|
||||
{\em box\+\_\+coor} & Les corrdonnée de la boite que la fonction test. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Renvoie}
|
||||
True si la la boite est bloquer, sinon false.
|
||||
\end{DoxyReturn}
|
||||
\index{function.c@{function.c}!canIGoDirection@{canIGoDirection}}
|
||||
\index{canIGoDirection@{canIGoDirection}!function.c@{function.c}}
|
||||
\doxysubsubsection{canIGoDirection()}
|
||||
{\footnotesize\ttfamily \label{function_8c_a76df2bc0c692d3397837706a6852ac36}
|
||||
char can\+IGo\+Direction (\begin{DoxyParamCaption}\item[{char}]{value\+Of\+NCase}{, }\item[{char}]{value\+Of\+NPlus\+One\+Case}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
La fontction permet de savoir si le joueur peut ce deplacer dans une direction.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Paramètres}
|
||||
{\em value\+Of\+NCase} & La valeur de la case dans la direction que le joueur veut aller. \\
|
||||
\hline
|
||||
{\em value\+Of\+NPlus\+One\+Case} & La valeur de la case dans la direction que le joueur veut aller mais une fois de plus. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Renvoie}
|
||||
0 Si c\textquotesingle{}est un mur devant le joueur, 1 si c\textquotesingle{}est vide devant le joueur, 2 si c\textquotesingle{}est une boite mais qu\textquotesingle{}on peux la pousser ,3 si le joueur pousse une boite sur un point d\textquotesingle{}interer, 4 si le joueur bouge sur un point d\textquotesingle{}interer, 5 si le joueur peux pousser une boite mais le joueur se place sur un point d\textquotesingle{}interer et 6 si le joeuur pousse une boite sur un point d\textquotesingle{}interer et que le joueu est aussi sur un point d\textquotesingle{}interer.
|
||||
\end{DoxyReturn}
|
||||
\index{function.c@{function.c}!creatArea2D@{creatArea2D}}
|
||||
\index{creatArea2D@{creatArea2D}!function.c@{function.c}}
|
||||
\doxysubsubsection{creatArea2D()}
|
||||
{\footnotesize\ttfamily \label{function_8c_af81182d12b72ee349a71d6685217b097}
|
||||
char $\ast$$\ast$ creat\+Area2D (\begin{DoxyParamCaption}\item[{const unsigned int}]{N}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Cette fonction permet de creer une liste 2D carre.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Paramètres}
|
||||
{\em N} & La valeur N est le nombre d\textquotesingle{}élément dans le tableau. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Renvoie}
|
||||
Le pointeur du tableau 2D carre de char (1 octet).
|
||||
\end{DoxyReturn}
|
||||
\index{function.c@{function.c}!free2D@{free2D}}
|
||||
\index{free2D@{free2D}!function.c@{function.c}}
|
||||
\doxysubsubsection{free2D()}
|
||||
{\footnotesize\ttfamily \label{function_8c_af19c482f0f97b30cbb0253356ed1724b}
|
||||
void free2D (\begin{DoxyParamCaption}\item[{char $\ast$$\ast$}]{tab}{, }\item[{int}]{N}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Cette fontion permet de liberer l\textquotesingle{}espace tu tableau 2D de char.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Paramètres}
|
||||
{\em tab} & Le tableau 2D. \\
|
||||
\hline
|
||||
{\em N} & Le nombre d\textquotesingle{}éléments. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Renvoie}
|
||||
Void.
|
||||
\end{DoxyReturn}
|
||||
\index{function.c@{function.c}!inGameLoop@{inGameLoop}}
|
||||
\index{inGameLoop@{inGameLoop}!function.c@{function.c}}
|
||||
\doxysubsubsection{inGameLoop()}
|
||||
{\footnotesize\ttfamily \label{function_8c_a2387ddb7cde4f9d45198b0c131a60878}
|
||||
void in\+Game\+Loop (\begin{DoxyParamCaption}\item[{char $\ast$$\ast$}]{tab2d}{, }\item[{int}]{N}{, }\item[{\textbf{ vect} $\ast$}]{player\+Pos}{, }\item[{\textbf{ vect} $\ast$}]{targets}{, }\item[{int}]{nbr\+\_\+targets}{, }\item[{\textbf{ dis} $\ast$}]{display\+\_\+user}{, }\item[{\textbf{ score} $\ast$}]{score\+\_\+user}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
La fonction permet de faire la boucle de jeu.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Paramètres}
|
||||
{\em tab2d} & Le tableau 2d carre. \\
|
||||
\hline
|
||||
{\em N} & LE nombre d\textquotesingle{}element de tab2d. \\
|
||||
\hline
|
||||
{\em player\+Pos} & La position de depart du joueur. \\
|
||||
\hline
|
||||
{\em targets} & Le tableau de toutes les positions des points d\textquotesingle{}interer de la maps. \\
|
||||
\hline
|
||||
{\em int} & nbr\+\_\+targets Le nombre de point d\textquotesingle{}interer. \\
|
||||
\hline
|
||||
{\em display\+\_\+user} & Tout les information SDL pour afficher le jeu. \\
|
||||
\hline
|
||||
{\em score\+\_\+user} & Toute les données nécessaire pour calculer le score fini du joueur. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Renvoie}
|
||||
Void
|
||||
\end{DoxyReturn}
|
||||
\index{function.c@{function.c}!islose@{islose}}
|
||||
\index{islose@{islose}!function.c@{function.c}}
|
||||
\doxysubsubsection{islose()}
|
||||
{\footnotesize\ttfamily \label{function_8c_ac155bb183b0c26d19758d8d065baf14f}
|
||||
bool islose (\begin{DoxyParamCaption}\item[{char $\ast$$\ast$}]{tab2d}{, }\item[{const int}]{N}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
La fonction renvois si la partie est perdante.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Paramètres}
|
||||
{\em tab2d} & Le tableau 2d carre du plateau de jeu. \\
|
||||
\hline
|
||||
{\em N} & Le nombre d\textquotesingle{}éléments dans le tab2d. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Renvoie}
|
||||
True si c\textquotesingle{}est perdu, false si c\textquotesingle{}est pas perdu a cette instant.
|
||||
\end{DoxyReturn}
|
||||
\index{function.c@{function.c}!isWin@{isWin}}
|
||||
\index{isWin@{isWin}!function.c@{function.c}}
|
||||
\doxysubsubsection{isWin()}
|
||||
{\footnotesize\ttfamily \label{function_8c_a618903fbb7302d98ef0f3e2e6b35b99a}
|
||||
bool is\+Win (\begin{DoxyParamCaption}\item[{char $\ast$$\ast$}]{tab2d}{, }\item[{\textbf{ vect} $\ast$}]{targets}{, }\item[{int}]{nbr\+\_\+targets}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Cette fonction verrifie si la partie est gagnante.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Paramètres}
|
||||
{\em tab2d} & Le tableau 2D du jeu. \\
|
||||
\hline
|
||||
{\em targets} & Le tableau de toute les positions des points d\textquotesingle{}interer. \\
|
||||
\hline
|
||||
{\em nbr\+\_\+targets} & Le nombre de points d\textquotesingle{}interer. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Renvoie}
|
||||
True si le joueur a remplis tout les points d\textquotesingle{}interer, false si ce n\textquotesingle{}est pas le cas .
|
||||
\end{DoxyReturn}
|
||||
\index{function.c@{function.c}!move@{move}}
|
||||
\index{move@{move}!function.c@{function.c}}
|
||||
\doxysubsubsection{move()}
|
||||
{\footnotesize\ttfamily \label{function_8c_ac93ca31d854d91eedf3babda7511407d}
|
||||
void move (\begin{DoxyParamCaption}\item[{char $\ast$$\ast$}]{tab}{, }\item[{\textbf{ vect} $\ast$}]{player\+Pos}{, }\item[{\textbf{ vect}}]{direction}{, }\item[{\textbf{ score} $\ast$}]{score\+\_\+user}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Cette fonction effectue les deplacements du joueur et des boites en fonction de la situation.
|
||||
|
||||
|
||||
\begin{DoxyParams}{Paramètres}
|
||||
{\em tab} & Le tableau 2D du plateau de jeu. \\
|
||||
\hline
|
||||
{\em playerpos} & La position actuel du joueur. \\
|
||||
\hline
|
||||
{\em direction} & La direction que le joueur veut effectuer. \\
|
||||
\hline
|
||||
{\em score\+\_\+user} & Toutes les données nécessaire pour calculer le score fini du joueur. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Renvoie}
|
||||
Void
|
||||
\end{DoxyReturn}
|
||||
\index{function.c@{function.c}!plusVect@{plusVect}}
|
||||
\index{plusVect@{plusVect}!function.c@{function.c}}
|
||||
\doxysubsubsection{plusVect()}
|
||||
{\footnotesize\ttfamily \label{function_8c_a5b10e69716d92eadf2ed0b3942cb9d4d}
|
||||
\textbf{ vect} plus\+Vect (\begin{DoxyParamCaption}\item[{\textbf{ vect}}]{one}{, }\item[{\textbf{ vect}}]{two}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
La fonction fait une addition de vecteur, (x1+x2, y1+y2).
|
||||
|
||||
|
||||
\begin{DoxyParams}{Paramètres}
|
||||
{\em one} & Premier vecteur. \\
|
||||
\hline
|
||||
{\em two} & Deuzieme vecteur. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Renvoie}
|
||||
vect Un vecteur de l\textquotesingle{}addition de one et two.
|
||||
\end{DoxyReturn}
|
||||
\index{function.c@{function.c}!timeToText@{timeToText}}
|
||||
\index{timeToText@{timeToText}!function.c@{function.c}}
|
||||
\doxysubsubsection{timeToText()}
|
||||
{\footnotesize\ttfamily \label{function_8c_a51c9ba7a24383f1b20dcedfcb570aab5}
|
||||
char $\ast$ time\+To\+Text (\begin{DoxyParamCaption}\item[{time\+\_\+t}]{time}{}\end{DoxyParamCaption})}
|
||||
|
||||
|
||||
|
||||
Cette fonction renvois transforme le forma time en texte. (min\+:sec)
|
||||
|
||||
|
||||
\begin{DoxyParams}{Paramètres}
|
||||
{\em time} & Le temps qu\textquotesingle{}on veux convertire. \\
|
||||
\hline
|
||||
\end{DoxyParams}
|
||||
\begin{DoxyReturn}{Renvoie}
|
||||
char Le string du texte.
|
||||
\end{DoxyReturn}
|
||||
Reference in New Issue
Block a user