Changeset 265 for trunk/UCore.pas
- Timestamp:
- Jan 15, 2019, 1:03:40 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r254 r265 9 9 UGame, UApplicationInfo, UPersistentForm, UScaleDPI, UCoolTranslator, 10 10 URegistry, ULastOpenedList, UTheme, Registry, Menus, UFormClient, UPlayer, 11 UGameServer, UGameClient, fgl, UServerList ;11 UGameServer, UGameClient, fgl, UServerList, UGameSystem, UUnit; 12 12 13 13 type … … 87 87 procedure UpdateOtherForms; 88 88 procedure FormClientActions; 89 procedure InitGameSystems; 89 90 public 90 91 Game: TGame; … … 99 100 LocalClients: TClients; 100 101 ServerList: TServerList; 102 GameSystems: TGameSystems; 101 103 procedure ReopenGameOnInit; 102 104 procedure LoadConfig; … … 445 447 procedure TCore.DataModuleCreate(Sender: TObject); 446 448 begin 449 GameSystems := TGameSystems.Create; 450 InitGameSystems; 447 451 Server := TServer.Create; 448 452 LocalClients := TClients.Create; 449 453 GameSettings := TGame.Create; 454 GameSettings.GameSystem := GameSystems.First; 450 455 Game := TGame.Create; 451 456 Game.OnMoveUpdated := DoMoveUpdated; … … 453 458 Game.OnNewTurn := GameNewTurnExecute; 454 459 Game.OnPlayerChange := DoPlayerChange; 460 Game.GameSystem := GameSystems.First; 455 461 Server.Game := Game; 456 462 LocalClients.Game := Game; … … 481 487 FreeAndNil(Game); 482 488 FreeAndNil(GameSettings); 489 FreeAndNil(GameSystems); 483 490 end; 484 491 … … 486 493 begin 487 494 LastOpenedList1.LoadToMenuItem(FormMain.MenuItemLoadRecent, LoadRecentExecute); 495 end; 496 497 procedure TCore.InitGameSystems; 498 begin 499 with GameSystems.AddNew('HexWars') do begin 500 MaxPlayerCount := 3; 501 with UnitKinds.AddNew('Unit') do begin 502 Moves := 1; 503 Stack := 99; 504 end; 505 end; 506 507 with GameSystems.AddNew('Civilization') do begin 508 MaxPlayerCount := 3; 509 with UnitKinds.AddNew('Scout') do begin 510 Moves := 1; 511 Stack := 1; 512 end; 513 with UnitKinds.AddNew('Settler') do begin 514 Moves := 1; 515 Stack := 1; 516 end; 517 end; 518 519 with GameSystems.AddNew('Dune 2') do begin 520 MaxPlayerCount := 3; 521 with UnitKinds.AddNew('Light Infantry') do begin 522 Moves := 1; 523 end; 524 with UnitKinds.AddNew('Heavy Troopers') do begin 525 Moves := 1; 526 end; 527 with UnitKinds.AddNew('Trike') do begin 528 Moves := 1; 529 end; 530 with UnitKinds.AddNew('Quad') do begin 531 Moves := 1; 532 end; 533 end; 534 535 with GameSystems.AddNew('Battle Isle 2') do begin 536 MaxPlayerCount := 8; 537 with UnitKinds.AddNew('Demon 132') do begin 538 Moves := 4; 539 Stack := 10; 540 end; 541 with UnitKinds.AddNew('Troll 142') do begin 542 Moves := 3; 543 Stack := 10; 544 end; 545 with UnitKinds.AddNew('Ranger 132') do begin 546 Moves := 10; 547 Stack := 10; 548 end; 549 with UnitKinds.AddNew('Buggy') do begin 550 Moves := 10; 551 Stack := 10; 552 end; 553 end; 488 554 end; 489 555
Note:
See TracChangeset
for help on using the changeset viewer.