# Path: mgz/util.py
# class TimeSecAdapter(Adapter):
#     """Conversion to readable time."""
# 
#     def _decode(self, obj, context):
#         """Decode timestamp to string."""
#         return convert_to_timestamp(obj)


from construct import (Array, Byte, Flag, Int16ul, Int32sl, Int32ul, Padding,
                       Peek, Struct, Bytes)
from mgz.util import TimeSecAdapter
    "units_killed"/Int16ul,
    "hit_points_killed"/Int16ul,
    "units_lost"/Int16ul,
    "buildings_razed"/Int16ul,
    "hit_points_razed"/Int16ul,
    "buildings_lost"/Int16ul,
    "units_converted"/Int16ul
)

economy = "economy"/Struct(
    "score"/Int16ul,
    Padding(2),
    "food_collected"/Int32ul,
    "wood_collected"/Int32ul,
    "stone_collected"/Int32ul,
    "gold_collected"/Int32ul,
    "tribute_sent"/Int16ul,
    "tribute_received"/Int16ul,
    "trade_gold"/Int16ul,
    "relic_gold"/Int16ul
)

technology = "technology"/Struct(
    "score"/Int16ul,
    Padding(2),
    Peek("feudal_time_int"/Int32sl),
    TimeSecAdapter("feudal_time"/Int32sl),
    Peek("castle_time_int"/Int32sl),
    TimeSecAdapter("castle_time"/Int32sl),
    Peek("imperial_time_int"/Int32sl),

# Path: mgz/util.py
# class TimeSecAdapter(Adapter):
#     """Conversion to readable time."""
# 
#     def _decode(self, obj, context):
#         """Decode timestamp to string."""
#         return convert_to_timestamp(obj)


# Path: mgz/body/achievements.py
from construct import (Array, Byte, Flag, Int16ul, Int32sl, Int32ul, Padding,
                       Peek, Struct, Bytes)
from mgz.util import TimeSecAdapter

    "units_killed"/Int16ul,
    "hit_points_killed"/Int16ul,
    "units_lost"/Int16ul,
    "buildings_razed"/Int16ul,
    "hit_points_razed"/Int16ul,
    "buildings_lost"/Int16ul,
    "units_converted"/Int16ul
)

economy = "economy"/Struct(
    "score"/Int16ul,
    Padding(2),
    "food_collected"/Int32ul,
    "wood_collected"/Int32ul,
    "stone_collected"/Int32ul,
    "gold_collected"/Int32ul,
    "tribute_sent"/Int16ul,
    "tribute_received"/Int16ul,
    "trade_gold"/Int16ul,
    "relic_gold"/Int16ul
)

technology = "technology"/Struct(
    "score"/Int16ul,
    Padding(2),
    Peek("feudal_time_int"/Int32sl),
    TimeSecAdapter("feudal_time"/Int32sl),
    Peek("castle_time_int"/Int32sl),
    TimeSecAdapter("castle_time"/Int32sl),
    Peek("imperial_time_int"/Int32sl),

    TimeSecAdapter("imperial_time"/Int32sl),