Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: moul <[email protected]>
  • Loading branch information
moul committed Sep 26, 2023
1 parent 965f2b6 commit b169c4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions realm/chess.gno
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ func MakeMove(gameID, from, to string, promote Piece) string {

caller := std.GetOrigCaller()

stats := getPlayerStats(caller)
stats.Moves++
// stats := getPlayerStats(caller)
// stats.Moves++

if (isBlack && g.Black != caller) ||
(!isBlack && g.White != caller) {
Expand Down
10 changes: 5 additions & 5 deletions realm/stats.gno
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import (
)

type playerStats struct {
Addr std.Address // Not stored when in avl.Tree, but lasily filled when returning a single or collection of player stats for other contracts.
Addr std.Address // Not stored when in avl.Tree, but lazily filled for public-facing helpers returning playerStats.
Moves uint
StartedGames uint
WonGames uint
LostGames uint
TimedoutGames uint
ResignedGames uint
DrawnGames uint
SeriousGames uint // finished, or resigned/drawn after 20 full moves (40 turns)
SeriousGames uint // finished, or resigned/drawn after 20 full moves (40 turns), used for the raffle.
// later we can add achievements:
// SuperFastAchievement // if a game is finished in less than N seconds.
// OnlyPawnsAchievement // winning with only pawns, etc.
Expand All @@ -39,9 +39,9 @@ func AllPlayerStats() []playerStats {
ret := []playerStats{}

allPlayerStats.Iterate("", "", func(addrString string, v interface{}) bool {
stats := *(v.(*playerStats))
stats.Addr = std.Address(addrString)
ret = append(ret, stats)
// stats := *(v.(*playerStats))
// stats.Addr = std.Address(addrString)
// ret = append(ret, stats)
return false
})

Expand Down

0 comments on commit b169c4c

Please sign in to comment.