Beispiel #1
0
def read_individual_requirement(source: BinarySource) -> Dict:
    return {
        "requirement_type": source.read_byte(),
        "requirement_index": source.read_byte(),
        "amount": source.read_short(),
        "negate": source.read_bool(),
    }
Beispiel #2
0
def test_read_a():
    b = io.BytesIO(b"\x05aaax\x00?\x80\x00\x00TP\x06@")  # type: BinaryIO
    source = BinarySource(b)

    assert source.read_byte() == 5
    assert source.read_string() == "aaax"
    assert source.read_float() == 1
    source.skip(1)
    assert source.read_bool()
    assert source.read_short() == 1600