hedgewars/uTeams.pas
changeset 4 bcbd7adb4e4b
parent 1 30f2d1037d5d
child 5 0dafbd19a04c
equal deleted inserted replaced
3:ffe4ad26a64c 4:bcbd7adb4e4b
    72 function AddTeam: PTeam;
    72 function AddTeam: PTeam;
    73 procedure ApplyAmmoChanges(Hedgehog: PHedgehog);
    73 procedure ApplyAmmoChanges(Hedgehog: PHedgehog);
    74 procedure SwitchHedgehog;
    74 procedure SwitchHedgehog;
    75 procedure InitTeams;
    75 procedure InitTeams;
    76 procedure OnUsedAmmo(Ammo: PHHAmmo);
    76 procedure OnUsedAmmo(Ammo: PHHAmmo);
       
    77 function  TeamSize(p: PTeam): Longword;
    77 
    78 
    78 implementation
    79 implementation
    79 uses uMisc, uStore, uWorld, uIO, uAIActions;
    80 uses uMisc, uStore, uWorld, uIO, uAIActions;
    80 
    81 
    81 procedure FreeTeamsList; forward;
    82 procedure FreeTeamsList; forward;
   257              if Count = 0 then PackAmmo(Ammo, CurSlot)
   258              if Count = 0 then PackAmmo(Ammo, CurSlot)
   258              end
   259              end
   259      end
   260      end
   260 end;
   261 end;
   261 
   262 
       
   263 function  TeamSize(p: PTeam): Longword;
       
   264 var i: Longword;
       
   265 begin
       
   266 Result:= 0;
       
   267 for i:= 0 to cMaxHHIndex do
       
   268     if p.Hedgehogs[i].Gear <> nil then inc(Result)
       
   269 end;
       
   270 
   262 initialization
   271 initialization
   263 
   272 
   264 finalization
   273 finalization
   265 
   274 
   266 FreeTeamsList
   275 FreeTeamsList