hedgewars/uFLTypes.pas
author unc0rr
Tue, 26 Dec 2017 01:36:58 +0100
branchqmlfrontend
changeset 12866 488782d9aba9
parent 12865 e33bcb9d5e9c
permissions -rw-r--r--
Recreate uFLRunQueue in Qt, render previews

unit uFLTypes;
interface
uses SDLh;

const
    MAXARGS = 32;

type
    TMessageType = (mtPreview, mtPreviewHogCount
                    , mtToNet, mtGameFinished);

    TFLIBEvent = (flibGameFinished);

    TClientFlag = (cfReady, cfRegistered, cfInRoom, cfContributor, cfInGame, cfRoomAdmin, cfServerAdmin);

    PIPCMessage = ^TIPCMessage;
    TIPCMessage = record
                   str: shortstring;
                   len: Longword;
                   buf: Pointer;
                   barrier: Longword;
                   next: PIPCMessage;
               end;
    PIPCQueue = ^TIPCQueue;
    TIPCQueue = record
                   msg: TIPCMessage;
                   mut: PSDL_Mutex;
                   cond: PSDL_Cond;
                   last: PIPCMessage;
               end;

    TIPCCallback = procedure (p: pointer; msg: PChar; len: Longword);
    TUICallback = procedure (p: pointer; msgType: TMessageType; msg: PChar; len: Longword); cdecl;

    TGameType = (gtPreview, gtLocal, gtNet);
    THedgehog = record
            name: shortstring;
            hat: shortstring;
            end;
    TTeam = record
            teamName
            , flag
            , grave
            , fort
            , voice
            , owner: shortstring;
            color: Longword;
            extDriven: boolean;
            botLevel: Longword;
            hedgehogs: array[0..7] of THedgehog;
            hogsNumber: Longword;
        end;
    PTeam = ^TTeam;

    TScheme = record
            schemeName
            , scriptparam : shortstring;
            fortsmode
            , divteams
            , solidland
            , border
            , lowgrav
            , laser
            , invulnerability
            , mines
            , vampiric
            , karma
            , artillery
            , randomorder
            , king
            , placehog
            , sharedammo
            , disablegirders
            , disablewind
            , morewind
            , tagteam
            , resethealth
            , disablelandobjects
            , aisurvival
            , infattack
            , resetweps
            , perhogammo
            , bottomborder: boolean;
            damagefactor
            , turntime
            , health
            , suddendeath
            , caseprobability
            , minestime
            , landadds
            , minedudpct
            , explosives
            , minesnum
            , healthprobability
            , healthcaseamount
            , waterrise
            , healthdecrease
            , ropepct
            , getawaytime
            , airmines
            , worldedge: LongInt
        end;
    PScheme = ^TScheme;
    TAmmo = record
            ammoName: shortstring;
            a, b, c, d: shortstring;
        end;
    PAmmo = ^TAmmo;

    PGameConfig = ^TGameConfig;
    TGameConfig = record
            seed: shortstring;
            theme: shortstring;
            script: shortstring;
            map: shortstring;
            drawnData: array[word] of char;
            drawnDataSize: LongWord;
            scheme: TScheme;
            ammo: TAmmo;
            mapgen: LongInt;
            featureSize: LongInt;
            mazesize: LongInt;
            template: LongInt;
            gameType: TGameType;
            teams: array[0..7] of TTeam;
            arguments: array[0..Pred(MAXARGS)] of shortstring;
            argv: array[0..Pred(MAXARGS)] of PChar;
            argumentsNumber: Longword;
            nextConfig: PGameConfig;
            end;

implementation

end.