Esempio n. 1
0
func dbGetMaxGame(t *llrb.LLRB) int {

	max := t.Max()

	if max == nil {

		return 0
	}

	return max.(*game).id
}
Esempio n. 2
0
func IterateOne(tree *llrb.LLRB, last Int64) Int64 {
	var next Int64
	tree.AscendGreaterOrEqual(last, func(i llrb.Item) bool {
		if i.(Int64) == last {
			return true
		} else {
			next = i.(Int64)
			return false
		}
	})
	return next
}
Esempio n. 3
0
func dbLookupGame(t *llrb.LLRB, gameid int) *game {

	g := &game{id: gameid}
	result := t.Get(g)
	if result != nil {

		g = result.(*game)
		return g
	}

	return nil
}