|
@@ -1,6 +1,7 @@
|
|
|
package ludo
|
|
|
|
|
|
import (
|
|
|
+ "fmt"
|
|
|
"server/msg"
|
|
|
"strings"
|
|
|
|
|
@@ -57,6 +58,7 @@ func (room_info *RoomInfoWrapper) getColors() []*msg.ColorData {
|
|
|
// 开始下个玩家的回合
|
|
|
func (room_info *RoomInfoWrapper) setNextPlayerRound() {
|
|
|
room_info.CurRoundColor = room_info.findNextColor()
|
|
|
+ fmt.Printf("setNextPlayerRound = %d\n", room_info.CurRoundColor)
|
|
|
if room_info.CurRoundColor == msg.RoleType_ROLE_TYPE_UNKNOWN {
|
|
|
log.Error("setNextPlayerRound error")
|
|
|
}
|
|
@@ -100,7 +102,7 @@ func (room_info *RoomInfoWrapper) containsRobot(color msg.RoleType) bool {
|
|
|
func (room_info *RoomInfoWrapper) getRoleNotAtHomeByColor(color msg.RoleType) []*msg.RoleData {
|
|
|
temp := make([]*msg.RoleData, 0, 4)
|
|
|
roles := room_info.Roles
|
|
|
- for i := 0; i < len(roles); i++ {
|
|
|
+ for i := range roles {
|
|
|
element := roles[i]
|
|
|
if element.MColor == color && element.Step != 0 {
|
|
|
temp = append(temp, element)
|