本文整理汇总了Golang中nonamelib/network.IPacket.AddUint32方法的典型用法代码示例。如果您正苦于以下问题:Golang IPacket.AddUint32方法的具体用法?Golang IPacket.AddUint32怎么用?Golang IPacket.AddUint32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nonamelib/network.IPacket
的用法示例。
在下文中一共展示了IPacket.AddUint32方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: writeChangePP
func (m *BattleEventMessage) writeChangePP(_packet pnet.IPacket) pnet.IPacket {
_packet.AddUint32(m.PokemonId)
_packet.AddUint32(m.MoveSlotId)
_packet.AddUint8(m.NewPP)
return _packet
}
示例2: WritePacket
// WritePacket write the needed object data to a Packet and returns it
func (m *BattleEventMessage) WritePacket() pnet.IPacket {
var packet pnet.IPacket = pnet.NewPacketExt(m.GetHeader())
packet.AddUint32(m.EventType)
switch m.EventType {
case pnet.BATTLEEVENT_TEXT:
packet = m.writeMessage(packet)
case pnet.BATTLEEVENT_CHANGEPP:
packet = m.writeChangePP(packet)
case pnet.BATTLEEVENT_CHANGEHP:
packet = m.writeChangeHP(packet)
}
return packet
}
示例3: writeChangeHP
func (m *BattleEventMessage) writeChangeHP(_packet pnet.IPacket) pnet.IPacket {
_packet.AddUint32(m.PokemonId)
_packet.AddUint16(m.NewHP)
return _packet
}