hedgewars/uUtils.pas
changeset 10562 3388822b3914
parent 10560 9f09196d92a6
child 10572 c4e86a2efc55
equal deleted inserted replaced
10560:9f09196d92a6 10562:3388822b3914
    35 function  EnumToStr(const en : THogEffect) : shortstring; overload;
    35 function  EnumToStr(const en : THogEffect) : shortstring; overload;
    36 function  EnumToStr(const en : TCapGroup) : shortstring; overload;
    36 function  EnumToStr(const en : TCapGroup) : shortstring; overload;
    37 function  EnumToStr(const en : TSprite) : shortstring; overload;
    37 function  EnumToStr(const en : TSprite) : shortstring; overload;
    38 
    38 
    39 function  Min(a, b: LongInt): LongInt; inline;
    39 function  Min(a, b: LongInt): LongInt; inline;
       
    40 function  MinD(a, b: double) : double; inline;
    40 function  Max(a, b: LongInt): LongInt; inline;
    41 function  Max(a, b: LongInt): LongInt; inline;
    41 
    42 
    42 function  IntToStr(n: LongInt): shortstring;
    43 function  IntToStr(n: LongInt): shortstring;
    43 function  StrToInt(s: shortstring): LongInt;
    44 function  StrToInt(s: shortstring): LongInt;
    44 function  FloatToStr(n: hwFloat): shortstring;
    45 function  FloatToStr(n: hwFloat): shortstring;
   190 begin
   191 begin
   191 if a < b then
   192 if a < b then
   192     Min:= a
   193     Min:= a
   193 else
   194 else
   194     Min:= b
   195     Min:= b
       
   196 end;
       
   197 
       
   198 function MinD(a, b: double): double;
       
   199 begin
       
   200 if a < b then
       
   201     MinD:= a
       
   202 else
       
   203     MinD:= b
   195 end;
   204 end;
   196 
   205 
   197 function Max(a, b: LongInt): LongInt;
   206 function Max(a, b: LongInt): LongInt;
   198 begin
   207 begin
   199 if a > b then
   208 if a > b then