summaryrefslogtreecommitdiffstats
path: root/wat/db.go
diff options
context:
space:
mode:
Diffstat (limited to 'wat/db.go')
-rw-r--r--wat/db.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/wat/db.go b/wat/db.go
index 5f80af4..fb677d8 100644
--- a/wat/db.go
+++ b/wat/db.go
@@ -85,10 +85,11 @@ func (w *WatDb) Update(upd ...interface{}) {
}
const (
- Action_Mine ActionType = 1
- Action_Rest ActionType = 2
- Action_Lift ActionType = 3
- Action_Riot ActionType = 4
+ Action_Mine ActionType = 1
+ Action_Rest ActionType = 2
+ Action_Lift ActionType = 3
+ Action_Riot ActionType = 4
+ Action_Bankrupt ActionType = 5
)
type ActionType int
@@ -109,6 +110,12 @@ func (w *WatDb) Act(player *Player, actionType ActionType) {
}
}
+func (w *WatDb) Strongest() []Player {
+ var user = make([]Player, 10)
+ w.db.Limit(10).Order("anarchy desc").Find(&user)
+ return user
+}
+
func (w *WatDb) TopLost() []Player {
var user = make([]Player, 10)
w.db.Limit(10).Order("coins_lost desc").Find(&user)