本文整理汇总了Golang中Network.QTPacket.GetReadPos方法的典型用法代码示例。如果您正苦于以下问题:Golang QTPacket.GetReadPos方法的具体用法?Golang QTPacket.GetReadPos怎么用?Golang QTPacket.GetReadPos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network.QTPacket
的用法示例。
在下文中一共展示了QTPacket.GetReadPos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: receivedSendOut
// -------------------- Received Messages ----------------------
func (b *Battle) receivedSendOut(_packet *pnet.QTPacket, _player int) {
isSilent := _packet.ReadBool()
fromSpot := int(_packet.ReadUint8())
if _player == b.me {
// tmp := b.myTeam.Pokes[0]
b.myTeam.Pokes[0], b.myTeam.Pokes[fromSpot] = b.myTeam.Pokes[fromSpot], b.myTeam.Pokes[0]
for i := 0; i < 4; i++ {
b.displayedMoves[i] = NewBattleMoveFromBattleMove(b.myTeam.Pokes[0].Moves[i])
}
}
b.pokes[_player][0], b.pokes[_player][fromSpot] = b.pokes[_player][fromSpot], b.pokes[_player][0]
if _packet.GetMsgSize() > _packet.GetReadPos() { // this is the first time you've seen it
b.pokes[_player][0] = NewShallowBattlePokeFromPacket(_packet, (_player == b.me))
}
// TOOD: Send updatePokes to PU client
// TODO: Send updatePokeballs to PU client
if !isSilent {
b.WriteToHist(fmt.Sprintf("%s sent out %s!\n", b.players[_player].Nick, b.currentPoke(_player).RNick))
}
}