28 lines
1.0 KiB
Go
28 lines
1.0 KiB
Go
package pvp
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/sys/timewheel"
|
|
"go_dreamfactory/pb"
|
|
"sync"
|
|
)
|
|
|
|
///Pvp 战斗对象
|
|
type BattleItem struct {
|
|
Id string //战斗id
|
|
Ptype pb.PvpType //pvp类型
|
|
State pb.PvpState //战斗状态
|
|
Red *pb.PvpUserInfo //红方id
|
|
RedSession comm.IUserSession //红方连接对象
|
|
Redformation *pb.BattleFormation //红方阵型列表
|
|
RedOffline bool //红方离线
|
|
Blue *pb.PvpUserInfo //蓝方id
|
|
BlueSession comm.IUserSession //蓝方连接对象
|
|
Blueformation *pb.BattleFormation //蓝方阵型列表
|
|
BlueOffline bool //蓝方离线
|
|
readytimer *timewheel.Task //准备倒计时定时器
|
|
operatetimer *timewheel.Task //操作倒计时定时器
|
|
curroperate *pb.ComWaitInputSkill //当前操作玩家 1 红方 2 蓝方
|
|
lock sync.Mutex //战斗锁 防止计时器和消息同时操作对象
|
|
}
|