import ctypes
from ctypes import c_int32, c_float, c_wchar, c_bool
from . import constants


class SPageFileGraphic(ctypes.Structure):
    _pack_ = 4
    _fields_ = [
        ('packetId', c_int32),
        ('status', constants.ACC_STATUS),
        ('session', constants.ACC_SESSION_TYPE),
        ('currentTime', c_wchar * 15),
        ('lastTime', c_wchar * 15),
        ('bestTime', c_wchar * 15),
        ('split', c_wchar * 15),
        ('completedLaps', c_int32),
        ('position', c_int32),
        ('iCurrentTime', c_int32),
        ('iLastTime', c_int32),
        ('iBestTime', c_int32),
        ('sessionTimeLeft', c_float),
        ('distanceTraveled', c_float),
        ('isInPit', c_int32),
        ('currentSectorIndex', c_int32),
        ('lastSectorTime', c_int32),
        ('numberOfLaps', c_int32),
        ('tyreCompound', c_wchar * 33),

        ('replayTimeMultiplier', c_float),
        ('normalizedCarPosition', c_float),
        ('activeCars', c_int32),
        ('carCoordinates', c_float * 60 * 3),
        ('carID', c_float * 60),
        ('playerCarID', c_int32),
        ('penaltyTime', c_float),
        ('flag', constants.ACC_FLAG_TYPE),
        ('penalty', constants.ACC_PENALTY_TYPE),
        ('idealLineOn', c_int32),
        ('isInPitLane', c_int32),
        ('surfaceGrip', c_float),
        ('mandatoryPitDone', c_int32),
        ('windSpeed', c_float),
        ('windDirection', c_float),
        ('isSetupMenuVisible', c_int32),
        ('mainDisplayIndex', c_int32),
        ('secondaryDisplayIndex', c_int32),
        ('TC', c_int32),
        ('TCCUT', c_int32),
        ('EngineMap', c_int32),
        ('ABS', c_int32),
        ('fuelXLap', c_float),
        ('rainLights', c_int32),
        ('flashingLights', c_int32),
        ('lightsStage', c_int32),
        ('exhaustTemperature', c_float),
        ('wiperLV', c_int32),
        ('driverStintTotalTimeLeft', c_int32),
        ('driverStintTimeLeft', c_int32),
        ('rainTyres', c_int32),
        ('sessionIndex', c_int32),
        ('usedFuel', c_float),
        ('deltaLapTime', c_wchar * 15),
        ('iDeltaLapTime', c_int32),
        ('estimatedLapTime', c_wchar * 15),
        ('iEstimatedLapTime', c_int32),
        ('isDeltaPositive', c_int32),
        ('iSplit', c_int32),
        ('isValidLap', c_int32),
        ('fuelEstimatedLaps', c_float),
        ('trackStatus', c_wchar * 33),
        ('missingMandatoryPits', c_int32),
        ('clock', c_float),
        ('directionLightsLeft', c_int32),
        ('directionLightsRight', c_int32)
    ]
