Changeset 148


Ignore:
Timestamp:
May 13, 2018, 10:11:03 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Protocol unit cleanup for better readability.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Integrated.lpr

    r117 r148  
    4242  ScreenTools, Directories;
    4343
    44 {$R cevo.res}
    45 
    4644{$if declared(UseHeapTrace)}
    4745const
  • trunk/Protocol.pas

    r129 r148  
    4444  MaxMoneyPrice = $FFFF;
    4545  MaxShipPartPrice = 100;
    46   BombardmentDestroysCity = false;
     46  BombardmentDestroysCity = False;
    4747  StartMoney = 0;
    4848  InitialCredibility = 95;
     
    5353  // difficulty settings
    5454  MaxDiff = 4; { maximum difficulty level }
    55   StorageSize: array [1 .. MaxDiff] of integer = (30, 40, 50, 60);
    56   TechFormula_M: array [1 .. MaxDiff] of single = (2.0, 2.3, 2.6, 4.0);
    57   TechFormula_D: array [1 .. MaxDiff] of single = (102.0, 80.0, 64.0, 64.0);
    58   BuildCostMod: array [1 .. MaxDiff] of integer = (9, 12, 15, 18); // in 1/12
     55  StorageSize: array [1 .. MaxDiff] of Integer = (30, 40, 50, 60);
     56  TechFormula_M: array [1 .. MaxDiff] of Single = (2.0, 2.3, 2.6, 4.0);
     57  TechFormula_D: array [1 .. MaxDiff] of Single = (102.0, 80.0, 64.0, 64.0);
     58  BuildCostMod: array [1 .. MaxDiff] of Integer = (9, 12, 15, 18); // in 1/12
    5959
    6060  // test flags
     
    795795  imShipHab = 69;
    796796
    797   SettlerFood: array [0 .. nGov - 1] of integer = (1, 1, 1, 2, 1, 2, 2, 2);
    798   CorrLevel: array [0 .. nGov - 1] of integer = (3, 3, 1, 2, 1, 0, 0, 0);
    799   SupportFree: array [0 .. nGov - 1] of integer = (2, 2, 1, 0, 2, 1, 0, 0);
     797  SettlerFood: array [0 .. nGov - 1] of Integer = (1, 1, 1, 2, 1, 2, 2, 2);
     798  CorrLevel: array [0 .. nGov - 1] of Integer = (3, 3, 1, 2, 1, 0, 0, 0);
     799  SupportFree: array [0 .. nGov - 1] of Integer = (2, 2, 1, 0, 2, 1, 0, 0);
    800800  // in 1/2*city size
    801801
     
    808808  preNA = -$FF;
    809809
    810   JobPreq: array [0 .. nJob - 1] of integer = (preNone, preNone, adRailroad,
     810  JobPreq: array [0 .. nJob - 1] of Integer = (preNone, preNone, adRailroad,
    811811    preNone, preNone, adRefrigeration, preNone, preNone, adExplosives,
    812812    adExplosives, adConstruction, preNone, adMedicine, preNone, preNone);
    813813
    814   AdvPreq: array [0 .. nAdv - 1, 0 .. 2] of integer = { advance prerequisites }
     814  AdvPreq: array [0 .. nAdv - 1, 0 .. 2] of Integer = { advance prerequisites }
    815815    ((adFlight, adRobotics, preNone), // adAdvancedFlight
    816816    (adNavigation, adTactics, preNone), // adAmphibiousWarfare
     
    10231023spPow = 1;
    10241024spHab = 2;
    1025 ShipNeed: array [0 .. nShipPart - 1] of integer = (6, 4, 2);
    1026 ShipImpIndex: array [0 .. nShipPart - 1] of integer = (imShipComp, imShipPow, imShipHab);
    1027 
    1028 GovPreq: array [1 .. nGov - 1] of integer = { government prerequisites }
     1025ShipNeed: array [0 .. nShipPart - 1] of Integer = (6, 4, 2);
     1026ShipImpIndex: array [0 .. nShipPart - 1] of Integer = (imShipComp, imShipPow, imShipHab);
     1027
     1028GovPreq: array [1 .. nGov - 1] of Integer = { government prerequisites }
    10291029  (preNone, adMonarchy, adTheRepublic, adTheology, adCommunism, adDemocracy,
    10301030  adInternet);
    10311031
    1032 AgePreq: array [1 .. 3] of integer = (adScience, adMassProduction,
     1032AgePreq: array [1 .. 3] of Integer = (adScience, adMassProduction,
    10331033  adTransstellarColonization);
    10341034
     
    10441044  TransTerrain: Integer;
    10451045  TransWork: Integer;
    1046   FoodRes, ProdRes, TradeRes: array [0 .. 2] of Integer;
     1046  FoodRes: array [0 .. 2] of Integer;
     1047  ProdRes: array [0 .. 2] of Integer;
     1048  TradeRes: array [0 .. 2] of Integer;
    10471049  Filler: array [0 .. 12] of Integer;
    10481050end
     
    12011203
    12021204Feature: array [0 .. nFeature - 1] of { unit model features }
    1203   record Domains, Preq, Weight, Cost: integer;
    1204 end
     1205  record
     1206    Domains: Integer;
     1207    Preq: Integer;
     1208    Weight: Integer;
     1209    Cost: Integer;
     1210  end
    12051211= ((Domains: 7; Preq: preNone; Weight: 1; Cost: 1), { mcOffense }
    12061212  (Domains: 7; Preq: preNone; Weight: 1; Cost: 1), { mcDefense }
     
    12311237  (Domains: 7; Preq: adMassProduction; Weight: 0; Cost: 0)); { mcLine }
    12321238
    1233 WeightPreq7: array [0 .. nDomains - 1] of integer = (adHorsebackRiding, adSeafaring,
     1239WeightPreq7: array [0 .. nDomains - 1] of Integer = (adHorsebackRiding, adSeafaring,
    12341240  adAdvancedFlight);
    1235 WeightPreq10: array [0 .. nDomains - 1] of integer = (adAutomobile, adSteel, preNA);
     1241WeightPreq10: array [0 .. nDomains - 1] of Integer = (adAutomobile, adSteel, preNA);
    12361242
    12371243INFIN = 999999;
     
    12611267
    12621268type
    1263   TServerCall = function(Command, Player, Subject: integer; var Data)
    1264     : integer; stdcall;
    1265   TClientCall = procedure(Command, Player: integer; var Data); stdcall;
     1269  TServerCall = function (Command, Player, Subject: Integer; var Data)
     1270    : Integer; stdcall;
     1271  TClientCall = procedure (Command, Player: Integer; var Data); stdcall;
    12661272
    12671273  TUn = packed record
    1268     Loc, { location }
    1269     Status, // free for AI use
     1274    Loc: LongInt; { location }
     1275    Status: LongInt; // free for AI use
    12701276    SavedStatus: LongInt; // for server internal use only
    1271     ID: word; // unit number, never changes, unique within this nation
    1272     mix, { model index }
    1273     Home, { home city index, -1 if none }
    1274     Master, { index of transporting unit, -1 if none }
     1277    ID: Word; // unit number, never changes, unique within this nation
     1278    mix: SmallInt; { model index }
     1279    Home: SmallInt; { home city index, -1 if none }
     1280    Master: SmallInt; { index of transporting unit, -1 if none }
    12751281    Movement: SmallInt; { movement left for this turn }
    1276     Health, // = 100-Damage
     1282    Health: ShortInt; // = 100-Damage
    12771283    Fuel: ShortInt;
    1278     Job, { current terrain improvement job }
    1279     Exp, { micro experience, the level is Exp div ExpCost }
    1280     TroopLoad, { number of transported ground units }
     1284    Job: Byte; { current terrain improvement job }
     1285    Exp: Byte; { micro experience, the level is Exp div ExpCost }
     1286    TroopLoad: Byte; { number of transported ground units }
    12811287    AirLoad: Byte; // number of transported air units
    12821288    Flags: Cardinal;
     
    12861292
    12871293  TCity = packed record
    1288     Loc, { location }
    1289     Status, // free for AI use
     1294    Loc: LongInt; { location }
     1295    Status: LongInt; // free for AI use
    12901296    SavedStatus: LongInt; // for server internal use only
    1291     ID, // founding player shl 12 + number, never changes, unique within the whole game
    1292     Size: word;
    1293     Project, // current production project, see city project flags
    1294     Project0, // for server use only
    1295     Food, // collected food in storage
    1296     Pollution, // collected pollution in dump
    1297     Prod, // for project collected production points
     1297    ID: Word; // founding player shl 12 + number, never changes, unique within the whole game
     1298    Size: Word;
     1299    Project: SmallInt; // current production project, see city project flags
     1300    Project0: SmallInt; // for server use only
     1301    Food: SmallInt; // collected food in storage
     1302    Pollution: SmallInt; // collected pollution in dump
     1303    Prod: SmallInt; // for project collected production points
    12981304    Prod0: SmallInt;
    12991305    // for project collected production points in the beginning of the turn
    1300     Flags, // what happened within the last turnaround
    1301     Tiles, { currently by city exploited tiles, bitset with index
     1306    Flags: Cardinal; // what happened within the last turnaround
     1307    Tiles: Cardinal; { currently by city exploited tiles, bitset with index
    13021308      (dy+3) shl 2+(dx+3) shr 1, (dx,dy) relative to central tile }
    13031309    N1: Cardinal; // reserved for future use
     
    13071313
    13081314  TModel = packed record
    1309     Status, // free for AI use
     1315    Status: LongInt; // free for AI use
    13101316    SavedStatus: LongInt; // for server internal use only
    1311     ID, // developing player shl 12 + number, never changes, unique within the whole game
    1312     IntroTurn, Built, // units built with this model
    1313     Lost: word; // units of this model lost in combat
    1314     Kind, Domain: Byte;
    1315     Attack, Defense, Speed, Cost, MStrength: word;
     1317    ID: Word; // developing player shl 12 + number, never changes, unique within the whole game
     1318    IntroTurn: Word;
     1319    Built: Word; // units built with this model
     1320    Lost: Word; // units of this model lost in combat
     1321    Kind: Byte;
     1322    Domain: Byte;
     1323    Attack: Word;
     1324    Defense: Word;
     1325    Speed: Word;
     1326    Cost: Word;
     1327    MStrength: Word;
    13161328    // construction time multipliers, only valid if kind is mkSelfDeveloped or mkEnemyDeveloped
    1317     MTrans, MCost, Weight, MaxWeight: Byte;
     1329    MTrans: Byte;
     1330    MCost: Byte;
     1331    Weight: Byte;
     1332    MaxWeight: Byte;
    13181333    // weight and maximum weight (construction time)
    1319     Upgrades, // bitarray indicating all upgrades
     1334    Upgrades: Cardinal; // bitarray indicating all upgrades
    13201335    Flags: Cardinal;
    13211336    Cap: array [0 .. (nFeature + 3) div 4 * 4 - 1] of Byte; // special features
     
    13241339  TUnitInfo = packed record
    13251340    Loc: LongInt;
    1326     mix, // index of unit model for its owner
    1327     emix: word; // index in enemy model list
     1341    mix: Word; // index of unit model for its owner
     1342    emix: Word; // index in enemy model list
    13281343    Owner: Byte;
    1329     Health, // = 100-Damage
     1344    Health: ShortInt; // = 100-Damage
    13301345    Fuel: ShortInt;
    1331     Job, // current terrain improvement job
    1332     Exp, { micro experience, the level is Exp div ExpCost }
     1346    Job: Byte; // current terrain improvement job
     1347    Exp: Byte; { micro experience, the level is Exp div ExpCost }
    13331348    Load: Byte; { number of transported units }
    1334     Flags: word;
     1349    Flags: Word;
    13351350  end;
    13361351
    13371352  TCityInfo = packed record
    1338     Loc, Status, // free for AI use
     1353    Loc: LongInt;
     1354    Status: LongInt; // free for AI use
    13391355    SavedStatus: LongInt; // for server internal use only
    1340     Owner, // last known owner, even if not alive anymore!
    1341     ID, // founding player <<12 + number, never changes, unique within the whole game
    1342     Size, Flags: word;
     1356    Owner: Word; // last known owner, even if not alive anymore!
     1357    ID: Word; // founding player <<12 + number, never changes, unique within the whole game
     1358    Size: Word;
     1359    Flags: Word;
    13431360  end;
    13441361
    13451362  TModelInfo = packed record
    1346     Owner, // Player which owns the model
    1347     mix, // index of unit model for its owner
    1348     ID: word; // developing player shl 12 + number, never changes, unique within the whole game
    1349     Kind, Domain: Byte;
    1350     Attack, Defense, Speed, Cost: word;
    1351     TTrans, // ground unit transport capability
     1363    Owner: Word; // Player which owns the model
     1364    mix: Word; // index of unit model for its owner
     1365    ID: Word; // developing player shl 12 + number, never changes, unique within the whole game
     1366    Kind: Byte;
     1367    Domain: Byte;
     1368    Attack: Word;
     1369    Defense: Word;
     1370    Speed: Word;
     1371    Cost: Word;
     1372    TTrans: Byte; // ground unit transport capability
    13521373    ATrans_Fuel: Byte; // air unit transport capability resp. fuel
    1353     Bombs: word; // additional attack with bombs
     1374    Bombs: Word; // additional attack with bombs
    13541375    Cap: Cardinal; // special features, bitset with index Feature-mcFirstNonCap
    1355     MaxUpgrade, // maximum used upgrade
     1376    MaxUpgrade: Byte; // maximum used upgrade
    13561377    Weight: Byte;
    1357     Lost: word;
     1378    Lost: Word;
    13581379  end;
    13591380
    13601381  TBattle = packed record
    1361     Enemy, Flags: Byte;
    1362     Turn, mix, mixEnemy: word;
    1363     ToLoc, FromLoc: integer;
     1382    Enemy: Byte;
     1383    Flags: Byte;
     1384    Turn: Word;
     1385    mix: Word;
     1386    mixEnemy: Word;
     1387    ToLoc: Integer;
     1388    FromLoc: Integer;
    13641389  end;
    13651390
    13661391  TWonderInfo = record
    1367     CityID, // -2 if destroyed, -1 if never completed, >=0 ID of city
    1368     EffectiveOwner: integer
     1392    CityID: Integer; // -2 if destroyed, -1 if never completed, >=0 ID of city
     1393    EffectiveOwner: Integer;
    13691394    // owning player if effective, -1 if expired or not built
    1370     end;
    1371 
    1372     TShipInfo = record Parts: array [0 .. nShipPart - 1] of integer;
     1395  end;
     1396
     1397  TShipInfo = record
     1398    Parts: array [0 .. nShipPart - 1] of Integer;
    13731399  end;
    13741400
    13751401  TEnemyReport = record
    1376     TurnOfContact, TurnOfCivilReport, TurnOfMilReport, Attitude,
    1377       Credibility: integer; // 0..100, last update: ToC
    1378     Treaty: array [0 .. nPl - 1] of integer;
     1402    TurnOfContact: Integer;
     1403    TurnOfCivilReport: Integer;
     1404    TurnOfMilReport: Integer;
     1405    Attitude: Integer;
     1406    Credibility: Integer; // 0..100, last update: ToC
     1407    Treaty: array [0 .. nPl - 1] of Integer;
    13791408    // diplomatic status with other nations, last update: ToCR
    1380     Government, // gAnarchy..gDemocracy, last update: ToCR
    1381     Money, // last update: ToCR
    1382     ResearchTech, ResearchDone: integer; // last update: ToCR
     1409    Government: Integer; // gAnarchy..gDemocracy, last update: ToCR
     1410    Money: Integer; // last update: ToCR
     1411    ResearchTech: Integer; // last update: ToCR
     1412    ResearchDone: Integer; // last update: ToCR
    13831413    Tech: array [0 .. (nAdv + 3) div 4 * 4 - 1] of ShortInt;
    13841414    // tech status indicator, last update: ToCR
    1385     nModelCounted: integer;
     1415    nModelCounted: Integer;
    13861416    // number of models with info in UnCount, last update: ToMR
    1387     UnCount: array [0 .. INFIN] of word;
     1417    UnCount: array [0 .. INFIN] of Word;
    13881418    // number of available units for each model, last update: ToMR
    13891419  end;
    13901420
    13911421  TMoveAdviceData = record
    1392     ToLoc, nStep, MoreTurns, MaxHostile_MovementLeft: integer;
    1393     dx, dy: array [0 .. 24] of integer;
     1422    ToLoc: Integer;
     1423    nStep: Integer;
     1424    MoreTurns: Integer;
     1425    MaxHostile_MovementLeft: Integer;
     1426    dx: array [0 .. 24] of Integer;
     1427    dy: array [0 .. 24] of Integer;
    13941428  end;
    13951429
    13961430  TPlaneReturnData = record
    1397     Loc, Fuel, Movement: integer;
     1431    Loc: Integer;
     1432    Fuel: Integer;
     1433    Movement: Integer;
    13981434  end;
    13991435
    14001436  TTileInfo = record
    1401     Food, Prod, Trade, ExplCity: integer;
     1437    Food: Integer;
     1438    Prod: Integer;
     1439    Trade: Integer;
     1440    ExplCity: Integer;
    14021441  end;
    14031442
    14041443  TCityReport = record
    1405     HypoTiles, HypoTax, HypoLux, Working, Happy, FoodRep,
    1406       ProdRep, Trade, PollRep, Corruption, Tax, Lux, Science, Support, Eaten,
    1407       ProdCost, Storage, Deployed: integer;
     1444    HypoTiles: Integer;
     1445    HypoTax: Integer;
     1446    HypoLux: Integer;
     1447    Working: Integer;
     1448    Happy: Integer;
     1449    FoodRep: Integer;
     1450    ProdRep: Integer;
     1451    Trade: Integer;
     1452    PollRep: Integer;
     1453    Corruption: Integer;
     1454    Tax: Integer;
     1455    Lux: Integer;
     1456    Science: Integer;
     1457    Support: Integer;
     1458    Eaten: Integer;
     1459    ProdCost: Integer;
     1460    Storage: Integer;
     1461    Deployed: Integer;
    14081462  end;
    14091463
    14101464  TCityReportNew = record
    1411     HypoTiles,
     1465    HypoTiles: Integer;
    14121466    // tiles that should be considered as exploited (for the current adjustment, set this to -1 or to TCity.Tiles of the city)
    1413     HypoTaxRate, HypoLuxuryRate,
     1467    HypoTaxRate: Integer;
     1468    HypoLuxuryRate: Integer;
    14141469    // tax and luxury rate that should be assumed (for current rates, set this to -1 or to RO.TaxRate resp. RO.LuxRate)
    1415     Morale, FoodSupport, MaterialSupport,
     1470    Morale: Integer;
     1471    FoodSupport: Integer;
     1472    MaterialSupport: Integer;
    14161473    // food and material taken for unit support
    1417     ProjectCost, // material cost of current project
    1418     Storage, // size of food storage
    1419     Deployed, // number of units causing unrest (unrest=2*deployed)
    1420     CollectedControl, CollectedFood, CollectedMaterial, CollectedTrade,
     1474    ProjectCost: Integer; // material cost of current project
     1475    Storage: Integer; // size of food storage
     1476    Deployed: Integer; // number of units causing unrest (unrest=2*deployed)
     1477    CollectedControl: Integer;
     1478    CollectedFood: Integer;
     1479    CollectedMaterial: Integer;
     1480    CollectedTrade: Integer;
    14211481    // raw control, food, material and trade as collected by the citizens
    1422     Working, // number of exploited tiles including city tile
    1423     FoodSurplus, Production, AddPollution,
     1482    Working: Integer; // number of exploited tiles including city tile
     1483    FoodSurplus: Integer;
     1484    Production: Integer;
     1485    AddPollution: Integer;
    14241486    // food surplus, production gain and pollution after all effects
    1425     Corruption, Tax, Science, Luxury,
     1487    Corruption: Integer;
     1488    Tax: Integer;
     1489    Science: Integer;
     1490    Luxury: Integer;
    14261491    // corruption, tax, science and wealth after all effects
    1427     HappinessBalance: integer;
     1492    HappinessBalance: Integer;
    14281493    // = (Morale+Wealth+Control) - (Size+Unrest), value < 0 means disorder
    14291494  end;
    14301495
    14311496  TCityTileAdviceData = record
    1432     ResourceWeights, Tiles: Cardinal;
     1497    ResourceWeights: Cardinal;
     1498    Tiles: Cardinal;
    14331499    CityReport: TCityReport;
    14341500  end;
    14351501
    14361502  TGetCityData = record
    1437     Owner: integer;
     1503    Owner: Integer;
    14381504    c: TCity;
    14391505  end;
    14401506
    14411507  TCityAreaInfo = record
    1442     Available: array [0 .. 26] of integer;
     1508    Available: array [0 .. 26] of Integer;
    14431509  end;
    14441510
    14451511  TUnitReport = record
    1446     FoodSupport, ProdSupport, ReportFlags: integer;
     1512    FoodSupport: Integer;
     1513    ProdSupport: Integer;
     1514    ReportFlags: Integer;
    14471515  end;
    14481516
    14491517  TJobProgressData = array [0 .. nJob - 1] of record
    14501518    Required, Done,
    1451     NextTurnPlus: integer;
    1452   end;
     1519    NextTurnPlus: Integer;
     1520  end;
     1521
    14531522  TBattleForecast = record
    1454     pAtt, mixAtt, HealthAtt, ExpAtt, FlagsAtt, Movement,
    1455     EndHealthDef, EndHealthAtt: integer;
    1456   end;
     1523    pAtt: Integer;
     1524    mixAtt: Integer;
     1525    HealthAtt: Integer;
     1526    ExpAtt: Integer;
     1527    FlagsAtt: Integer;
     1528    Movement: Integer;
     1529    EndHealthDef: Integer;
     1530    EndHealthAtt: Integer;
     1531  end;
     1532
    14571533  TBattleForecastEx = record
    1458     pAtt, mixAtt, HealthAtt, ExpAtt, FlagsAtt, Movement,
    1459     EndHealthDef, EndHealthAtt: integer; // must be same as in TBattleForecast
    1460     AStr, DStr, ABaseDamage, DBaseDamage: integer;
    1461   end;
     1534    pAtt: Integer;
     1535    mixAtt: Integer;
     1536    HealthAtt: Integer;
     1537    ExpAtt: Integer;
     1538    FlagsAtt: Integer;
     1539    Movement: Integer;
     1540    EndHealthDef: Integer;
     1541    EndHealthAtt: Integer; // must be same as in TBattleForecast
     1542    AStr: Integer;
     1543    DStr: Integer;
     1544    ABaseDamage: Integer;
     1545    DBaseDamage: Integer;
     1546  end;
     1547
    14621548  TShowMove = record
    1463     Owner, Health, mix, emix, Flags, FromLoc, dx, dy, EndHealth,
    1464     EndHealthDef, Fuel, Exp, Load: integer;
    1465   end;
     1549    Owner: Integer;
     1550    Health: Integer;
     1551    mix: Integer;
     1552    emix: Integer;
     1553    Flags: Integer;
     1554    FromLoc: Integer;
     1555    dx: Integer;
     1556    dy: Integer;
     1557    EndHealth: Integer;
     1558    EndHealthDef: Integer;
     1559    Fuel: Integer;
     1560    Exp: Integer;
     1561    Load: Integer;
     1562  end;
     1563
    14661564  TShowShipChange = record
    1467     Reason, Ship1Owner, Ship2Owner: integer;
    1468     Ship1Change, Ship2Change: array [0 .. nShipPart - 1] of integer;
    1469   end;
     1565    Reason: Integer;
     1566    Ship1Owner: Integer;
     1567    Ship2Owner: Integer;
     1568    Ship1Change: array [0 .. nShipPart - 1] of Integer;
     1569    Ship2Change: array [0 .. nShipPart - 1] of Integer;
     1570  end;
     1571
    14701572  TOffer = record
    1471     nDeliver, nCost: integer;
     1573    nDeliver: Integer;
     1574    nCost: Integer;
    14721575    Price: array [0 .. 11] of Cardinal;
    14731576  end;
    1474   TChart = array [0 .. INFIN] of integer;
     1577
     1578  TChart = array [0 .. INFIN] of Integer;
    14751579  TEditTileData = record
    1476     Loc, NewTile: integer
     1580    Loc: Integer;
     1581    NewTile: Integer;
    14771582  end;
    14781583  TCreateUnitData = record
    1479     Loc, p, mix: integer;
     1584    Loc: Integer;
     1585    p: Integer;
     1586    mix: Integer;
    14801587  end;
    14811588
     
    14941601
    14951602  TPlayerContext = record
    1496     Data: pointer;
     1603    Data: Pointer;
    14971604    Map: ^TTileList;
    14981605    { the playground, a list of tiles with index = location, see tile flags }
     
    15081615    EnemyReport: array [0 .. nPl - 1] of ^TEnemyReport;
    15091616
    1510     TestFlags, // options turned on in the "Manipulation" menu
    1511     Turn, // current turn
    1512     Alive, { bitset of IDs of players still alive, flag 1 shl p for player p }
    1513     Happened, // flags indicate what happened within the last turnaround
    1514     AnarchyStart, // start turn of anarchy, <0 if not in anarchy
    1515     Credibility, // own credibility
    1516     MaxCredibility, // maximum credibility still to achieve
    1517     nUn, { number of units }
    1518     nCity, { number of cities }
    1519     nModel, { number of developed unit models }
    1520     nEnemyUn, nEnemyCity, nEnemyModel, Government, { gAnarchy..gDemocracy }
    1521     Money, TaxRate, LuxRate, Research,
     1617    TestFlags: Integer; // options turned on in the "Manipulation" menu
     1618    Turn: Integer; // current turn
     1619    Alive: Integer; { bitset of IDs of players still alive, flag 1 shl p for player p }
     1620    Happened: Integer; // flags indicate what happened within the last turnaround
     1621    AnarchyStart: Integer; // start turn of anarchy, <0 if not in anarchy
     1622    Credibility: Integer; // own credibility
     1623    MaxCredibility: Integer; // maximum credibility still to achieve
     1624    nUn: Integer; { number of units }
     1625    nCity: Integer; { number of cities }
     1626    nModel: Integer; { number of developed unit models }
     1627    nEnemyUn: Integer;
     1628    nEnemyCity: Integer;
     1629    nEnemyModel: Integer;
     1630    Government: Integer; { gAnarchy..gDemocracy }
     1631    Money: Integer;
     1632    TaxRate: Integer;
     1633    LuxRate: Integer;
     1634    Research: Integer;
    15221635    { collected research points for currently researched tech }
    1523     ResearchTech: integer; // currently researched tech
     1636    ResearchTech: Integer; // currently researched tech
    15241637    DevModel: TModel; { unit model currently under development }
    15251638    Tech: array [0 .. (nAdv + 3) div 4 * 4 - 1] of ShortInt; { tech status indicator }
    1526     Attitude: array [0 .. nPl - 1] of integer; // attitude to other nations
    1527     Treaty: array [0 .. nPl - 1] of integer; // treaty with other nations
    1528     EvaStart: array [0 .. nPl - 1] of integer; // peace treaty: start of evacuation period
    1529     Tribute: array [0 .. nPl - 1] of integer; // no longer in use
    1530     TributePaid: array [0 .. nPl - 1] of integer; // no longer in use
     1639    Attitude: array [0 .. nPl - 1] of Integer; // attitude to other nations
     1640    Treaty: array [0 .. nPl - 1] of Integer; // treaty with other nations
     1641    EvaStart: array [0 .. nPl - 1] of Integer; // peace treaty: start of evacuation period
     1642    Tribute: array [0 .. nPl - 1] of Integer; // no longer in use
     1643    TributePaid: array [0 .. nPl - 1] of Integer; // no longer in use
    15311644    Wonder: array [0 .. 27] of TWonderInfo;
    15321645    Ship: array [0 .. nPl - 1] of TShipInfo;
    15331646    NatBuilt: array [28 .. (nImp + 3) div 4 * 4 - 1] of ShortInt;
    1534     nBattleHistory: integer;
     1647    nBattleHistory: Integer;
    15351648    BattleHistory: ^TBattleList; // complete list of all my battles in the whole game
    15361649    BorderHelper: ^TByteList;
    1537     LastCancelTreaty: array [0 .. nPl - 1] of integer; // turn of last treaty cancel
    1538     OracleIncome: integer;
     1650    LastCancelTreaty: array [0 .. nPl - 1] of Integer; // turn of last treaty cancel
     1651    OracleIncome: Integer;
    15391652    DefaultDebugMap: ^TIntList;
    15401653    Filler: array [0 .. 879] of Byte;
     
    15431656  TInitModuleData = record
    15441657    Server: TServerCall;
    1545     DataVersion, DataSize, Flags: integer;
     1658    DataVersion: Integer;
     1659    DataSize: Integer;
     1660    Flags: Integer;
    15461661  end;
    15471662
    15481663  TNewGameData = record
    1549     lx, ly, LandMass, MaxTurn: integer;
    1550     Difficulty: array [0 .. nPl - 1] of integer;
     1664    lx: Integer;
     1665    ly: Integer;
     1666    LandMass: Integer;
     1667    MaxTurn: Integer;
     1668    Difficulty: array [0 .. nPl - 1] of Integer;
    15511669    { difficulty levels of the players, if it's 0 this player is the supervisor,
    15521670      -1 for unused slots }
    15531671    RO: array [0 .. nPl - 1] of ^TPlayerContext;
    1554     AssemblyPath: array [0 .. 255] of char;
     1672    AssemblyPath: array [0 .. 255] of Char;
    15551673    SuperVisorRO: array [0 .. nPl - 1] of ^TPlayerContext;
    15561674  end;
    15571675
    15581676  TNewGameExData = record
    1559     lx, ly, LandMass, MaxTurn, RND: integer;
    1560     Difficulty: array [0 .. nPl - 1] of integer;
     1677    lx: Integer;
     1678    ly: Integer;
     1679    LandMass: Integer;
     1680    MaxTurn: Integer;
     1681    RND: Integer;
     1682    Difficulty: array [0 .. nPl - 1] of Integer;
    15611683    { difficulty levels of the players, if it's 0 this player is the supervisor,
    15621684      -1 for unused slots }
    1563     Controlled: integer;
     1685    Controlled: Integer;
    15641686  end;
    15651687
    15661688  TShowNegoData = record
    1567     pSender, pTarget, Action: integer;
     1689    pSender: Integer;
     1690    pTarget: Integer;
     1691    Action: Integer;
    15681692    Offer: TOffer;
    15691693  end;
     
    16371761  DelphiRandSeed: Integer;
    16381762
    1639 procedure MakeUnitInfo(p: integer; const u: TUn; var ui: TUnitInfo);
    1640 procedure MakeModelInfo(p, mix: integer; const m: TModel; var mi: TModelInfo);
    1641 function IsSameModel(const mi1, mi2: TModelInfo): boolean;
    1642 function SpecialTile(Loc, TerrType, lx: integer): integer;
     1763procedure MakeUnitInfo(p: Integer; const u: TUn; var ui: TUnitInfo);
     1764procedure MakeModelInfo(p, mix: Integer; const m: TModel; var mi: TModelInfo);
     1765function IsSameModel(const mi1, mi2: TModelInfo): Boolean;
     1766function SpecialTile(Loc, TerrType, lx: Integer): Integer;
    16431767function DelphiRandom(const pi_Max: Integer): Integer; overload;
    16441768function DelphiRandom: Extended; overload;
     
    16471771implementation
    16481772
    1649 procedure MakeUnitInfo(p: integer; const u: TUn; var ui: TUnitInfo);
     1773procedure MakeUnitInfo(p: Integer; const u: TUn; var ui: TUnitInfo);
    16501774begin
    16511775  ui.Owner := p;
     
    16601784end;
    16611785
    1662 procedure MakeModelInfo(p, mix: integer; const m: TModel; var mi: TModelInfo);
     1786procedure MakeModelInfo(p, mix: Integer; const m: TModel; var mi: TModelInfo);
    16631787var
    1664   i: integer;
     1788  i: Integer;
    16651789begin
    16661790  mi.Owner := p;
     
    16991823end;
    17001824
    1701 function IsSameModel(const mi1, mi2: TModelInfo): boolean;
     1825function IsSameModel(const mi1, mi2: TModelInfo): Boolean;
    17021826type
    17031827  TModelInfo_Compare = array [0 .. 5] of Cardinal;
     
    17121836end;
    17131837
    1714 function SpecialTile(Loc, TerrType, lx: integer): integer;
     1838function SpecialTile(Loc, TerrType, lx: Integer): Integer;
    17151839var
    1716   x, y, qx, qy, a: integer;
     1840  x, y, qx, qy, a: Integer;
    17171841begin
    17181842  if TerrType = fOcean then
Note: See TracChangeset for help on using the changeset viewer.