商队测试
This commit is contained in:
parent
65524b7008
commit
2e0181cc92
@ -17,7 +17,7 @@ type ModuleRobot_Caravan struct {
|
|||||||
|
|
||||||
func (this *ModuleRobot_Caravan) Init() (err error) {
|
func (this *ModuleRobot_Caravan) Init() (err error) {
|
||||||
this.caravan = &pb.DBCaravan{}
|
this.caravan = &pb.DBCaravan{}
|
||||||
this.curCity = 101
|
this.curCity = 102
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,6 +49,9 @@ func (this *ModuleRobot_Caravan) DoPipeline(robot IRobot) (err error) {
|
|||||||
errdata *pb.ErrorData
|
errdata *pb.ErrorData
|
||||||
)
|
)
|
||||||
this.curCity += 1
|
this.curCity += 1
|
||||||
|
if this.curCity >= 113 {
|
||||||
|
this.curCity = 102
|
||||||
|
}
|
||||||
if resp, errdata = robot.SendMessage("caravan", "gotocity", &pb.CaravanGotoCityReq{
|
if resp, errdata = robot.SendMessage("caravan", "gotocity", &pb.CaravanGotoCityReq{
|
||||||
City: this.curCity,
|
City: this.curCity,
|
||||||
Ticket: 1,
|
Ticket: 1,
|
||||||
@ -87,10 +90,6 @@ func (this *ModuleRobot_Caravan) DoPipeline(robot IRobot) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.curCity += 1
|
|
||||||
if this.curCity >= 113 {
|
|
||||||
this.curCity = 101
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user