本文整理汇总了Golang中packet.Packet.ReadFloat32方法的典型用法代码示例。如果您正苦于以下问题:Golang Packet.ReadFloat32方法的具体用法?Golang Packet.ReadFloat32怎么用?Golang Packet.ReadFloat32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类packet.Packet
的用法示例。
在下文中一共展示了Packet.ReadFloat32方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: MsgTestXXDecode
func MsgTestXXDecode(pack *packet.Packet) *MsgTestXX {
msgTestXX := &MsgTestXX{}
msgTestXX.idU8 = pack.ReadUint8()
idF32Count := pack.ReadUint16()
for ; idF32Count > 0; idF32Count-- {
msgTestXX.idF32 = append(msgTestXX.idF32, pack.ReadFloat32())
}
msgTestXX.idOpU8Flag = pack.ReadUint8()
if msgTestXX.idOpU8Flag == 1 {
msgTestXX.idOpU8 = pack.ReadUint8()
}
return msgTestXX
}
示例2: AckTestSendOkDecode
func AckTestSendOkDecode(pack *packet.Packet) *AckTestSendOk {
ackTestSendOk := &AckTestSendOk{}
ackTestSendOk.idU8 = pack.ReadUint8()
ackTestSendOk.roleBase = MsgRoleBaseDecode(pack)
idF32Count := pack.ReadUint16()
for ; idF32Count > 0; idF32Count-- {
ackTestSendOk.idF32 = append(ackTestSendOk.idF32, pack.ReadFloat32())
}
ackTestSendOk.idOpU8Flag = pack.ReadUint8()
if ackTestSendOk.idOpU8Flag == 1 {
ackTestSendOk.idOpU8 = pack.ReadUint8()
}
ackTestSendOk.opRoleBaseFlag = pack.ReadUint8()
if ackTestSendOk.opRoleBaseFlag == 1 {
ackTestSendOk.opRoleBase = MsgRoleBaseDecode(pack)
}
return ackTestSendOk
}
示例3: MsgTestSendDecode
func MsgTestSendDecode(pack *packet.Packet) *MsgTestSend {
msgTestSend := &MsgTestSend{}
msgTestSend.idU8 = pack.ReadUint8()
msgTestSend.roleBase = MsgRoleBaseDecode(pack)
idF32Count := pack.ReadUint16()
for ; idF32Count > 0; idF32Count-- {
msgTestSend.idF32 = append(msgTestSend.idF32, pack.ReadFloat32())
}
msgTestSend.idOpU8Flag = pack.ReadUint8()
if msgTestSend.idOpU8Flag == 1 {
msgTestSend.idOpU8 = pack.ReadUint8()
}
msgTestSend.opRoleBaseFlag = pack.ReadUint8()
if msgTestSend.opRoleBaseFlag == 1 {
msgTestSend.opRoleBase = MsgRoleBaseDecode(pack)
}
return msgTestSend
}
示例4: ReqTestSendDecode
func ReqTestSendDecode(pack *packet.Packet) *ReqTestSend {
reqTestSend := &ReqTestSend{}
reqTestSend.idU8 = pack.ReadUint8()
reqTestSend.roleBase = MsgRoleBaseDecode(pack)
idF32Count := pack.ReadUint16()
for ; idF32Count > 0; idF32Count-- {
reqTestSend.idF32 = append(reqTestSend.idF32, pack.ReadFloat32())
}
reqTestSend.idOpU8Flag = pack.ReadUint8()
if reqTestSend.idOpU8Flag == 1 {
reqTestSend.idOpU8 = pack.ReadUint8()
}
reqTestSend.opRoleBaseFlag = pack.ReadUint8()
if reqTestSend.opRoleBaseFlag == 1 {
reqTestSend.opRoleBase = MsgRoleBaseDecode(pack)
}
return reqTestSend
}