Ignore:
Timestamp:
May 11, 2018, 11:57:25 PM (6 years ago)
Author:
chronos
Message:
  • Modified: More code refactoring related to players brain selection.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r120 r144  
    304304    TPriceSet = Set of $00 .. $FF;
    305305
    306   const
    307     crImpDrag = 2;
    308     crFlatHand = 3;
    309 
    310     xxu = 32;
    311     yyu = 24; // half of unit slot size x/y
    312     yyu_anchor = 32;
    313     xxc = 32;
    314     yyc = 16; // 1/2 of city slot size in x, 1/2 of ground tile size in y (=1/3 of slot)
    315 
    316     // layout
    317     TopBarHeight = 41;
    318     PanelHeight = 168;
    319     MidPanelHeight = 120;
    320     // TopBarHeight+MidPanelHeight should be same as BaseWin.yUnused
    321     MapCenterUp = (MidPanelHeight - TopBarHeight) div 2;
    322 
    323     nCityType = 4;
    324 
    325     { client exclusive commands: }
    326     cSetTribe = $9000;
    327     cSetNewModelPicture = $9100;
    328     cSetModelName = $9110;
    329     cSetModelPicture = $9120;
    330     cSetSlaveIndex = $9131;
    331     cSetCityName = $9200;
    332 
    333     // city status flags
    334     csTypeMask = $0007;
    335     csToldDelay = $0008;
    336     csResourceWeightsMask = $00F0;
    337     csToldBombard = $0100;
    338 
    339     { unit status flags }
    340     usStay = $01;
    341     usWaiting = $02;
    342     usGoto = $04;
    343     usEnhance = $08;
    344     usRecover = $10;
    345     usToldNoReturn = $100;
    346     usPersistent = usStay or usGoto or usEnhance or usRecover or
    347       integer($FFFF0000);
    348 
    349     { model status flags }
    350     msObsolete = $1;
    351     msAllowConscripts = $2;
    352 
    353     { additional city happened flags }
    354     chTypeDel = $8000;
    355     chAllImpsMade = $4000;
    356 
    357     adNone = $801;
    358     adFar = $802;
    359     adNexus = $803;
    360 
    361     SpecialModelPictureCode: array [0 .. nSpecialModel - 1] of integer = (10,
    362       11, 40, 41, 21, 30, { 50,51, } 64, 74, { 71, } 73);
    363 
    364     pixSlaves = 0;
    365     pixNoSlaves = 1; // index of slaves in StdUnits
    366 
    367     // icons.bmp properties
    368     xSizeSmall = 36;
    369     ySizeSmall = 20;
    370     SystemIconLines = 2;
    371     // lines of system icons in icons.bmp before improvements
    372 
    373     // save options apart from what's defined by SaveOption
    374     soTellAI = 30;
    375     soExtraMask = $40000000;
    376 
    377     nCityEventPriority = 16;
    378     CityEventPriority: array [0 .. nCityEventPriority - 1] of integer =
    379       (chDisorder, chImprovementLost, chUnitLost, chAllImpsMade, chProduction,
    380       chOldWonder, chNoSettlerProd, chPopDecrease, chProductionSabotaged,
    381       chNoGrowthWarning, chPollution, chTypeDel, chFounded, chSiege,
    382       chAfterCapture, chPopIncrease);
    383 
    384     CityEventSoundItem: array [0 .. 15] of string = ('CITY_DISORDER', '',
    385       'CITY_POPPLUS', 'CITY_POPMINUS', 'CITY_UNITLOST', 'CITY_IMPLOST',
    386       'CITY_SABOTAGE', 'CITY_GROWTHNEEDSIMP', 'CITY_POLLUTION', 'CITY_SIEGE',
    387       'CITY_WONDEREX', 'CITY_EMDELAY', 'CITY_FOUNDED', 'CITY_FOUNDED', '',
    388       'CITY_INVALIDTYPE');
    389 
    390   type
    391     TPersistentData = record
    392       FarTech, ToldAge, ToldModels, ToldAlive, ToldContact, ToldOwnCredibility,
    393         ColdWarStart, PeaceEvaHappened: integer;
    394       EnhancementJobs: TEnhancementJobs;
    395       ImpOrder: array [0 .. nCityType - 1] of TImpOrder;
    396       ToldWonders: array [0 .. 27] of TWonderInfo;
    397       ToldTech: array [0 .. nAdv - 1] of ShortInt;
    398     end;
    399 
    400   var
    401     MyData: ^TPersistentData;
    402     AdvIcon: array [0 .. nAdv - 1] of integer;
    403     { icons displayed with the technologies }
    404     xxt, yyt, // half of tile size x/y
    405     GameMode, ClientMode, Age, UnFocus, OptionChecked, MapOptionChecked,
    406       nLostArmy, ScienceSum, TaxSum, SoundPreloadDone, MarkCityLoc, HGrTerrain,
    407       HGrCities, MovieSpeed: integer;
    408     CityRepMask: Cardinal;
    409     ReceivedOffer: TOffer;
    410     Buffer, SmallImp: TBitmap;
    411     BlinkON, DestinationMarkON, StartRunning, StayOnTop_Ensured,
    412       supervising: boolean;
    413     UnusedTribeFiles, TribeNames: tstringlist;
    414     TribeOriginal: array [0 .. nPl - 1] of boolean;
    415     LostArmy: array [0 .. nPl * nMmax - 1] of integer;
    416     DipMem: array [0 .. nPl - 1] of record pContact, SentCommand,
    417       FormerTreaty: integer;
     306const
     307  crImpDrag = 2;
     308  crFlatHand = 3;
     309
     310  xxu = 32;
     311  yyu = 24; // half of unit slot size x/y
     312  yyu_anchor = 32;
     313  xxc = 32;
     314  yyc = 16; // 1/2 of city slot size in x, 1/2 of ground tile size in y (=1/3 of slot)
     315
     316  // layout
     317  TopBarHeight = 41;
     318  PanelHeight = 168;
     319  MidPanelHeight = 120;
     320  // TopBarHeight+MidPanelHeight should be same as BaseWin.yUnused
     321  MapCenterUp = (MidPanelHeight - TopBarHeight) div 2;
     322
     323  nCityType = 4;
     324
     325  { client exclusive commands: }
     326  cSetTribe = $9000;
     327  cSetNewModelPicture = $9100;
     328  cSetModelName = $9110;
     329  cSetModelPicture = $9120;
     330  cSetSlaveIndex = $9131;
     331  cSetCityName = $9200;
     332
     333  // city status flags
     334  csTypeMask = $0007;
     335  csToldDelay = $0008;
     336  csResourceWeightsMask = $00F0;
     337  csToldBombard = $0100;
     338
     339  { unit status flags }
     340  usStay = $01;
     341  usWaiting = $02;
     342  usGoto = $04;
     343  usEnhance = $08;
     344  usRecover = $10;
     345  usToldNoReturn = $100;
     346  usPersistent = usStay or usGoto or usEnhance or usRecover or
     347    integer($FFFF0000);
     348
     349  { model status flags }
     350  msObsolete = $1;
     351  msAllowConscripts = $2;
     352
     353  { additional city happened flags }
     354  chTypeDel = $8000;
     355  chAllImpsMade = $4000;
     356
     357  adNone = $801;
     358  adFar = $802;
     359  adNexus = $803;
     360
     361  SpecialModelPictureCode: array [0 .. nSpecialModel - 1] of integer = (10,
     362    11, 40, 41, 21, 30, { 50,51, } 64, 74, { 71, } 73);
     363
     364  pixSlaves = 0;
     365  pixNoSlaves = 1; // index of slaves in StdUnits
     366
     367  // icons.bmp properties
     368  xSizeSmall = 36;
     369  ySizeSmall = 20;
     370  SystemIconLines = 2;
     371  // lines of system icons in icons.bmp before improvements
     372
     373  // save options apart from what's defined by SaveOption
     374  soTellAI = 30;
     375  soExtraMask = $40000000;
     376
     377  nCityEventPriority = 16;
     378  CityEventPriority: array [0 .. nCityEventPriority - 1] of integer =
     379    (chDisorder, chImprovementLost, chUnitLost, chAllImpsMade, chProduction,
     380    chOldWonder, chNoSettlerProd, chPopDecrease, chProductionSabotaged,
     381    chNoGrowthWarning, chPollution, chTypeDel, chFounded, chSiege,
     382    chAfterCapture, chPopIncrease);
     383
     384  CityEventSoundItem: array [0 .. 15] of string = ('CITY_DISORDER', '',
     385    'CITY_POPPLUS', 'CITY_POPMINUS', 'CITY_UNITLOST', 'CITY_IMPLOST',
     386    'CITY_SABOTAGE', 'CITY_GROWTHNEEDSIMP', 'CITY_POLLUTION', 'CITY_SIEGE',
     387    'CITY_WONDEREX', 'CITY_EMDELAY', 'CITY_FOUNDED', 'CITY_FOUNDED', '',
     388    'CITY_INVALIDTYPE');
     389
     390type
     391  TPersistentData = record
     392    FarTech: Integer;
     393    ToldAge: Integer;
     394    ToldModels: Integer;
     395    ToldAlive: Integer;
     396    ToldContact: Integer;
     397    ToldOwnCredibility: Integer;
     398    ColdWarStart: Integer;
     399    PeaceEvaHappened: Integer;
     400    EnhancementJobs: TEnhancementJobs;
     401    ImpOrder: array [0 .. nCityType - 1] of TImpOrder;
     402    ToldWonders: array [0 .. 27] of TWonderInfo;
     403    ToldTech: array [0 .. nAdv - 1] of ShortInt;
     404  end;
     405
     406var
     407  MyData: ^TPersistentData;
     408  AdvIcon: array [0 .. nAdv - 1] of Integer;
     409  { icons displayed with the technologies }
     410  xxt, yyt, // half of tile size x/y
     411  GameMode: Integer;
     412  ClientMode: Integer;
     413  Age: Integer;
     414  UnFocus: Integer;
     415  OptionChecked: Integer;
     416  MapOptionChecked: Integer;
     417  nLostArmy: Integer;
     418  ScienceSum: Integer;
     419  TaxSum: Integer;
     420  SoundPreloadDone: Integer;
     421  MarkCityLoc: Integer;
     422  HGrTerrain: Integer;
     423  HGrCities: Integer;
     424  MovieSpeed: Integer;
     425  CityRepMask: Cardinal;
     426  ReceivedOffer: TOffer;
     427  Buffer: TBitmap;
     428  SmallImp: TBitmap;
     429  BlinkON: Boolean;
     430  DestinationMarkON: Boolean;
     431  StartRunning: Boolean;
     432  StayOnTop_Ensured: Boolean;
     433  Supervising: Boolean;
     434  UnusedTribeFiles: TStringList;
     435  TribeNames: TStringList;
     436  TribeOriginal: array [0 .. nPl - 1] of Boolean;
     437  LostArmy: array [0 .. nPl * nMmax - 1] of Integer;
     438  DipMem: array [0 .. nPl - 1] of record
     439    pContact: Integer;
     440    SentCommand: Integer;
     441    FormerTreaty: Integer;
    418442    SentOffer: TOffer;
    419     DeliveredPrices, ReceivedPrices: TPriceSet;
     443    DeliveredPrices: TPriceSet;
     444    ReceivedPrices: TPriceSet;
    420445  end;
    421446
Note: See TracChangeset for help on using the changeset viewer.