hedgewars/uFLTeams.pas
branchqmlfrontend
changeset 11445 465b4db35232
parent 11444 91f8c6ff5bab
child 11446 321d0ce43568
equal deleted inserted replaced
11444:91f8c6ff5bab 11445:465b4db35232
    71     begin
    71     begin
    72         pfsReadLn(f, l);
    72         pfsReadLn(f, l);
    73 
    73 
    74         if l = '' then
    74         if l = '' then
    75         else if l = '[Team]' then 
    75         else if l = '[Team]' then 
    76             section:= 0
    76             section:= -2
    77         else if l[1] = '[' then
    77         else if copy(l, 1, 9) = '[Hedgehog' then
    78             section:= -1
    78             section:= StrToInt(copy(l, 10, 1))
    79         else if section = 0 then
    79         else if section = -2 then
    80         begin // [Team]
    80         begin // [Team]
    81             if copy(l, 1, 5) = 'Name=' then
    81             if copy(l, 1, 5) = 'Name=' then
    82                 team.teamName:= midStr(l, 6)
    82                 team.teamName:= midStr(l, 6)
    83             else if copy(l, 1, 6) = 'Grave=' then
    83             else if copy(l, 1, 6) = 'Grave=' then
    84                 team.grave:= midStr(l, 7)
    84                 team.grave:= midStr(l, 7)
    85             else if copy(l, 1, 5) = 'Fort=' then
    85             else if copy(l, 1, 5) = 'Fort=' then
    86                 team.fort:= midStr(l, 6)
    86                 team.fort:= midStr(l, 6)
    87             else if copy(l, 1, 5) = 'Flag=' then
    87             else if copy(l, 1, 5) = 'Flag=' then
    88                 team.flag:= midStr(l, 6)
    88                 team.flag:= midStr(l, 6)
       
    89             else if copy(l, 1, 10) = 'Voicepack=' then
       
    90                 team.voice:= midStr(l, 11)
       
    91             else if copy(l, 1, 11) = 'Difficulty=' then
       
    92                 team.botLevel:= StrToInt(midStr(l, 12))
       
    93         end else if (section >= 0) and (section <= 7) then
       
    94         begin // [Hedgehog*]
       
    95             if copy(l, 1, 5) = 'Name=' then
       
    96                 team.hedgehogs[section].name:= midStr(l, 6)
       
    97             else if copy(l, 1, 4) = 'Hat=' then
       
    98                 team.hedgehogs[section].hat:= midStr(l, 5)
    89         end;
    99         end;
    90         // TODO: load hedgehogs and other stuff
       
    91         team.botLevel:= 0
       
    92     end;
   100     end;
    93 
   101 
    94     pfsClose(f)
   102     pfsClose(f)
    95 end;
   103 end;
    96 
   104