airobot/busi/linestory.go
2022-12-26 14:10:19 +08:00

41 lines
763 B
Go

package busi
import (
"legu.airobot/lib"
"legu.airobot/pb"
)
var _ lib.IScene = (*LinestoryScene)(nil)
type LinestoryScene struct {
lib.Action
}
func (ls *LinestoryScene) Info() lib.SceneInfo {
return lib.SceneInfo{
Name: "支线剧情",
}
}
func (ls *LinestoryScene) Run(robot lib.IRobot) error {
req := &pb.LinestoryChapterReq{}
rsp := &pb.LinestoryChapterResp{}
if code := robot.SendMsg("linestory", "chapter", req, rsp); code != pb.ErrorCode_Success {
return nil
}
for k, _ := range rsp.TaskChapter {
req := &pb.LinestoryMaintaskReq{
ChapterId: k,
}
rsp := &pb.LinestoryMaintaskResp{}
if code := robot.SendMsg("linestory", "maintask", req, rsp); code != pb.ErrorCode_Success {
return nil
}
//receive
}
return nil
}