bool GestionnaireCollision::collisionMur(const Pacman& pacman, const Case& mur)
{
    // 0 et 4 représente les tile ou l'on peut passer
    if(mur.getType() != 0 && mur.getType() != 4 && mur.getType() != 5)
    {
        return pacman.getSprite().getGlobalBounds().intersects(mur.getRectangle().getGlobalBounds());
    }
    else
    {
        return false;
    }
}
bool GestionnaireCollision::collisionMur(const Fantome& fantome, const Case& mur)
{
    if(fantome.estSorti())
    {
        if(mur.getType() != 0 && mur.getType() != 4 && mur.getType() != 5)
        {
            return fantome.getSprite().getGlobalBounds().intersects(mur.getRectangle().getGlobalBounds());
        }
        else
        {
            return false;
        }
    }
    else
    {
        if(mur.getType() != 0 && mur.getType() != 3 && mur.getType() != 4 && mur.getType() != 5)
        {
            return fantome.getSprite().getGlobalBounds().intersects(mur.getRectangle().getGlobalBounds());
        }
        else
        {
            return false;
        }
    }
}
bool GestionnaireCollision::collisionPacgomme(const Pacman& pacman, const Case& uneCase, char direction)
{
    switch(direction)
    {
        case 'z':
        {
            if(uneCase.getType() == 4 && uneCase.pacGommePresente() &&
               uneCase.getRectangle().getGlobalBounds().contains(pacman.getPosition().x,pacman.getPosition().y + 23))
            {
                return true;
            }
            else if(uneCase.getType() == 5 && uneCase.pacGommePresente() &&
                    uneCase.getRectangle().getGlobalBounds().contains(pacman.getPosition().x, pacman.getPosition().y + 23))
            {
                return true;
            }
            
            return false;
            
            break;
        }
        case 's':
        {
            if(uneCase.getType() == 4 && uneCase.pacGommePresente() &&
               uneCase.getRectangle().getGlobalBounds().contains(pacman.getPosition().x, pacman.getPosition().y + 5))
            {
                return true;
            }
            else if(uneCase.getType() == 5 && uneCase.pacGommePresente() &&
                    uneCase.getRectangle().getGlobalBounds().contains(pacman.getPosition().x, pacman.getPosition().y + 5))
            {
                return true;
            }
            
            return false;
            
                        break;
        }
        case 'q':
        {
            if(uneCase.getType() == 4 && uneCase.pacGommePresente() &&
               uneCase.getRectangle().getGlobalBounds().contains(pacman.getPosition().x + 23, pacman.getPosition().y))
            {
                return true;
            }
            else if(uneCase.getType() == 5 && uneCase.pacGommePresente() &&
                    uneCase.getRectangle().getGlobalBounds().contains(pacman.getPosition().x+23, pacman.getPosition().y))
            {
                return true;
            }
            
            return false;
            
                       break;
        }
        case 'd':
        {
            if(uneCase.getType() == 4 && uneCase.pacGommePresente() &&
               uneCase.getRectangle().getGlobalBounds().contains(pacman.getPosition().x + 5, pacman.getPosition().y))
            {
                return true;
            }
            else if(uneCase.getType() == 5 && uneCase.pacGommePresente() &&
                    uneCase.getRectangle().getGlobalBounds().contains(pacman.getPosition().x +5, pacman.getPosition().y))
            {
                return true;
            }
            
            return false;
            
                        break;
        }
    }
}