Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lemeilleurjeudumonde
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tacticalrpg
lemeilleurjeudumonde
Commits
a9a4b7e1
There was a problem fetching the pipeline summary.
Commit
a9a4b7e1
authored
8 years ago
by
Montjoie Henri
Browse files
Options
Downloads
Plain Diff
merge
parents
c418edda
bac0407f
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/controleur.c
+18
-14
18 additions, 14 deletions
src/controleur.c
src/controleur.h
+1
-0
1 addition, 0 deletions
src/controleur.h
src/joueur.c
+1
-1
1 addition, 1 deletion
src/joueur.c
src/main.c
+2
-2
2 additions, 2 deletions
src/main.c
with
22 additions
and
17 deletions
src/controleur.c
+
18
−
14
View file @
a9a4b7e1
...
...
@@ -215,6 +215,7 @@ Case * trouverCase(Carte_Jeu * c, int x, int y){
* \return L'indice de la classe du personnage si le Personnage a été correctement ajouté, -1 sinon.
*/
int
ajouterPersonnage
(
char
*
nomClasse
,
int
numTab
,
int
numJoueur
){
Personnage
*
p
=
NULL
;
int
i
;
i
=
0
;
//Recherche de la classe dans le Package
...
...
@@ -226,18 +227,16 @@ int ajouterPersonnage(char * nomClasse, int numTab, int numJoueur){
}
//Création du personnage
Personnage
*
p
=
default_personnage
(
i
,
packGlobal
);
printf
(
"La classe du personnage %d du joueur %d est %s
\n
"
,
numTab
+
1
,
numJoueur
,
getClasse
(
p
));
p
=
default_personnage
(
i
,
packGlobal
);
//Ajout du Personnage à l'équipe du Joueur
switch
(
numJoueur
){
case
1
:
setOnFirstJoueur
(
partieGlobale
->
participants
);
setOnFirstJoueur
(
getListJoueur
(
partieGlobale
)
);
break
;
case
2
:
setOnFirstJoueur
(
partieGlobale
->
participants
);
nextJoueur
(
partieGlobale
->
participants
);
setOnFirstJoueur
(
getListJoueur
(
partieGlobale
)
);
nextJoueur
(
getListJoueur
(
partieGlobale
)
);
break
;
default:
return
-
1
;
...
...
@@ -269,6 +268,7 @@ int selectionnerCarte(char * nomCarte){
while
((
strcmp
(
nomCarte
,
packGlobal
.
Cartes_Package
[
i
].
nom
)
!=
0
)
&&
(
i
<
nbCartes
())){
i
++
;
}
if
(
i
>=
nbCartes
()){
return
0
;
}
...
...
@@ -276,22 +276,26 @@ int selectionnerCarte(char * nomCarte){
if
(
initCarte
(
&
packGlobal
.
Cartes_Package
[
i
],
getCarte
(
partieGlobale
),
&
packGlobal
)
==
0
){
return
0
;
}
printf
(
"la carte selectionnee est %s
\n
"
,
nomCarte
);
return
1
;
}
void
initPositions
(){
// Positionnement des Personnages sur la Carte_Jeu.
setOnFirstJoueur
(
partieGlobale
->
participants
);
int
i
;
setOnFirstJoueur
(
getListJoueur
(
partieGlobale
));
for
(
i
=
0
;
i
<
TAILLE_MAX_GROUPE
;
i
++
){
printf
(
"test1
\n
"
);
setPosition
(
getCurrentJoueur
(
partieGlobale
->
participants
)
->
groupe
[
i
],
&
partieGlobale
->
c
->
Tab_Cases
[
6
+
i
][
0
]);
//le probleme est ici
printf
(
"test2
\n
"
);
setPosition
(
getPersonnage
(
getCurrentJoueur
(
getListJoueur
(
partieGlobale
)),
i
),
&
partieGlobale
->
c
->
Tab_Cases
[
6
+
i
][
0
]);
}
nextJoueur
(
partieGlobale
->
participants
);
nextJoueur
(
getListJoueur
(
partieGlobale
)
);
for
(
i
=
0
;
i
<
TAILLE_MAX_GROUPE
;
i
++
){
setPosition
(
get
CurrentJoueur
(
partieGlobale
->
participants
)
->
groupe
[
i
]
,
&
partieGlobale
->
c
->
Tab_Cases
[
6
+
i
][
HAUT_MAX_CARTE
-
1
]);
setPosition
(
get
Personnage
(
getCurrentJoueur
(
getListJoueur
(
partieGlobale
)),
i
)
,
&
partieGlobale
->
c
->
Tab_Cases
[
6
+
i
][
HAUT_MAX_CARTE
-
1
]);
}
return
1
;
}
This diff is collapsed.
Click to expand it.
src/controleur.h
+
1
−
0
View file @
a9a4b7e1
...
...
@@ -27,6 +27,7 @@ Case * trouverCase(Carte_Jeu * c, int x, int y);
int
ajouterPersonnage
(
char
*
nomClasse
,
int
numTab
,
int
numJoueur
);
int
selectionnerCarte
(
char
*
nomCarte
);
void
initPositions
();
#endif // CONTROLEUR_H
...
...
This diff is collapsed.
Click to expand it.
src/joueur.c
+
1
−
1
View file @
a9a4b7e1
...
...
@@ -65,7 +65,7 @@ void setNomJoueur(Joueur * j, char * nom){
* \return Un pointeur vers le Personnage du Joueur a l'indice i dans le tableau groupe, NULL si l'indice n'est pas dans le tableau.
*/
Personnage
*
getPersonnage
(
Joueur
*
j
,
int
i
){
if
(
i
<
TAILLE_MAX_GROUPE
-
1
){
if
(
i
<
TAILLE_MAX_GROUPE
){
return
j
->
groupe
[
i
];
}
return
NULL
;
...
...
This diff is collapsed.
Click to expand it.
src/main.c
+
2
−
2
View file @
a9a4b7e1
...
...
@@ -10,6 +10,8 @@
#include
"carte.h"
#include
"Interface.h"
#include
"gamePackage.h"
#include
"joueur.h"
#include
"partie.h"
/*!
...
...
@@ -87,8 +89,6 @@ int main(void)
{
//init_jeu("../resources/Init_jeu.xml");
initJeu
();
main_affichage
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment