Skip to content
Snippets Groups Projects
Commit def10746 authored by LAMINO-HARO FERNANDO-JOEL's avatar LAMINO-HARO FERNANDO-JOEL
Browse files

Merge branch 'fix/apparently-random-moving-issue' into 'dev'

(fix: app) correctifs de la position z des pions passant souvent en dessous du...

See merge request !23
parents 41e21a57 d7c526e8
1 merge request!23(fix: app) correctifs de la position z des pions passant souvent en dessous du...
...@@ -4057,7 +4057,7 @@ PrefabInstance: ...@@ -4057,7 +4057,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3} - target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3} - target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -4304,7 +4304,7 @@ PrefabInstance: ...@@ -4304,7 +4304,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3} - target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3} - target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -4952,7 +4952,7 @@ PrefabInstance: ...@@ -4952,7 +4952,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3} - target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3} - target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -5584,7 +5584,7 @@ PrefabInstance: ...@@ -5584,7 +5584,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3} - target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3} - target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -6964,7 +6964,7 @@ PrefabInstance: ...@@ -6964,7 +6964,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3} - target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3} - target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -10990,7 +10990,7 @@ PrefabInstance: ...@@ -10990,7 +10990,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3} - target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3} - target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -12204,7 +12204,7 @@ MonoBehaviour: ...@@ -12204,7 +12204,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 767bcb1cab224414f9d34e4c28ef2a62, type: 3} m_Script: {fileID: 11500000, guid: 767bcb1cab224414f9d34e4c28ef2a62, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
partie: {fileID: 0} partie: {fileID: 1337114879}
--- !u!1 &1348310188 --- !u!1 &1348310188
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -12519,7 +12519,7 @@ PrefabInstance: ...@@ -12519,7 +12519,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3} - target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3} - target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -15476,7 +15476,7 @@ PrefabInstance: ...@@ -15476,7 +15476,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3} - target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3} - target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -15785,7 +15785,7 @@ PrefabInstance: ...@@ -15785,7 +15785,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3} - target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3} - target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -16135,7 +16135,7 @@ PrefabInstance: ...@@ -16135,7 +16135,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3} - target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3} - target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -17731,7 +17731,7 @@ PrefabInstance: ...@@ -17731,7 +17731,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3} - target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3} - target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -18215,7 +18215,7 @@ PrefabInstance: ...@@ -18215,7 +18215,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3} - target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3} - target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -19315,7 +19315,7 @@ PrefabInstance: ...@@ -19315,7 +19315,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3} - target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3} - target: {fileID: 2658351944231872930, guid: 8397b66c2ef9c534d906c7d795f8432f, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -19384,7 +19384,7 @@ PrefabInstance: ...@@ -19384,7 +19384,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3} - target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3} - target: {fileID: 3536663505520271216, guid: 7af16be55373ab6469bce7b711e6f9c3, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -19477,7 +19477,7 @@ PrefabInstance: ...@@ -19477,7 +19477,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3} - target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3} - target: {fileID: 4206974264013056578, guid: 3deff9d961b97a44885bfa2756222ca6, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
...@@ -19558,7 +19558,7 @@ PrefabInstance: ...@@ -19558,7 +19558,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3} - target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -0.08835305 value: -1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3} - target: {fileID: 6364675000599897642, guid: 80e750d7d7083db4fab4a8de56046251, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
......
...@@ -30,12 +30,13 @@ public class CurrentDraggable : MonoBehaviour ...@@ -30,12 +30,13 @@ public class CurrentDraggable : MonoBehaviour
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
for (int i = 0; i < partie.get_currentPlayer().get_pions().Length; i++) if (currentDraggable != null && partie.get_currentPlayer() != null)
{ for (int i = 0; i < partie.get_currentPlayer().get_pions().Length; i++)
if (partie.get_currentPlayer().get_pions()[i].isBougeable() && !!currentDraggable && currentDraggable.gameObject == partie.get_currentPlayer().get_pions()[i].gameObject) {
partie.get_currentPlayer().get_pions()[i].gameObject.transform.localScale = new Vector3(0.09f, 0.09f, 0.0667f); if (partie.get_currentPlayer().get_pions()[i].isBougeable() && !!currentDraggable && currentDraggable.gameObject == partie.get_currentPlayer().get_pions()[i].gameObject)
else partie.get_currentPlayer().get_pions()[i].gameObject.transform.localScale = new Vector3(0.09f, 0.09f, 0.0667f);
partie.get_currentPlayer().get_pions()[i].gameObject.transform.localScale = new Vector3(0.07f, 0.07f, 0.0667f); else
} partie.get_currentPlayer().get_pions()[i].gameObject.transform.localScale = new Vector3(0.07f, 0.07f, 0.0667f);
}
} }
} }
...@@ -68,6 +68,12 @@ public class Draggable : MonoBehaviour ...@@ -68,6 +68,12 @@ public class Draggable : MonoBehaviour
private void OnMouseDown() private void OnMouseDown()
{ {
// logger la case du pion, le joueur auquel il appartient, s'il peut bouger et s'il est selectionne et le status du pion
// Debug.Log("Case du pion : " + pion.get_case());
// Debug.Log("Joueur : " + pion.get_ID_joueur());
// Debug.Log("Bougeable : " + pion.isBougeable());
// Debug.Log("Selectionne : " + cd.get_currentDraggable());
// Debug.Log("Status : " + pion.get_status());
// clic sur un pion d'un autre joueur // clic sur un pion d'un autre joueur
if (pion.get_ID_joueur() != partie.get_ID_tour() + 1) if (pion.get_ID_joueur() != partie.get_ID_tour() + 1)
{ {
......
...@@ -63,7 +63,7 @@ public class Partie : MonoBehaviour ...@@ -63,7 +63,7 @@ public class Partie : MonoBehaviour
private Draggable currentDraggable; private Draggable currentDraggable;
//joueurs qui ont 3 strikes //joueurs qui ont 3 strikes
private int[] blackList = new int[4]; private int[] blackList = new int[4];
/** /**
* @brief Renvoie le joueur actuellement en train de jouer * @brief Renvoie le joueur actuellement en train de jouer
...@@ -110,7 +110,7 @@ public class Partie : MonoBehaviour ...@@ -110,7 +110,7 @@ public class Partie : MonoBehaviour
*/ */
void Update() void Update()
{ {
currentPlayer = plateau.get_joueurs()[ID_tour]; currentPlayer = plateau.get_joueurs()[ID_tour];
currentDice = currentPlayer.get_de(); currentDice = currentPlayer.get_de();
...@@ -215,10 +215,11 @@ public class Partie : MonoBehaviour ...@@ -215,10 +215,11 @@ public class Partie : MonoBehaviour
// Si le joueur a lancé le dé mais n'a pas de mouvements valides, passez immédiatement au joueur suivant. // Si le joueur a lancé le dé mais n'a pas de mouvements valides, passez immédiatement au joueur suivant.
if (currentPlayer.get_hasChosen() && !canPlay && currentPlayer.get_de().get_val_de() != 6) if (currentPlayer.get_hasChosen() && !canPlay && currentPlayer.get_de().get_val_de() != 6)
{ {
do { do
ID_tour = (ID_tour + 1) % nb_joueur; {
} while(plateau.get_joueurs()[ID_tour].get_strike().get_nbr_strikes() == 3); ID_tour = (ID_tour + 1) % nb_joueur;
} while (plateau.get_joueurs()[ID_tour].get_strike().get_nbr_strikes() == 3);
changeCurrentPlayer(); changeCurrentPlayer();
continue; // Skip le rest du loop et passe au tour suivant continue; // Skip le rest du loop et passe au tour suivant
} }
...@@ -227,9 +228,10 @@ public class Partie : MonoBehaviour ...@@ -227,9 +228,10 @@ public class Partie : MonoBehaviour
{ {
currentPlayer.get_strike().AddStrike(); currentPlayer.get_strike().AddStrike();
fin = winCheck(currentPlayer); fin = winCheck(currentPlayer);
do { do
{
ID_tour = (ID_tour + 1) % nb_joueur; ID_tour = (ID_tour + 1) % nb_joueur;
} while(plateau.get_joueurs()[ID_tour].get_strike().get_nbr_strikes() == 3); } while (plateau.get_joueurs()[ID_tour].get_strike().get_nbr_strikes() == 3);
changeCurrentPlayer(); changeCurrentPlayer();
continue; // Skip le rest du loop et passe au tour suivant continue; // Skip le rest du loop et passe au tour suivant
} }
...@@ -261,13 +263,15 @@ public class Partie : MonoBehaviour ...@@ -261,13 +263,15 @@ public class Partie : MonoBehaviour
six_consecutives = 0; six_consecutives = 0;
} }
// Passer au joueur suivant si nécessaire // Passer au joueur suivant si nécessaire
if (!extraTurn) { if (!extraTurn)
do { {
do
{
ID_tour = (ID_tour + 1) % nb_joueur; ID_tour = (ID_tour + 1) % nb_joueur;
} while(plateau.get_joueurs()[ID_tour].get_strike().get_nbr_strikes() == 3); } while (plateau.get_joueurs()[ID_tour].get_strike().get_nbr_strikes() == 3);
} }
changeCurrentPlayer(); changeCurrentPlayer();
} }
// UnityEngine.Debug.Log("tour " + ID_tour); // UnityEngine.Debug.Log("tour " + ID_tour);
...@@ -313,10 +317,10 @@ public class Partie : MonoBehaviour ...@@ -313,10 +317,10 @@ public class Partie : MonoBehaviour
public bool winCheck(Joueur joueur) public bool winCheck(Joueur joueur)
{ {
int countPlayer3Strikes = 0; int countPlayer3Strikes = 0;
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
if(plateau.get_joueurs()[i].get_strike().get_nbr_strikes() == 3) if (plateau.get_joueurs()[i].get_strike().get_nbr_strikes() == 3)
{ {
countPlayer3Strikes++; countPlayer3Strikes++;
} }
...@@ -332,7 +336,7 @@ public class Partie : MonoBehaviour ...@@ -332,7 +336,7 @@ public class Partie : MonoBehaviour
{ {
return false; return false;
} }
} }
return true; return true;
} }
...@@ -394,11 +398,11 @@ public class Partie : MonoBehaviour ...@@ -394,11 +398,11 @@ public class Partie : MonoBehaviour
private void changeCurrentPlayer() private void changeCurrentPlayer()
{ {
for (int k = 0; k < 4; k++) // for (int k = 0; k < 4; k++)
{ // {
if (currentPlayer.get_pions()[k].get_case() != null) // if (currentPlayer.get_pions()[k].get_case() != null)
UnityEngine.Debug.Log("pion " + k + " status: " + currentPlayer.get_pions()[k].get_status() + " pos: " + currentPlayer.get_pions()[k].get_case().get_id_Case()); // UnityEngine.Debug.Log("pion " + k + " status: " + currentPlayer.get_pions()[k].get_status() + " pos: " + currentPlayer.get_pions()[k].get_case().get_id_Case());
} // }
setPlayerCantMove(currentPlayer); setPlayerCantMove(currentPlayer);
currentPlayer.set_hasChosen(false); currentPlayer.set_hasChosen(false);
...@@ -422,21 +426,27 @@ public class Partie : MonoBehaviour ...@@ -422,21 +426,27 @@ public class Partie : MonoBehaviour
* @param joueurs * @param joueurs
*/ */
public void add_Blacklist(Joueur player) { public void add_Blacklist(Joueur player)
{
bool isInBlacklist = false; bool isInBlacklist = false;
for (int i = 0; i < blackList.Length; i++) { for (int i = 0; i < blackList.Length; i++)
if (blackList[i] == player.get_ID_joueur()) { {
if (blackList[i] == player.get_ID_joueur())
{
isInBlacklist = true; isInBlacklist = true;
break; break;
} }
} }
if (!isInBlacklist && (player.get_strike().get_nbr_strikes()== 3)) { if (!isInBlacklist && (player.get_strike().get_nbr_strikes() == 3))
{
// player.id is not in the blacklist // player.id is not in the blacklist
for (int i = 0; i < blackList.Length; i++) { for (int i = 0; i < blackList.Length; i++)
if (blackList[i] == 0) { {
blackList[i] = player.get_ID_joueur(); if (blackList[i] == 0)
break; {
blackList[i] = player.get_ID_joueur();
break;
} }
} }
} }
......
...@@ -400,7 +400,7 @@ public class Plateau : MonoBehaviour ...@@ -400,7 +400,7 @@ public class Plateau : MonoBehaviour
pts[i, 0] += 0; pts[i, 0] += 0;
break; break;
case 1: case 1:
pts[i, 0] += (joueurs[i].get_pions()[j].get_case().get_id_Case() - (joueurs[i].get_ID_joueur() - 1) * 14) % 56+1; pts[i, 0] += (joueurs[i].get_pions()[j].get_case().get_id_Case() - (joueurs[i].get_ID_joueur() - 1) * 14) % 56 + 1;
break; break;
case 2: case 2:
pts[i, 0] += 1000 + joueurs[i].get_pions()[j].get_case().get_id_Case() % 10; pts[i, 0] += 1000 + joueurs[i].get_pions()[j].get_case().get_id_Case() % 10;
...@@ -413,18 +413,22 @@ public class Plateau : MonoBehaviour ...@@ -413,18 +413,22 @@ public class Plateau : MonoBehaviour
break; break;
} }
} }
if(joueurs[i].get_strike().get_nbr_strikes()==3){ if (joueurs[i].get_strike().get_nbr_strikes() == 3)
{
pts[i, 0] -= 100000; pts[i, 0] -= 100000;
} }
} }
//tri //tri
int[] tmp = { 0, 0 }; int[] tmp = { 0, 0 };
bool permut; bool permut;
do{ do
permut=false; {
for (int i = 0; i < 3; i++){ permut = false;
Debug.Log("0: "+pts[0,0]+"2: "+pts[1,0]+"3: "+pts[2,0]+"4: "+pts[3,0]); for (int i = 0; i < 3; i++)
if (pts[i, 0] < pts[i + 1, 0]){ {
Debug.Log("0: " + pts[0, 0] + "2: " + pts[1, 0] + "3: " + pts[2, 0] + "4: " + pts[3, 0]);
if (pts[i, 0] < pts[i + 1, 0])
{
tmp[0] = pts[i + 1, 0]; tmp[0] = pts[i + 1, 0];
tmp[1] = pts[i + 1, 1]; tmp[1] = pts[i + 1, 1];
...@@ -433,20 +437,20 @@ public class Plateau : MonoBehaviour ...@@ -433,20 +437,20 @@ public class Plateau : MonoBehaviour
pts[i, 0] = tmp[0]; pts[i, 0] = tmp[0];
pts[i, 1] = tmp[1]; pts[i, 1] = tmp[1];
permut=true; permut = true;
} }
} }
} while(permut); } while (permut);
int[] clas = { 0, 0, 0, 0 }; int[] clas = { 0, 0, 0, 0 };
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
clas[i] = pts[i, 1]; clas[i] = pts[i, 1];
} }
Debug.Log("1e: " + clas[0]+" pts: "+pts[0,0]); Debug.Log("1e: " + clas[0] + " pts: " + pts[0, 0]);
Debug.Log("2e: " + clas[1]+" pts: "+pts[1,0]); Debug.Log("2e: " + clas[1] + " pts: " + pts[1, 0]);
Debug.Log("3e: " + clas[2]+" pts: "+pts[2,0]); Debug.Log("3e: " + clas[2] + " pts: " + pts[2, 0]);
Debug.Log("4e: " + clas[3]+" pts: "+pts[3,0]); Debug.Log("4e: " + clas[3] + " pts: " + pts[3, 0]);
//return clas; //return clas;
} }
} }
...@@ -118,7 +118,7 @@ public class SnapController : MonoBehaviour ...@@ -118,7 +118,7 @@ public class SnapController : MonoBehaviour
{ {
float distCovered = (Time.time - startTime) * 5; float distCovered = (Time.time - startTime) * 5;
fracJourney = distCovered / journeyLength; fracJourney = distCovered / journeyLength;
pawn.transform.position = Vector3.Lerp(start, end, fracJourney); pawn.transform.position = Vector2.Lerp(start, end, fracJourney);
yield return null; yield return null;
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment