Пример #1
0
        private void Update()
        {
            _player = 1 - _player;
            ChessBoard.InvalidateVisual();

            var history = _game.GetHistory();

            var result = new List <string>();

            for (var i = 0; i < history.Count; i += 2)
            {
                var num     = i / 2 + 1;
                var numSize = num.ToString().Length;
                var spaces  = new string(' ', Math.Max(2, numSize) - numSize);

                var text = $"{spaces}{num}. ";
                text += $"{history[i]}";
                if (i + 1 < history.Count)
                {
                    text += $"\u2003{history[i + 1]}";
                }
                result.Add(text);
            }

            ListBox.ItemsSource = result;
            ListBox.ScrollIntoView(result.LastOrDefault());
        }
Пример #2
0
        /// <summary>
        /// Fill EPlayer object by reading SqlDataReader returned by stored procedure
        /// </summary>
        /// <param name="oReader"></param>
        /// <returns></returns>
        static private EPlayer ReadData(SqlDataReader oReader)
        {
            try
            {
                EPlayer oData = new EPlayer();

                //Player
                oData.ID             = oReader.GetString(oReader.GetOrdinal("HardwareID"));
                oData.Application.ID = oReader.GetInt32(oReader.GetOrdinal("ApplicationID"));

                if (!oReader.IsDBNull(oReader.GetOrdinal("LatestIP")))
                {
                    oData.IP = oReader.GetString(oReader.GetOrdinal("LatestIP"));
                }
                if (!oReader.IsDBNull(oReader.GetOrdinal("isBanned")))
                {
                    oData.isBanned = oReader.GetString(oReader.GetOrdinal("isBanned")) == "1";
                }

                return(oData);
            }
            catch (SqlException e)
            {
                throw e;
            }
            catch (System.Exception e)
            {
                throw e;
            }
        }
Пример #3
0
    // Second step of flying is to move the piece
    private bool FlyingPiece(Vector2 mousePosition, EPlayer player)
    {
        GameObject pieceToMove = null;

        Selector.SetActive(true);
        MovingSelector.SetActive(false);
        if (mousePosition != Vector2.zero && dicoOfPlayerPosition[mousePosition] == EPlayer.EMPTY)
        {
            MovingSelector.SetActive(true);
            MovingSelector.transform.position = mousePosition;
            if (Input.GetMouseButtonDown(0))
            {
                pieceToMove = FindPieceWithPosition(pieceSelected, player);
                pieceToMove.transform.position      = mousePosition;
                dicoOfPlayerPosition[mousePosition] = player;
                dicoOfPlayerPosition[pieceSelected] = EPlayer.EMPTY;
                pieceSelected = mousePosition;
                info.text     = "";
                return(true);
            }
        }
        if (mousePosition == pieceSelected && Input.GetMouseButtonDown(0) && timeT > 1f)
        {
            Debug.Log(timeT);
            timeT         = 0f;
            pieceSelected = Vector2.zero;
            info.text     = "";
        }
        return(false);
    }
Пример #4
0
    private void UpdateSelectable(EPlayer player, float horizontalAxis, float verticalAxis)
    {
        EventSystem currentEventSystem = EventSystem.current;

        if (currentEventSystem != null)
        {
            GameObject selectedGO = currentEventSystem.currentSelectedGameObject;
            if (selectedGO != null)
            {
                Selectable selectableGO = selectedGO.GetComponent <Selectable>();
                if (selectableGO != null)
                {
                    if (horizontalAxis < 0f)
                    {
                        selectableGO.FindSelectableOnLeft()?.Select();
                    }
                    else if (horizontalAxis > 0f)
                    {
                        selectableGO.FindSelectableOnRight()?.Select();
                    }
                    else if (verticalAxis < 0f)
                    {
                        selectableGO.FindSelectableOnDown()?.Select();
                    }
                    else if (verticalAxis > 0f)
                    {
                        selectableGO.FindSelectableOnUp()?.Select();
                    }
                }
            }
        }
    }
Пример #5
0
        public void SetPlayer(EPlayer playerType)
        {
            Player player = _playersArray.Find(p => p.playerType == playerType);

            _player     = player;
            _playerType = player.playerType;
        }
