锦标赛优化
This commit is contained in:
parent
c18a8cc3ce
commit
c28bf27f8f
@ -28,14 +28,14 @@ func GetGroupId(N int) int {
|
|||||||
data, err := gamedata.GetData(CFG_CHAMPSHIP_GROUP)
|
data, err := gamedata.GetData(CFG_CHAMPSHIP_GROUP)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debug("GetGroupId err:%v, N=%d", err, N)
|
log.Debug("GetGroupId err:%v, N=%d", err, N)
|
||||||
return 0
|
return 1
|
||||||
}
|
}
|
||||||
for k, v := range data {
|
for k, v := range data {
|
||||||
if N >= gamedata.GetIntValue(v, "Min") && N <= gamedata.GetIntValue(v, "Max") {
|
if N >= gamedata.GetIntValue(v, "Min") && N <= gamedata.GetIntValue(v, "Max") {
|
||||||
return GoUtil.Int(k)
|
return GoUtil.Int(k)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0
|
return 11
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetChessScore(ChessLv int) int {
|
func GetChessScore(ChessLv int) int {
|
||||||
|
|||||||
@ -99,6 +99,12 @@ func TestRandInt(t *testing.T) {
|
|||||||
p1.DeleteHighOrder()
|
p1.DeleteHighOrder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestII(t *testing.T) {
|
||||||
|
for i := 10; i >= 0; i-- {
|
||||||
|
fmt.Printf("i: %d\n", i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestLevelUp(t *testing.T) {
|
func TestLevelUp(t *testing.T) {
|
||||||
p1 := new(game.Player)
|
p1 := new(game.Player)
|
||||||
p1.InitPlayer("3625212")
|
p1.InitPlayer("3625212")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user