GrandLarceny.Rope.updateCollisionWith C# (CSharp) Method

updateCollisionWith() private method

private updateCollisionWith ( Entity a_collid ) : void
a_collid Entity
return void
        internal override void updateCollisionWith(Entity a_collid)
        {
            if (a_collid is Player)
            {
                Player t_player = (Player)a_collid;
                if (t_player.getRope() != this && t_player.getHitBox().collides(m_collisionShape) && !(t_player.getPosition() is PolarCoordinate))
                {
                    if (!(Vector2.Distance(t_player.getPosition().getGlobalCartesian(), m_line.getStartPoint().getGlobalCartesian())
                        < Math.Min(Vector2.Distance(new Vector2(t_player.getPosition().getGlobalCartesian().X + t_player.getHitBox().getOutBox().Width, t_player.getPosition().getGlobalCartesian().Y), m_line.getStartPoint().getGlobalCartesian()),
                        Vector2.Distance(new Vector2(t_player.getPosition().getGlobalCartesian().X + t_player.getHitBox().getOutBox().Width / 2, t_player.getPosition().getGlobalCartesian().Y), m_line.getStartPoint().getGlobalCartesian()))))
                    {
                        if (Vector2.Distance(new Vector2(t_player.getPosition().getGlobalCartesian().X + t_player.getHitBox().getOutBox().Width, t_player.getPosition().getGlobalCartesian().Y), m_line.getStartPoint().getGlobalCartesian())
                            < Vector2.Distance(new Vector2(t_player.getPosition().getGlobalCartesian().X + t_player.getHitBox().getOutBox().Width / 2, t_player.getPosition().getGlobalCartesian().Y), m_line.getStartPoint().getGlobalCartesian()))
                        {
                            t_player.addPositionXAfterDraw(t_player.getHitBox().getOutBox().Width);
                        }
                        else
                        {
                            t_player.addPositionXAfterDraw(t_player.getHitBox().getOutBox().Width / 2);
                        }
                    }
                    t_player.setRope(this);
                    t_player.changePositionToPolar();
                    t_player.getPosition().setParentPositionWithoutMoving(m_line.getStartPoint());
                    t_player.setState(Player.State.Swinging);
                    if (t_player.getPosition().getLength() < 50)
                    {
                        t_player.getPosition().setLength(50);
                    }
                    m_moveToStart = false;
                }
            }
        }