Changeset 143 for trunk/Direct.pas


Ignore:
Timestamp:
May 8, 2018, 4:37:34 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Brains array changed to object list and TBrainInfo record to TBrain class for better code maintainability.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Direct.pas

    r112 r143  
    5353procedure TDirectDlg.DlgNotify(ID: integer);
    5454var
    55   hMem: Cardinal;
    56   p: pointer;
     55//  hMem: Cardinal;
     56//  p: pointer;
    5757  s: string;
    5858begin
     
    7171      begin
    7272        s := Format(Phrases.Lookup('BUSY_MOD'),
    73           [Brain[ID - ntInitModule].Name]);
     73          [Brains[ID - ntInitModule].Name]);
    7474        while BiColorTextWidth(Canvas, s) + 64 > ClientWidth do
    7575          Delete(s, Length(s), 1);
     
    9898    ntDLLError .. ntDLLError + 128:
    9999      SimpleMessage(Format(Phrases.Lookup('DLLERROR'),
    100         [Brain[ID - ntDLLError].FileName]));
     100        [Brains[ID - ntDLLError].FileName]));
    101101    ntAIError:
    102102      SimpleMessage(Format(Phrases.Lookup('AIERROR'), [NotifyMessage]));
    103103    ntClientError .. ntClientError + 128:
    104104      SimpleMessage(Format(Phrases.Lookup('CLIENTERROR'),
    105         [Brain[ID - ntClientError].FileName]));
     105        [Brains[ID - ntClientError].FileName]));
    106106    ntEndInfo:
    107107      begin
     
    157157      begin
    158158        Info := Format(Phrases2.Lookup('BUSY_DEINIT'),
    159           [Brain[ID - ntDeinitModule].Name]);
     159          [Brains[ID - ntDeinitModule].Name]);
    160160        while BiColorTextWidth(Canvas, Info) + 64 > ClientWidth do
    161161          Delete(Info, Length(Info), 1);
     
    183183  Info := '';
    184184  GameServer.Init(Notify);
    185   Brain[bixNoTerm].Client := NoTerm.Client;
    186   Brain[bixSuper_Virtual].Client := nil;
    187   Brain[bixTerm].Client := LocalPlayer.Client;
    188   Brain[bixNoTerm].Name := Phrases.Lookup('AIT');
    189   Brain[bixSuper_Virtual].Name := Phrases.Lookup('SUPER');
    190   Brain[bixTerm].Name := Phrases.Lookup('HUMAN');
    191   Brain[bixRandom].Name := Phrases.Lookup('RANDOMAI');
     185  BrainNoTerm.Client := NoTerm.Client;
     186  BrainNoTerm.Name := Phrases.Lookup('AIT');
     187  BrainSuperVirtual.Client := nil;
     188  BrainSuperVirtual.Name := Phrases.Lookup('SUPER');
     189  BrainTerm.Client := LocalPlayer.Client;
     190  BrainTerm.Name := Phrases.Lookup('HUMAN');
     191  BrainRandom.Name := Phrases.Lookup('RANDOMAI');
    192192  Canvas.Font.Assign(UniFont[ftNormal]);
    193193  Canvas.Brush.Style := bsClear;
     
    214214begin
    215215  Hide;
    216   if nBrain = 3 then
     216  if Brains.Count = 3 then
    217217  begin
    218218    Application.MessageBox(PChar(Phrases.Lookup('NOAI')), 'C-evo', 0);
     
    268268begin
    269269  Application.MessageBox(PChar(Format(Phrases.Lookup('AIEXCEPTION'),
    270     [Brain[Msg.WParam].Name])), 'C-evo', 0);
     270    [Brains[Msg.WParam].Name])), 'C-evo', 0);
    271271end;
    272272
Note: See TracChangeset for help on using the changeset viewer.