- Timestamp:
- Dec 10, 2024, 10:38:11 AM (5 weeks ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Board.pas
r105 r109 20 20 procedure Clear; 21 21 procedure ClearMerged; 22 function GetBiggestTile: Integer; 22 23 function GetValueSum: Integer; 23 24 function GetHighestTileValue: Integer; … … 122 123 end; 123 124 125 function TBoard.GetBiggestTile: Integer; 126 var 127 X, Y: Integer; 128 begin 129 Result := 0; 130 for Y := 0 to Size.Y - 1 do 131 for X := 0 to Size.X - 1 do 132 if not Tiles[Y, X].Disabled and 133 not Tiles[Y, X].Unmergeable and 134 (Tiles[Y, X].Value > Result) then Result := Tiles[Y, X].Value; 135 end; 136 124 137 function TBoard.GetValueSum: Integer; 125 138 var -
trunk/Core.pas
r108 r109 275 275 Score: TScore; 276 276 begin 277 if Game.Score = 0 then Exit; // Do not record zero score 278 277 279 Score := Scores.SearchByTime(Game.StartTime); 278 280 if not Assigned(Score) then Score := Scores.AddNew; … … 282 284 Score.UsedUndos := Game.UsedUndos; 283 285 Score.BoardSize := IntToStr(Game.Board.Size.X) + 'x' + IntToStr(Game.Board.Size.Y); 286 Score.DisabledTiles := Game.DisabledTilesCount; 287 Score.UnmergeableTiles := Game.UnmergeableTilesCount; 288 Score.Duration := Now - Game.StartTime; 289 Score.BiggestTile := Game.Board.GetBiggestTile; 284 290 end; 285 291 -
trunk/Forms/FormScore.lfm
r108 r109 22 22 end 23 23 item 24 Caption = 'Board size' 25 Width = 100 26 end 27 item 24 28 Caption = 'Score' 29 Width = 100 30 end 31 item 32 Caption = 'Biggest tile' 25 33 Width = 100 26 34 end … … 34 42 end 35 43 item 36 Caption = 'Board size' 37 Width = 101 44 Caption = 'Disabled tiles' 45 Width = 100 46 end 47 item 48 Caption = 'Unmergeable tiles' 49 Width = 100 50 end 51 item 52 Caption = 'Duration' 53 Width = 100 38 54 end> 39 55 OwnerData = True -
trunk/Forms/FormScore.lrj
r108 r109 2 2 {"hash":5875333,"name":"tformscore.caption","sourcebytes":[83,99,111,114,101],"value":"Score"}, 3 3 {"hash":372789,"name":"tformscore.listview1.columns[0].caption","sourcebytes":[84,105,109,101],"value":"Time"}, 4 {"hash":5875333,"name":"tformscore.listview1.columns[1].caption","sourcebytes":[83,99,111,114,101],"value":"Score"}, 5 {"hash":5532867,"name":"tformscore.listview1.columns[2].caption","sourcebytes":[77,111,118,101,115],"value":"Moves"}, 6 {"hash":6048611,"name":"tformscore.listview1.columns[3].caption","sourcebytes":[85,110,100,111,115],"value":"Undos"}, 7 {"hash":140711557,"name":"tformscore.listview1.columns[4].caption","sourcebytes":[66,111,97,114,100,32,115,105,122,101],"value":"Board size"}, 4 {"hash":140711557,"name":"tformscore.listview1.columns[1].caption","sourcebytes":[66,111,97,114,100,32,115,105,122,101],"value":"Board size"}, 5 {"hash":5875333,"name":"tformscore.listview1.columns[2].caption","sourcebytes":[83,99,111,114,101],"value":"Score"}, 6 {"hash":250115045,"name":"tformscore.listview1.columns[3].caption","sourcebytes":[66,105,103,103,101,115,116,32,116,105,108,101],"value":"Biggest tile"}, 7 {"hash":5532867,"name":"tformscore.listview1.columns[4].caption","sourcebytes":[77,111,118,101,115],"value":"Moves"}, 8 {"hash":6048611,"name":"tformscore.listview1.columns[5].caption","sourcebytes":[85,110,100,111,115],"value":"Undos"}, 9 {"hash":116225219,"name":"tformscore.listview1.columns[6].caption","sourcebytes":[68,105,115,97,98,108,101,100,32,116,105,108,101,115],"value":"Disabled tiles"}, 10 {"hash":268299811,"name":"tformscore.listview1.columns[7].caption","sourcebytes":[85,110,109,101,114,103,101,97,98,108,101,32,116,105,108,101,115],"value":"Unmergeable tiles"}, 11 {"hash":210283758,"name":"tformscore.listview1.columns[8].caption","sourcebytes":[68,117,114,97,116,105,111,110],"value":"Duration"}, 8 12 {"hash":4863637,"name":"tformscore.buttonclose.caption","sourcebytes":[67,108,111,115,101],"value":"Close"}, 9 13 {"hash":4860802,"name":"tformscore.buttonclear.caption","sourcebytes":[67,108,101,97,114],"value":"Clear"} -
trunk/Forms/FormScore.pas
r108 r109 43 43 with FScores[Item.Index] do begin 44 44 Item.Caption := DateTimeToStr(StartTime); 45 Item.SubItems.Add(BoardSize); 45 46 Item.SubItems.Add(IntToStr(Score)); 47 Item.SubItems.Add(IntToStr(1 shl BiggestTile)); 46 48 Item.SubItems.Add(IntToStr(Moves)); 47 49 Item.SubItems.Add(IntToStr(UsedUndos)); 48 Item.SubItems.Add(BoardSize); 50 Item.SubItems.Add(IntToStr(DisabledTiles)); 51 Item.SubItems.Add(IntToStr(UnmergeableTiles)); 52 Item.SubItems.Add(TimeToStr(Duration)); 49 53 end; 50 54 end; -
trunk/Languages/Game2048.cs.po
r108 r109 323 323 #: tformscore.listview1.columns[1].caption 324 324 msgctxt "tformscore.listview1.columns[1].caption" 325 msgid "Board size" 326 msgstr "Velikost desky" 327 328 #: tformscore.listview1.columns[2].caption 329 msgctxt "tformscore.listview1.columns[2].caption" 325 330 msgid "Score" 326 331 msgstr "Skóre" 327 332 328 #: tformscore.listview1.columns[2].caption 333 #: tformscore.listview1.columns[3].caption 334 msgctxt "tformscore.listview1.columns[3].caption" 335 msgid "Biggest tile" 336 msgstr "Největší dlaždice" 337 338 #: tformscore.listview1.columns[4].caption 339 msgctxt "tformscore.listview1.columns[4].caption" 329 340 msgid "Moves" 330 msgstr "Pohyby" 331 332 #: tformscore.listview1.columns[3].caption 341 msgstr "Pohybů" 342 343 #: tformscore.listview1.columns[5].caption 344 msgctxt "tformscore.listview1.columns[5].caption" 333 345 msgid "Undos" 334 346 msgstr "Vrácení" 335 347 336 #: tformscore.listview1.columns[4].caption 337 msgid "Board size" 338 msgstr "Velikost desky" 348 #: tformscore.listview1.columns[6].caption 349 msgctxt "tformscore.listview1.columns[6].caption" 350 msgid "Disabled tiles" 351 msgstr "Blokované dlaždice" 352 353 #: tformscore.listview1.columns[7].caption 354 msgctxt "tformscore.listview1.columns[7].caption" 355 msgid "Unmergeable tiles" 356 msgstr "Neslučitelné dlaždice" 357 358 #: tformscore.listview1.columns[8].caption 359 msgctxt "tformscore.listview1.columns[8].caption" 360 msgid "Duration" 361 msgstr "Trvání" 339 362 340 363 #: tformsettings.buttoncancel.caption -
trunk/Score.pas
r108 r109 17 17 UsedUndos: Integer; 18 18 BoardSize: string; 19 DisabledTiles: Integer; 20 UnmergeableTiles: Integer; 21 BiggestTile: Integer; 19 22 procedure SaveToRegistry(Reg: TRegistryEx; RegContext: TRegistryContext); 20 23 procedure LoadFromRegistry(Reg: TRegistryEx; RegContext: TRegistryContext); … … 30 33 end; 31 34 35 32 36 implementation 33 37 … … 39 43 CurrentContext := RegContext; 40 44 WriteDateTime('StartTime', StartTime); 45 WriteDateTime('Duration', Duration); 41 46 WriteInteger('Score', Score); 42 47 WriteInteger('Moves', Moves); 43 48 WriteInteger('UsedUndos', UsedUndos); 44 49 WriteString('BoardSize', BoardSize); 50 WriteInteger('DisabledTiles', DisabledTiles); 51 WriteInteger('UnmergeableTiles', UnmergeableTiles); 52 WriteInteger('BiggestTile', BiggestTile); 45 53 end; 46 54 end; … … 52 60 CurrentContext := RegContext; 53 61 StartTime := ReadDateTimeWithDefault('StartTime', StartTime); 62 Duration := ReadDateTimeWithDefault('Duration', Duration); 54 63 Score := ReadIntegerWithDefault('Score', Score); 55 64 Moves := ReadIntegerWithDefault('Moves', Moves); 56 65 UsedUndos := ReadIntegerWithDefault('UsedUndos', UsedUndos); 57 66 BoardSize := ReadStringWithDefault('BoardSize', BoardSize); 67 DisabledTiles := ReadIntegerWithDefault('DisabledTiles', DisabledTiles); 68 UnmergeableTiles := ReadIntegerWithDefault('UnmergeableTiles', UnmergeableTiles); 69 BiggestTile := ReadIntegerWithDefault('BiggestTile', BiggestTile); 58 70 end; 59 71 end;
Note:
See TracChangeset
for help on using the changeset viewer.