unit uTypeDefs;

interface

uses
  uDefines, uHCDefines, uHCTypeDefs;

type
  time_t = type LongInt;

type
  group_id = array[0..3] of AnsiChar;
  Pgroup_id = ^group_id;

type
  DATABASE_FILE_VERSION = packed record
    flavor: array [0..DATABASE_FLAVOR_LEN-1] of AnsiChar;
    created: time_t;
end;

type
  DATABASE_VERSION = packed record
    RESFile: DATABASE_FILE_VERSION;
    RSRFile: DATABASE_FILE_VERSION;
end;

type
  SOSUSRegion = packed record
    SpecialRegion: Pointer;
    sLatTop: Longint;
    sLatBot: Longint;
    sLonLeft: Longint;
    sLonRight: Longint;
    time: Longint;
    side: Byte;
    prob: Byte;
    result: Byte;
    Dummy: Byte;
end;

type
  ScenarioGroup = packed record
    initLat: Longint;
    initLon: Longint;
    side: byte;
    zones: packed array[0..3] of byte;
    percent_chance: byte;
end;

type
  ScenarioPath = packed record
   DestLon: Longint;
   DestLat: Longint;
   num_events: Smallint;
end;
  PScenarioPath = ^ScenarioPath;

type
  ScenarioPathList = packed array of ScenarioPath;

                      {
type
  Group = packed record
    initLat: Longint;
    initLon: Longint;
    side: byte;
    zones: packed array[0..3] of byte;
    percent_chance: byte;
    id: group_id;
end;
  PGroup = ^Group;
          }
type
  GroupList = packed array of THCGroup;

// aka ScenarioUnit (Old)
type
  ScenarioUnit_v00 = packed record
    xOff: Longint;
    yOff: Longint;
    disk_id: Word;
    parent_id: packed array[0..3] of AnsiChar;
    parent_base: Byte;
    Dummy: Byte;
    name_offset: Longint;
    name_length: Smallint;
    PlatStart: Byte;
    in_air: Byte;
    mission: Shortint;
    rings: Byte;
    sectors: Byte;
    percent_chance: Byte;
end;

// aka NewScenarioUnit
type
  ScenarioUnit_v01 = packed record
    xOff: Longint;
    yOff: Longint;
    disk_id: Word;
    parent_id: packed array[0..3] of AnsiChar;
    parent_base: Byte;
    Dummy: Byte;
    name_offset: Longint;
    name_length: Smallint;
    PlatStart: Byte;
    in_air: Byte;
    mission: Shortint;
    rings: Byte;
    sectors: Byte;
    percent_chance: Byte;
    // additions in v01
    UnitName: packed array[0..CLASS_NAME_LEN-1] of AnsiChar;
end;

type
  Rect = packed record
    left: Smallint;
    top: Smallint;
    right: Smallint;
    bottom: Smallint;
end;

type
  VictoryCondition = packed record
    next: Pointer;
    TimeOnStation: Longint;
    DetailType: Word;
    AreaOnStation: Rect;
    id: Byte;
    VicType: Byte;
    AndOrFlag: Byte;
    WhichSide: Byte;
    unitType: Byte;
    itemType: Byte;
    percentDamage: Byte;
    numKilled: Byte;
    numDamaged: Byte;
    Dummy: Shortint;
end;

type
  ScenarioHarpoonEvent = packed record
    grp_id: group_id;
    unit_id: Byte;
    Dummy: Byte;
    Time: Longint;
    flag: Byte;
    Dummy2: Byte;
    data_size: Smallint;
    {
      type flags are:
      0=Attack
      1=Set Altitude & Speed
      2=Ready Aircraft
      3=Launch Aircraft
      4=Split Group
      5=Join Group
      6=Sensor Settings
      7=Formation Editor
      8=Repair Unit
      9=Manual Reload
     10=Sinking Ship
     11=Random Breakdowns
     12=Special Forces Base Attacks
     13=Visual Detection Intelligence (satellite)
     14=Staff Reminder/Special Msg
     15=Nuclear Free w/msg
     16=False Contact
     17=Weather
     18=Snorkel event
     19=Air landing event
     20=Alt path
     21=Enemy AI event
     22=Random Damage
     23=Intermittent Sensors
     24=Air Attack
     25=Unbend Tails (Towed Array)
     26=Sink Sonobuoy
     27=Air Patrol
     28=Intercept
     29=Repeat Air Event
     30=Attack Order
     31=Launch/Land Air
     32=Variable Start Point Event
     33=Missile Avoidance
     34=Alter Course
     35..61 unused
     62=Air refuel
     63=unused but a reminder that this is the max event type value
     Time flags are:
     0=ignore time do now!
     1=time is delta time from entry in queue
     2=time is absolute game time
    }
  end;
  PScenarioHarpoonEvent = ^ScenarioHarpoonEvent;


implementation

end.