Пример #6
0
        public CAnalyzeResult Analyze(EPlayer player, int depth)
        {
            if (depth <= 0)
            {
                throw new ArgumentException($"Значение параметра \"{nameof(depth)}\" должен быть больше 0");
            }

            var   maxMark    = double.NegativeInfinity;
            CMove maxMove    = null;
            var   iterations = 0;

            foreach (var move in GetMoves(player))
            {
                //Делаем ход
                move.Do();

                var mark = GetMark(player, depth, ref iterations);
                if (maxMark < mark)
                {
                    maxMark = mark;
                    maxMove = move;
                }

                //Откатываем ход
                move.Undo();
            }

            return(new CAnalyzeResult(maxMove, maxMark, iterations));
        }
Пример #7
0
 public void Clear()
 {
     _playerType = EPlayer.NGO;
     _playersArray.Clear();
     _player = null;
     _init   = false;
 }
 private void GetGoodInput( EPlayer player )
 {
     switch( player )
     {
     case EPlayer.BLUE:
         if( PlayerPrefs.GetInt("PLAYER_BLUE_ISAI") == 1 )
             _isButtonHitted = true;
         if( Input.GetKey(KeyCode.Joystick1Button0) )
             _isButtonHitted = true;
         break;
     case EPlayer.GREEN:
         if( PlayerPrefs.GetInt("PLAYER_GREEN_ISAI") == 1 )
             _isButtonHitted = true;
         if( Input.GetKeyDown(KeyCode.Joystick2Button0) )
             _isButtonHitted = true;
         break;
     case EPlayer.RED:
         if( PlayerPrefs.GetInt("PLAYER_RED_ISAI") == 1 )
             _isButtonHitted = true;
         if( Input.GetKeyDown(KeyCode.Joystick3Button0) )
             _isButtonHitted = true;
         break;
     case EPlayer.YELLOW:
         if( PlayerPrefs.GetInt("PLAYER_YELLOW_ISAI") == 1 )
             _isButtonHitted = true;
         if( Input.GetKeyDown(KeyCode.Joystick4Button0) )
             _isButtonHitted = true;
         break;
     }
 }
Пример #9
0
 public static Coord LimitByPlayerSide(this Coord coord, EPlayer player)
 {
     coord.Y = player == EPlayer.First
 ? Clamp(coord.Y, 0, 2)
 : Clamp(coord.Y, 3, 5);
     return(coord);
 }
Пример #10
0
 public SavePlayerPosition(int cID, EPlayer cPlayer, Vector3 cPos)
 {
     cellID = cID;
     player = cPlayer;
     X      = cPos.x;
     Y      = cPos.y;
     Z      = cPos.z;
 }
 public void UnfocusOnPlayer( EPlayer player )
 {
     _mainCamera.gameObject.SetActive(true);
     _mainCamera.GetComponent<AudioListener>().enabled = true;
     _playerCamera.gameObject.SetActive(false);
     _playerCamera.GetComponent<AudioListener>().enabled = false;
     _playerCanvas.gameObject.SetActive(false);
 }
Пример #12
0
    public override void OnPlayerUnregistered(GameObject playerGO)
    {
        base.OnPlayerUnregistered(playerGO);

        EPlayer player = playerGO.CompareTag(Player.Player1) ? EPlayer.Player1 : EPlayer.Player2;

        m_PlayerSpriteRendererList[(int)player] = null;
    }
Пример #13
0
 public BlockBreakEventArgs(EPlayer player, Block block, Item item, bool instaBreak, List <Item> drops, int xpDrops = 0) : base(block)
 {
     this.item       = item;
     this.player     = player;
     this.instaBreak = instaBreak;
     this.blockDrops = player.GameMode == MiNET.Worlds.GameMode.Survival ? block.GetDrops(item).ToList() : new List <Item>();
     this.xpDrops    = xpDrops;
 }
Пример #14
0
    public async void GameOver(EPlayer winPlayer)
    {
        Debug.Log("Win Player : " + winPlayer);
        await Task.Delay(1000);

        GameState = EGameState.GAME_OVER;
        gameOverDialog.SetActive(true);
        textGameOver.GetComponent <TextMeshProUGUI>().text = "Win Player : " + winPlayer;
    }
Пример #15
0
    public T GetPlayerComponent <T>(EPlayer player) where T : Behaviour
    {
        GameObject playerGO = m_Players.Find(p => p.tag == player.ToString());

        if (playerGO)
        {
            return(playerGO.GetComponentInChildren <T>());
        }
        return(null);
    }
Пример #16
0
    private bool PlayLostRoundAnimation(EPlayer lostPlayer)
    {
        if (!GameManager.Instance.GetPlayerComponent <PlayerHealthComponent>(lostPlayer).IsDead())
        {
            GameManager.Instance.GetPlayerComponent <Animator>(lostPlayer).Play(K_ROUND_LOST_ANIM, 0, 0);
            return(true);
        }

        return(false);
    }
Пример #17
0
 private void ShuffleStartPlayer()
 {
     CurrentPlayer = EPlayer.Tied;
     do
     {
         Array  values = Enum.GetValues(typeof(EPlayer));
         Random random = new Random();
         CurrentPlayer = (EPlayer)values.GetValue(random.Next(values.Length));
     }while (CurrentPlayer == EPlayer.Tied);
 }
Пример #18
0
 public static TSPlayer TSPlayer(this EPlayer eplr)
 {
     if (UserManager.GetTSPlayerFromName(eplr.Name, out TSPlayer tsp))
     {
         return(tsp);
     }
     else
     {
         return(null);
     }
 }
Пример #19
0
 public Player GetPlayerByType(EPlayer playerType)
 {
     foreach (Player p in _playersArray)
     {
         if (p.playerType == playerType)
         {
             return(p);
         }
     }
     return(null);
 }
Пример #20
0
 private bool checkDiagonal1PlayerWin(EPlayer player)
 {
     for (int i = 0; i < m_nSize; i++)
     {
         if (!m_arBoard[i, i].HasValue || m_arBoard[i, i] != player)
         {
             return(false);
         }
     }
     return(true);
 }
Пример #21
0
 bool checkColsPlayerWin(EPlayer player)
 {
     for (int col = 0; col < m_nSize; col++)
     {
         if (checkColPlayerWin(col, player))
         {
             return(true);
         }
     }
     return(false);
 }
Пример #22
0
 bool checkRowsPlayerWin(EPlayer player)
 {
     for (int row = 0; row < m_nSize; row++)
     {
         if (checkRowPlayerWin(row, player))
         {
             return(true);
         }
     }
     return(false);
 }
Пример #23
0
 public PlayerEvent()
 {
     if (PlayerManager.Instance.player != null)
     {
         playerType = PlayerManager.Instance.player.GetComponent <Player>().playerType;
     }
     else
     {
         playerType = EPlayer.NONE;
     }
 }
Пример #24
0
    public void AddOnPlayerRegisteredCallback(Action <GameObject> method, EPlayer player)
    {
        GetOnPlayerRegisteredCallback(player) += method;

        GameObject playerGO = GetPlayer(player);

        if (playerGO != null)
        {
            method?.Invoke(playerGO);
        }
    }
Пример #25
0
        bool checkRowPlayerWin(int nRow, EPlayer player)
        {
            for (int col = 0; col < m_nSize; col++)
            {
                if (!isPlayerOnBoardPosition(nRow, col, player))
                {
                    return(false);
                }
            }

            return(true);
        }
 public void FocusOnPlayer( EPlayer player, float percentage )
 {
     _mainCamera.gameObject.SetActive(false);
     _mainCamera.GetComponent<AudioListener>().enabled = false;
     _playerCamera.gameObject.SetActive(true);
     _playerCamera.GetComponent<AudioListener>().enabled = true;
     _playerCanvas.gameObject.SetActive(true);
     var pos = Utils.Instance.GetPlayerByColor(player).transform.position;
     var rot = Utils.Instance.GetPlayerByColor(player).transform.rotation;
     _playerCamera.gameObject.transform.position = Vector3.Lerp(_mainCamera.gameObject.transform.position, new Vector3(pos.x + 4, pos.y + 5, pos.z - 15), percentage);
     _playerCamera.gameObject.transform.rotation = Quaternion.Lerp(_playerCamera.gameObject.transform.rotation, new Quaternion(rot.x + 4, rot.y + 5, rot.z - 15, rot.w), percentage);
 }
Пример #27
0
        public UnitView Init(UnitInfo info, EPlayer player, HealthBar healthBar)
        {
            this.info      = new UnitInfo(info);
            this.healthBar = healthBar;
            Stats          = info;
            Player         = player;
            Animator       = GetComponentInChildren <Animator>();

            fsm = new UnitFsm(this);

            return(this);
        }
Пример #28
0
        bool checkColPlayerWin(int nCol, EPlayer player)
        {
            for (int nRow = 0; nRow < m_nSize; nRow++)
            {
                if (!isPlayerOnBoardPosition(nRow, nCol, player))
                {
                    return(false);
                }
            }

            return(true);
        }
Пример #29
0
        private void ResetThumbs(EPlayer player)
        {
            if (player == EPlayer.Player1)
            {
                picThumb21Player1.Visible                                                                             =
                    picThumb22Player1.Visible                                                                         =
                        picThumb23Player1.Visible                                                                     =
                            picThumb24Player1.Visible                                                                 =
                                picThumb25Player1.Visible                                                             =
                                    picThumb26Player1.Visible                                                         =
                                        picThumb27Player1.Visible                                                     =
                                            picThumb28Player1.Visible                                                 =
                                                picThumb29Player1.Visible                                             =
                                                    picThumb30Player1.Visible                                         =
                                                        picThumb31Player1.Visible                                     =
                                                            picThumb32Player1.Visible                                 =
                                                                picThumb33Player1.Visible                             =
                                                                    picThumb34Player1.Visible                         =
                                                                        picThumb35Player1.Visible                     =
                                                                            picThumb36Player1.Visible                 =
                                                                                picThumb37Player1.Visible             =
                                                                                    picThumb38Player1.Visible         =
                                                                                        picThumb39Player1.Visible     =
                                                                                            picThumb40Player1.Visible =
                                                                                                false;
            }

            if (player == EPlayer.Player2)
            {
                picThumb21Player2.Visible                                                                             =
                    picThumb22Player2.Visible                                                                         =
                        picThumb23Player2.Visible                                                                     =
                            picThumb24Player2.Visible                                                                 =
                                picThumb25Player2.Visible                                                             =
                                    picThumb26Player2.Visible                                                         =
                                        picThumb27Player2.Visible                                                     =
                                            picThumb28Player2.Visible                                                 =
                                                picThumb29Player2.Visible                                             =
                                                    picThumb30Player2.Visible                                         =
                                                        picThumb31Player2.Visible                                     =
                                                            picThumb32Player2.Visible                                 =
                                                                picThumb33Player2.Visible                             =
                                                                    picThumb34Player2.Visible                         =
                                                                        picThumb35Player2.Visible                     =
                                                                            picThumb36Player2.Visible                 =
                                                                                picThumb37Player2.Visible             =
                                                                                    picThumb38Player2.Visible         =
                                                                                        picThumb39Player2.Visible     =
                                                                                            picThumb40Player2.Visible =
                                                                                                false;
            }
        }
        public UnitView Create(string name, Coord coord, EPlayer player)
        {
            var position = coordFinder.PositionAt(coord).WithY(unitPrefab.Height);
            var rotation = player.ToQuaternion();
            var unitInfo = unitInfos[name];

            var obj = Object.Instantiate(unitPrefab, position, rotation);

            var healthBar = obj.GetComponentInChildren <HealthBar>()
                            .Init(player.ToColor(), unitInfo.Health, mainCamera);

            return(obj.Init(new UnitInfo(unitInfo), player, healthBar));
        }
Пример #31
0
        private void TurnCard(EPlayer player)
        {
            if (player == EPlayer.Player1)
            {
                Player1IsVisible = !Player1IsVisible;
                RefreshCard(EPlayer.Player1);
            }

            if (player == EPlayer.Player2)
            {
                Player2IsVisible = !Player2IsVisible;
                RefreshCard(EPlayer.Player2);
            }
        }
Пример #32
0
        public static String ToString(EPlayer player)
        {
            switch (player)
            {
            case EPlayer.Player1:
                return("Jogador 1");

            case EPlayer.Player2:
                return("Jogador 2");

            default:
                return(String.Empty);
            }
        }
Пример #33
0
        private bool checkDiagonal2PlayerWin(EPlayer player)
        {
            int col = m_nSize - 1;

            for (int row = 0; row < m_nSize; row++)
            {
                if (!m_arBoard[row, col].HasValue || m_arBoard[row, col] != player)
                {
                    return(false);
                }
                col--;
            }
            return(true);
        }
 public Player GetPlayerByColor(EPlayer color)
 {
     switch (color)
     {
         case EPlayer.BLUE:
             return playerBlue;
         case EPlayer.GREEN:
             return playerGreen;
         case EPlayer.RED:
             return playerRed;
         case EPlayer.YELLOW:
             return playerYellow;
         default:
             return null;
     }
 }
 public Material GetMatFromColor(EPlayer color)
 {
     switch (color)
     {
         case EPlayer.BLUE:
             return blue;
         case EPlayer.GREEN:
             return green;
         case EPlayer.RED:
             return red;
         case EPlayer.YELLOW:
             return yellow;
         default:
             return null;
     }
 }
 public Vector3 GetCasePosition(EPlayer currentPlayer, bool isReturningFromMiniGame)
 {
     if (_previousCase && !isReturningFromMiniGame) //exclu la case départ
     {
         if (_previousCase.GetCaseType() != ECaseType.INTERSECTION)
             _previousCase.RemovePlayerFromCase(currentPlayer);//on supprime le player actuelle de la liste de la case d'avant (sauf si c'est la case de départ)
     }
     if (_caseType == ECaseType.INTERSECTION)
         return _transform.position;
     if (_playersOnCase.Count == 0)//si jamais la case est vide on ajoute dans la liste le joueur a la position 0 et on retourne la position de la case (position centrale)
     {
         _playersOnCase.Add(new SPlayerCasePos() { player = currentPlayer, casePos = 0 });//on pourrait assigner casePos avec la fonction GetNoneOccupiedPos mais bon
         return _transform.position;
     }
     else if (_playersOnCase.Count == 1)//s'il y a une personne dessus (en pos centrale) on la déplace avant de donner la position du nouveau joueur a mettre sur la case
     {
         var p = _playersOnCase[0].player;
         _playersOnCase[0] = new SPlayerCasePos() { player = p, casePos = 1 };
         Utils.Instance.GetPlayerByColor(_playersOnCase[0].player).transform.position = GetPositionByID(_playersOnCase[0].casePos);
     }
     var i = GetNoneOccupiedPos();//on prend l'id d'une position alternative pas déja prise
     _playersOnCase.Add(new SPlayerCasePos() { player = currentPlayer, casePos = i });//on ajoute le joueur courant a la position retournée par la fonction
     return GetPositionByID(i);//on retourne cette position pour le mouvement dans le GameManager
 }
 public void NextPlayer()
 {
     _currentPlayer = GetNextPlayer();
 }
 public void RemovePlayerFromCase(EPlayer player)
 {
     try
     {
         var index = _playersOnCase.FindIndex(f => f.player == player);
         _playersOnCase.RemoveAt(index);
     }
     catch (Exception ex)
     {
         Debug.Log(ex.ToString());
     }
 }
 private void ConvertColor( EPlayer player )
 {
     switch( player )
     {
     case EPlayer.BLUE:
         _type = EColorCaseType.BLUE;
         _meshRenderer.material = Utils.Instance.blue;
         break;
     case EPlayer.GREEN:
         _type = EColorCaseType.GREEN;
         _meshRenderer.material = Utils.Instance.green;
         break;
     case EPlayer.RED:
         _type = EColorCaseType.RED;
         _meshRenderer.material = Utils.Instance.red;
         break;
     case EPlayer.YELLOW:
         _type = EColorCaseType.YELLOW;
         _meshRenderer.material = Utils.Instance.yellow;
         break;
     }
 }
 private bool HasPlayerOnCase( EPlayer player, Vector3 pos )
 {
     switch( player )
     {
     case EPlayer.BLUE:
         return (
                 ComparePos(Utils.Instance.playerGreen.transform.position, pos)
             || ComparePos(Utils.Instance.playerRed.transform.position, pos)
             || ComparePos(Utils.Instance.playerYellow.transform.position, pos)
             );
     case EPlayer.GREEN:
         return (
                ComparePos(Utils.Instance.playerBlue.transform.position, pos)
             || ComparePos(Utils.Instance.playerRed.transform.position, pos)
             || ComparePos(Utils.Instance.playerYellow.transform.position, pos)
             );
     case EPlayer.RED:
         return (
                 ComparePos(Utils.Instance.playerGreen.transform.position, pos)
             || ComparePos(Utils.Instance.playerBlue.transform.position, pos)
             || ComparePos(Utils.Instance.playerYellow.transform.position, pos)
             );
     case EPlayer.YELLOW:
         return (
                ComparePos(Utils.Instance.playerGreen.transform.position, pos)
             || ComparePos(Utils.Instance.playerRed.transform.position, pos)
             || ComparePos(Utils.Instance.playerBlue.transform.position, pos)
             );
     default:
         return false;
     }
 }
    void Start()
    {
        //TMP

        //PlayerPrefs.SetString("PLAYER_BLUE_NAME", "NONAME1");
        //PlayerPrefs.SetString("PLAYER_GREEN_NAME", "NONAME2");
        //PlayerPrefs.SetString("PLAYER_RED_NAME", "NONAME3");
        //PlayerPrefs.SetString("PLAYER_YELLOW_NAME", "NONAME4");
        //
        //PlayerPrefs.SetInt("PLAYER_BLUE_ISAI", 1);
        //PlayerPrefs.SetInt("PLAYER_GREEN_ISAI", 1);
        //PlayerPrefs.SetInt("PLAYER_RED_ISAI", 1);
        //PlayerPrefs.SetInt("PLAYER_YELLOW_ISAI", 1);
        //
        //PlayerPrefs.SetInt("PLAYER_BLUE_STARS", 0);
        //PlayerPrefs.SetInt("PLAYER_GREEN_STARS", 0);
        //PlayerPrefs.SetInt("PLAYER_RED_STARS", 0);
        //PlayerPrefs.SetInt("PLAYER_YELLOW_STARS", 0);
        //
        //* PlayerPrefs.SetInt("PLAYER_BLUE_CASEID", 0);
        //PlayerPrefs.SetInt("PLAYER_GREEN_CASEID", 0);
        //PlayerPrefs.SetInt("PLAYER_RED_CASEID", 0);
        //PlayerPrefs.SetInt("PLAYER_YELLOW_CASEID", 0);*/
        //
        //PlayerPrefs.SetInt("GAME_ISFIRSTRUN", 0);
        //
        ////TMP

        _playerOrder = new List<EPlayer>(4);
        Utils.Instance.GetPlayerByColor(EPlayer.BLUE).SetName(PlayerPrefs.GetString("PLAYER_BLUE_NAME"));
        Utils.Instance.GetPlayerByColor(EPlayer.GREEN).SetName(PlayerPrefs.GetString("PLAYER_GREEN_NAME"));
        Utils.Instance.GetPlayerByColor(EPlayer.RED).SetName(PlayerPrefs.GetString("PLAYER_RED_NAME"));
        Utils.Instance.GetPlayerByColor(EPlayer.YELLOW).SetName(PlayerPrefs.GetString("PLAYER_YELLOW_NAME"));
        Utils.Instance.GetPlayerByColor(EPlayer.BLUE).SetIsAI(PlayerPrefs.GetInt("PLAYER_BLUE_ISAI") == 1 ? true : false);
        Utils.Instance.GetPlayerByColor(EPlayer.GREEN).SetIsAI(PlayerPrefs.GetInt("PLAYER_GREEN_ISAI") == 1 ? true : false);
        Utils.Instance.GetPlayerByColor(EPlayer.RED).SetIsAI(PlayerPrefs.GetInt("PLAYER_RED_ISAI") == 1 ? true : false);
        Utils.Instance.GetPlayerByColor(EPlayer.YELLOW).SetIsAI(PlayerPrefs.GetInt("PLAYER_YELLOW_ISAI") == 1 ? true : false);

        if( PlayerPrefs.GetInt("GAME_ISFIRSTRUN") == 1 ) //si jamais c'est le premier lancement de la scene on met GAME_ISFIRSTRUN a 0
        {
            StartCoroutine(PlaySounds()); //appel de la coroutine qui lance le son de l'intro et apres le son du plateau
            PlayerPrefs.SetInt("GAME_ISFIRSTRUN", 0);
            //on place les joueurs sur la case départ
            Utils.Instance.GetPlayerByColor(EPlayer.BLUE).transform.position = Utils.Instance.GetDepartCase().GetCasePosition(EPlayer.BLUE, false);
            Utils.Instance.GetPlayerByColor(EPlayer.GREEN).transform.position = Utils.Instance.GetDepartCase().GetCasePosition(EPlayer.GREEN, false);
            Utils.Instance.GetPlayerByColor(EPlayer.RED).transform.position = Utils.Instance.GetDepartCase().GetCasePosition(EPlayer.RED, false);
            Utils.Instance.GetPlayerByColor(EPlayer.YELLOW).transform.position = Utils.Instance.GetDepartCase().GetCasePosition(EPlayer.YELLOW, false);
            Utils.Instance.GetPlayerByColor(EPlayer.BLUE).SetCaseID(0);
            Utils.Instance.GetPlayerByColor(EPlayer.GREEN).SetCaseID(0);
            Utils.Instance.GetPlayerByColor(EPlayer.RED).SetCaseID(0);
            Utils.Instance.GetPlayerByColor(EPlayer.YELLOW).SetCaseID(0);
        }
        else if( PlayerPrefs.GetInt("GAME_ISFIRSTRUN") == 0 )//si ce n'est pas le premier lancement de la scene on lance pas la cinématique
        {
            audioSource2.PlayOneShot(music);
            _cinematique.SetCinematiqueFinished(true);
            _cinematique.gameObject.SetActive(false);
            var id = PlayerPrefs.GetInt("PLAYER_BLUE_CASEID");
            Utils.Instance.GetPlayerByColor(EPlayer.BLUE).transform.position = Utils.Instance.GetCaseByID(id).GetCasePosition(EPlayer.BLUE, true);
            Utils.Instance.GetPlayerByColor(EPlayer.BLUE).SetCaseID(id);
            id = PlayerPrefs.GetInt("PLAYER_GREEN_CASEID");
            Utils.Instance.GetPlayerByColor(EPlayer.GREEN).transform.position = Utils.Instance.GetCaseByID(id).GetCasePosition(EPlayer.GREEN, true);
            Utils.Instance.GetPlayerByColor(EPlayer.GREEN).SetCaseID(id);
            id = PlayerPrefs.GetInt("PLAYER_RED_CASEID");
            Utils.Instance.GetPlayerByColor(EPlayer.RED).transform.position = Utils.Instance.GetCaseByID(id).GetCasePosition(EPlayer.RED, true);
            Utils.Instance.GetPlayerByColor(EPlayer.RED).SetCaseID(id);
            id = PlayerPrefs.GetInt("PLAYER_YELLOW_CASEID");
            Utils.Instance.GetPlayerByColor(EPlayer.YELLOW).transform.position = Utils.Instance.GetCaseByID(id).GetCasePosition(EPlayer.YELLOW, true);
            Utils.Instance.GetPlayerByColor(EPlayer.YELLOW).SetCaseID(id);

        }

        _currentPlayer = EPlayer.BLUE;//TODO:choisir par l'ordre aléatoire (lancé de dé)
    }
 private bool HasPlayerOnNextCase( EPlayer player, Vector3 pos )
 {
     switch( player )
     {
     case EPlayer.BLUE:
         return (
                 ComparePos(Utils.Instance.playerGreen.GetComponent<PlayerMovement>().nextStep, pos)
             || ComparePos(Utils.Instance.playerRed.GetComponent<PlayerMovement>().nextStep, pos)
             || ComparePos(Utils.Instance.playerYellow.GetComponent<PlayerMovement>().nextStep, pos)
             );
     case EPlayer.GREEN:
         return (
                ComparePos(Utils.Instance.playerBlue.GetComponent<PlayerMovement>().nextStep, pos)
             || ComparePos(Utils.Instance.playerRed.GetComponent<PlayerMovement>().nextStep, pos)
             || ComparePos(Utils.Instance.playerYellow.GetComponent<PlayerMovement>().nextStep, pos)
             );
     case EPlayer.RED:
         return (
                 ComparePos(Utils.Instance.playerGreen.GetComponent<PlayerMovement>().nextStep, pos)
             || ComparePos(Utils.Instance.playerBlue.GetComponent<PlayerMovement>().nextStep, pos)
             || ComparePos(Utils.Instance.playerYellow.GetComponent<PlayerMovement>().nextStep, pos)
             );
     case EPlayer.YELLOW:
         return (
                ComparePos(Utils.Instance.playerGreen.GetComponent<PlayerMovement>().nextStep, pos)
             || ComparePos(Utils.Instance.playerRed.GetComponent<PlayerMovement>().nextStep, pos)
             || ComparePos(Utils.Instance.playerBlue.GetComponent<PlayerMovement>().nextStep, pos)
             );
     default:
         return false;
     }
 }