Changeset 120 for trunk/Protocol.pas
- Timestamp:
- Feb 3, 2018, 5:03:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Protocol.pas
r117 r120 1283 1283 end; 1284 1284 1285 { TCity } 1286 1285 1287 TCity = packed record 1286 1288 Loc, { location } … … 1632 1634 { preLeo,preLighthouse, } preLeo); 1633 1635 1636 var 1637 DelphiRandSeed: Integer; 1638 1634 1639 procedure MakeUnitInfo(p: integer; const u: TUn; var ui: TUnitInfo); 1635 1640 procedure MakeModelInfo(p, mix: integer; const m: TModel; var mi: TModelInfo); 1636 1641 function IsSameModel(const mi1, mi2: TModelInfo): boolean; 1637 1642 function SpecialTile(Loc, TerrType, lx: integer): integer; 1643 function DelphiRandom(const pi_Max: Integer): Integer; overload; 1644 function DelphiRandom: Extended; overload; 1645 procedure DelphiRandomize; 1638 1646 1639 1647 implementation … … 1757 1765 end; 1758 1766 1767 function DelphiRandom(const pi_Max: Integer): Integer; 1768 var 1769 Temp: LongInt; 1770 begin 1771 Temp := LongInt(134775813 * DelphiRandSeed + 1); 1772 DelphiRandSeed := Temp; 1773 Result := (UInt64(Cardinal(pi_Max)) * UInt64(Cardinal(Temp))) shr 32; 1774 end; 1775 1776 function DelphiRandom: Extended; overload; 1777 begin 1778 Result := DelphiRandom(High(LongInt)) / High(LongInt); 1779 end; 1780 1781 procedure DelphiRandomize; 1782 begin 1783 Randomize; 1784 DelphiRandSeed := RandSeed; 1785 end; 1786 1759 1787 initialization 1760 1788
Note:
See TracChangeset
for help on using the changeset viewer.