-
Notifications
You must be signed in to change notification settings - Fork 24
Iteration2 #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
thomasxyz429
wants to merge
15
commits into
la-urre:main
Choose a base branch
from
bouboucouscous:iteration2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Iteration2 #4
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6eb1998
debut d'iteration2:
bouboucouscous def9b2b
-Premiere implementation Equipe
thomasxyz429 9da3815
implementer 1 joueur et 3 ordinateurs qui jouent, 1V1V1V1
PedassoDeBolo 2ac7f52
ajouter de la rotation par equipe et personalisation des noms des ord…
thomasxyz429 206eadf
-mus implementé
thomasxyz429 4aa797a
-adaptiation 2v2 phase Grand
thomasxyz429 3928cf3
-adaptiation 2v2 phase Grand
thomasxyz429 5182744
-adaptiation 2v2 phase Paire
thomasxyz429 aafdd25
tous les tests sont sans erreurs et doivent marcher si le code serait…
bouboucouscous a9be594
Merge remote-tracking branch 'origin/iteration2' into iteration2
bouboucouscous 985c98e
tous les tests fonctionnent sauf 1
bouboucouscous a164548
tous les tests fonctionnent sauf 1
bouboucouscous 1b5dd0f
Merge pull request #14 from bouboucouscous/testvalidation
bouboucouscous 6140154
rotation
bouboucouscous a3da586
Merge pull request #16 from bouboucouscous/testvalidation
bouboucouscous File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package com.montaury.mus.jeu.equipe; | ||
|
|
||
| import com.montaury.mus.jeu.Manche; | ||
| import com.montaury.mus.jeu.joueur.Joueur; | ||
|
|
||
| public class Equipe { | ||
| //attribut | ||
| public Joueur joueur1; | ||
| public Joueur joueur2; | ||
|
|
||
| //constructeur | ||
| public Equipe(Joueur j1, Joueur j2) | ||
| { | ||
| joueur1 = j1; | ||
| joueur2 = j2; | ||
| } | ||
| //methodes | ||
|
|
||
| public Joueur getJoueur1() { | ||
| return joueur1; | ||
| } | ||
|
|
||
| public Joueur getJoueur2() { | ||
| return joueur2; | ||
| } | ||
|
|
||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| package com.montaury.mus.jeu.equipe; | ||
|
|
||
| import com.montaury.mus.jeu.joueur.Joueur; | ||
|
|
||
| import java.util.Iterator; | ||
|
|
||
| import java.util.LinkedList; | ||
| import java.util.List; | ||
|
|
||
| public class Opposants { | ||
| private Equipe equipe1; | ||
| private Equipe equipe2; | ||
| private LinkedList<Joueur> joueursDansLordre; | ||
|
|
||
|
|
||
| public Opposants(Equipe equipe1, Equipe equipe2) { | ||
| this.equipe1 = equipe1; | ||
| this.equipe2 = equipe2; | ||
| joueursDansLordre = new LinkedList<Joueur>(); | ||
| joueursDansLordre.add(joueur1()); | ||
| joueursDansLordre.add(joueur3()); | ||
| joueursDansLordre.add(joueur2()); | ||
| joueursDansLordre.add(joueur4()); | ||
| } | ||
| // permet de changer celui qui distribue et celui qui parle en premier | ||
| public void tourner() { | ||
| Joueur jouerTempon = joueursDansLordre.removeLast(); | ||
| joueursDansLordre.addFirst(jouerTempon); | ||
| equipe1.joueur1=joueursDansLordre.get(0); | ||
| equipe2.joueur1=joueursDansLordre.get(1); | ||
| equipe1.joueur2=joueursDansLordre.get(2); | ||
| equipe2.joueur2=joueursDansLordre.get(3); | ||
| } | ||
|
|
||
| public Joueur joueur1() { | ||
| return equipe1.joueur1; | ||
| } | ||
| public Joueur joueur2() {return equipe1.joueur2;} | ||
| public Joueur joueur3() { | ||
| return equipe2.joueur1; | ||
| } | ||
| public Joueur joueur4() { | ||
| return equipe2.joueur2; | ||
| } | ||
|
|
||
| public Iterator<Joueur> itererDansLOrdre() { //permet de passer d'un Joueur a l autre pour avoir ses données | ||
| return new IteratorInfini(this); | ||
| } | ||
|
|
||
| public List<Joueur> dansLOrdre() { | ||
| return joueursDansLordre; | ||
| } | ||
|
|
||
| private static class IteratorInfini implements Iterator<Joueur> { | ||
| private final Opposants opposants; | ||
| private Joueur suivant; | ||
|
|
||
| public IteratorInfini(Opposants opposants) { | ||
| this.opposants = opposants; | ||
| suivant = opposants.equipe1.joueur1; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean hasNext() { | ||
| return true; | ||
| } | ||
|
|
||
| @Override | ||
| public Joueur next() { | ||
| Joueur next = suivant; | ||
| if (opposants.equipe1.joueur1 == next) | ||
| { | ||
| suivant = opposants.equipe2.joueur1; | ||
| } | ||
|
|
||
| else if (opposants.equipe2.joueur1 == next) | ||
| { | ||
| suivant = opposants.equipe1.joueur2; | ||
| } | ||
|
|
||
| else if (opposants.equipe1.joueur2 == next) | ||
| { | ||
| suivant = opposants.equipe2.joueur2; | ||
| } | ||
|
|
||
| else if (opposants.equipe2.joueur2 == next) | ||
| { | ||
| suivant = opposants.equipe1.joueur1; | ||
| } | ||
|
|
||
| // suivant = suivant == opposants.joueurEsku.joueur1 ? opposants.joueurZaku.joueur1 : opposants.joueurEsku.joueur1; | ||
| return next; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a