source: tags/1.3.1/LocalPlayer/LocalPlayer.pas

Last change on this file was 364, checked in by chronos, 4 years ago
  • Added: Partial network game play implementation.
  • Modified: Code cleanup.
File size: 1.8 KB
Line 
1{$INCLUDE Switches.inc}
2unit LocalPlayer;
3
4interface
5
6procedure Client(Command, Player: integer; var Data); stdcall;
7procedure SetAIName(p: integer; Name: string);
8
9implementation
10
11uses
12 Term, CityScreen, Draft, MessgEx, Select, CityType, Help, UnitStat, Diagram,
13 NatStat, Wonders, Nego, Enhance, BaseWin, Battle, Rates, TechTree, Forms;
14
15var
16 FormsCreated: boolean;
17
18procedure Client(Command, Player: integer; var Data);
19begin
20 if not FormsCreated then
21 begin
22 FormsCreated := true;
23 // TODO: Changing application name in runtime will cause change of Linux XML registry file path
24// Application.MainForm := MainScreen;
25 Application.CreateForm(TMainScreen, MainScreen);
26 Application.CreateForm(TCityDlg, CityDlg);
27 Application.CreateForm(TModalSelectDlg, ModalSelectDlg);
28 Application.CreateForm(TListDlg, ListDlg);
29 Application.CreateForm(TMessgExDlg, MessgExDlg);
30 Application.CreateForm(TDraftDlg, DraftDlg);
31 Application.CreateForm(TCityTypeDlg, CityTypeDlg);
32 Application.CreateForm(THelpDlg, HelpDlg);
33 Application.CreateForm(TUnitStatDlg, UnitStatDlg);
34 Application.CreateForm(TDiaDlg, DiaDlg);
35 Application.CreateForm(TNatStatDlg, NatStatDlg);
36 Application.CreateForm(TWondersDlg, WondersDlg);
37 Application.CreateForm(TNegoDlg, NegoDlg);
38 Application.CreateForm(TEnhanceDlg, EnhanceDlg);
39 Application.CreateForm(TBattleDlg, BattleDlg);
40 // Application.CreateForm(TAdvisorDlg, AdvisorDlg);
41 Application.CreateForm(TRatesDlg, RatesDlg);
42 Application.CreateForm(TTechTreeDlg, TechTreeDlg);
43 end;
44 MainScreen.Client(Command, Player, Data);
45end;
46
47procedure SetAIName(p: integer; Name: string);
48begin
49 MainScreen.SetAIName(p, Name);
50end;
51
52initialization
53
54FormsCreated := false;
55
56end.
Note: See TracBrowser for help on using the repository browser.