Changeset 339
- Timestamp:
- Sep 9, 2024, 10:50:10 PM (2 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Core.pas
r337 r339 7 7 Game, ApplicationInfo, PersistentForm, ScaleDPI, Translator, DOM, 8 8 RegistryEx, LastOpenedList, Theme, Registry, Menus, FormCharts, FormMain, 9 FormClient, Player, GameServer, GameClient, ServerList, GameSystem, Graphics, 10 &Unit; 9 FormClient, Player, GameServer, GameClient, ServerList, GameSystem, Graphics; 11 10 12 11 type … … 133 132 FormNew, FormSettings, ClientAI, FormKeyShortcuts, Common, FormEx, FormTests, 134 133 FormHelp, FormUnitMoves, FormPlayersStats, ClientGUI, FormAbout, Tests, 135 FormGameSystems ;134 FormGameSystems, UnitKind; 136 135 137 136 const -
trunk/Game.pas
r337 r339 127 127 128 128 uses 129 TurnStats ;129 TurnStats, UnitKind; 130 130 131 131 resourcestring -
trunk/GameSystem.pas
r322 r339 4 4 5 5 uses 6 Classes, SysUtils, Generics.Collections, &Unit, DOM, XMLRead, XMLWrite, XML, XMLConf,7 FileUtil, LazFileUtils, MapType, Nation, Building, ItemList;6 Classes, SysUtils, Generics.Collections, &Unit, DOM, XMLRead, XMLWrite, XML, 7 XMLConf, FileUtil, LazFileUtils, MapType, Nation, Building, ItemList, UnitKind; 8 8 9 9 type -
trunk/Languages/xtactics.cs.po
r337 r339 1340 1340 msgid "View range" 1341 1341 msgstr "Dohled" 1342 1343 #: unitkind.scost 1344 msgctxt "unitkind.scost" 1345 msgid "Cost" 1346 msgstr "Cena" 1347 1348 #: unitkind.smoves 1349 msgctxt "unitkind.smoves" 1350 msgid "Moves" 1351 msgstr "Pohyby" 1352 1353 #: unitkind.spowerattack 1354 msgctxt "unitkind.spowerattack" 1355 msgid "Attack power" 1356 msgstr "Síla útoku" 1357 1358 #: unitkind.spowerdefense 1359 msgctxt "unitkind.spowerdefense" 1360 msgid "Defense power" 1361 msgstr "Síla obrany" 1362 1363 #: unitkind.sstack 1364 msgctxt "unitkind.sstack" 1365 msgid "Stack" 1366 msgstr "Sada" 1367 1368 #: unitkind.sunitkind 1369 msgctxt "unitkind.sunitkind" 1370 msgid "Unit kind" 1371 msgstr "Druh jednotky" 1372 1373 #: unitkind.sviewrange 1374 msgctxt "unitkind.sviewrange" 1375 msgid "View range" 1376 msgstr "Dohled" -
trunk/Languages/xtactics.pot
r337 r339 1304 1304 msgstr "" 1305 1305 1306 #: unitkind.scost 1307 msgctxt "unitkind.scost" 1308 msgid "Cost" 1309 msgstr "" 1310 1311 #: unitkind.smoves 1312 msgctxt "unitkind.smoves" 1313 msgid "Moves" 1314 msgstr "" 1315 1316 #: unitkind.spowerattack 1317 msgctxt "unitkind.spowerattack" 1318 msgid "Attack power" 1319 msgstr "" 1320 1321 #: unitkind.spowerdefense 1322 msgctxt "unitkind.spowerdefense" 1323 msgid "Defense power" 1324 msgstr "" 1325 1326 #: unitkind.sstack 1327 msgctxt "unitkind.sstack" 1328 msgid "Stack" 1329 msgstr "" 1330 1331 #: unitkind.sunitkind 1332 msgctxt "unitkind.sunitkind" 1333 msgid "Unit kind" 1334 msgstr "" 1335 1336 #: unitkind.sviewrange 1337 msgctxt "unitkind.sviewrange" 1338 msgid "View range" 1339 msgstr "" 1340 -
trunk/Player.pas
r337 r339 186 186 187 187 uses 188 Game, GameSystem, Building ;188 Game, GameSystem, Building, UnitKind; 189 189 190 190 resourcestring -
trunk/Unit.pas
r336 r339 4 4 5 5 uses 6 Classes, SysUtils, Generics.Collections, Geometry, DOM, XML, ItemList ;6 Classes, SysUtils, Generics.Collections, Geometry, DOM, XML, ItemList, UnitKind; 7 7 8 8 type 9 10 { TUnitKind }11 12 TUnitKind = class(TItem)13 PowerAttack: Integer;14 PowerDefense: Integer;15 Moves: Integer;16 Cost: Integer;17 Power: Integer;18 ViewRange: Integer;19 class function GetFields: TItemFields; override;20 procedure GetValue(Index: Integer; out Value); override;21 procedure SetValue(Index: Integer; var Value); override;22 class function GetClassSysName: string; override;23 class function GetClassName: string; override;24 end;25 26 { TUnitKinds }27 28 TUnitKinds = class(TItemList)29 constructor Create(FreeObjects: Boolean = True);30 class function GetItemClass: TItemClass; override;31 end;32 33 9 TUnit = class 34 10 private … … 81 57 Player, Map, Game; 82 58 83 resourcestring84 SStack = 'Stack';85 SCost = 'Cost';86 SMoves = 'Moves';87 SPowerAttack = 'Attack power';88 SPowerDefense = 'Defense power';89 SViewRange = 'View range';90 SUnitKind = 'Unit kind';91 92 { TUnitKind }93 94 class function TUnitKind.GetFields: TItemFields;95 begin96 Result := inherited;97 Result.AddField(2, 'Stack', SStack, dtInteger);98 Result.AddField(3, 'Cost', SCost, dtInteger);99 Result.AddField(4, 'Moves', SMoves, dtInteger);100 Result.AddField(5, 'PowerAttack', SPowerAttack, dtInteger);101 Result.AddField(6, 'PowerDefense', SPowerDefense, dtInteger);102 Result.AddField(7, 'ViewRange', SViewRange, dtInteger);103 end;104 105 procedure TUnitKind.GetValue(Index: Integer; out Value);106 begin107 if Index = 1 then string(Value) := Name108 else if Index = 2 then Integer(Value) := Power109 else if Index = 3 then Integer(Value) := Cost110 else if Index = 4 then Integer(Value) := Moves111 else if Index = 5 then Integer(Value) := PowerAttack112 else if Index = 6 then Integer(Value) := PowerDefense113 else if Index = 7 then Integer(Value) := ViewRange114 else inherited;115 end;116 117 procedure TUnitKind.SetValue(Index: Integer; var Value);118 begin119 if Index = 1 then Name := string(Value)120 else if Index = 2 then Power := Integer(Value)121 else if Index = 3 then Cost := Integer(Value)122 else if Index = 4 then Moves := Integer(Value)123 else if Index = 5 then PowerAttack := Integer(Value)124 else if Index = 6 then PowerDefense := Integer(Value)125 else if Index = 7 then ViewRange := Integer(Value)126 else inherited;127 end;128 129 class function TUnitKind.GetClassSysName: string;130 begin131 Result := 'UnitKind';132 end;133 134 class function TUnitKind.GetClassName: string;135 begin136 Result := SUnitKind;137 end;138 139 59 { TUnits } 140 60 … … 309 229 end; 310 230 311 { TUnitKinds }312 313 constructor TUnitKinds.Create(FreeObjects: Boolean);314 begin315 inherited;316 end;317 318 class function TUnitKinds.GetItemClass: TItemClass;319 begin320 Result := TUnitKind;321 end;322 323 231 end. 324 232 -
trunk/xtactics.lpi
r337 r339 110 110 </Item6> 111 111 </RequiredPackages> 112 <Units Count="4 1">112 <Units Count="42"> 113 113 <Unit0> 114 114 <Filename Value="xtactics.lpr"/> … … 324 324 <IsPartOfProject Value="True"/> 325 325 </Unit40> 326 <Unit41> 327 <Filename Value="UnitKind.pas"/> 328 <IsPartOfProject Value="True"/> 329 </Unit41> 326 330 </Units> 327 331 </ProjectOptions> -
trunk/xtactics.lpr
r337 r339 8 8 Forms, tachartlazaruspkg, Game, Core, Common, TemplateGenerics 9 9 { you can add units after this }, 10 SysUtils, FormMain, CoolStreaming, Tests, TurnStats ;10 SysUtils, FormMain, CoolStreaming, Tests, TurnStats, UnitKind; 11 11 12 12 {$R *.res}
Note:
See TracChangeset
for help on using the changeset viewer.