Changeset 176 for trunk/UCore.pas


Ignore:
Timestamp:
Jan 30, 2018, 6:36:50 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Clients moved to TServer class.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        88backup
        99xtactics.exe
         10*.lrj
  • trunk/UCore.pas

    r174 r176  
    7878  public
    7979    Game: TGame;
     80    Server: TServer;
    8081    UseSingleView: Boolean;
    8182    DevelMode: Boolean;
     
    247248  FirstHuman := Game.Players.GetFirstHuman;
    248249  if Assigned(FirstHuman) then CurrentClient := FirstHuman.Client
    249     else CurrentClient := TClient(Game.Clients.First);
     250    else CurrentClient := TClient(Server.Clients.First);
    250251end;
    251252
     
    384385procedure TCore.DataModuleCreate(Sender: TObject);
    385386begin
     387  Server := TServer.Create;
    386388  Game := TGame.Create;
    387389  Game.OnMove := DoOnMove;
     
    390392  Game.OnNewTurn := GameNewTurnExecute;
    391393  Game.OnPlayerChange := DoPlayerChange;
     394  Game.Server := Server;
     395  Server.Game := Game;
    392396  StoredDimension := TControlDimension.Create;
    393397  XMLConfig1.Filename := GetAppConfigDir(False) + 'Config.xml';
     
    400404  Game.SaveConfig(XMLConfig1, 'Game');
    401405  SaveConfig;
     406  FreeAndNil(Server);
    402407  FreeAndNil(Game);
    403408end;
     
    416421begin
    417422  Game.LoadFromFile(FileName);
     423  Server.InitClients;
    418424  SelectClient;
    419425  LastOpenedList1.AddItem(FileName);
     
    430436begin
    431437  Game.New;
     438  Server.InitClients;
    432439  Game.DevelMode := DevelMode;
    433440  SelectClient;
Note: See TracChangeset for help on using the changeset viewer.