Example #1
0
    def is_ladder(self):
        """Checks if a character is a ladder character.

        :return: True if character is ladder otherwise False
        :rtype: bool
        """
        return is_set_bit(self.char_status, 6)
Example #2
0
    def is_died(self):
        """Checks if a character is dead.

        :return: True if character is dead otherwise False
        :rtype: bool
        """
        return is_set_bit(self.char_status, 3)
Example #3
0
    def is_expansion(self):
        """Checks if a character is an expansion character.

        :return: True if character is expansion otherwise False
        :rtype: bool
        """
        return is_set_bit(self.char_status, 5)
Example #4
0
    def is_hardcore(self):
        """Checks if a character is in hardcore mode.

        :return: True if character is in hardcore mode otherwise False
        :rtype: bool
        """
        return is_set_bit(self.char_status, 2)
Example #5
0
def test_is_set_bit(num, bit_pos, expected):
    assert is_set_bit(num, bit_pos) is expected