func (m *BattleEventMessage) writeChangePP(_packet pnet.IPacket) pnet.IPacket { _packet.AddUint32(m.PokemonId) _packet.AddUint32(m.MoveSlotId) _packet.AddUint8(m.NewPP) return _packet }
// 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 }
func (m *BattleEventMessage) writeChangeHP(_packet pnet.IPacket) pnet.IPacket { _packet.AddUint32(m.PokemonId) _packet.AddUint16(m.NewHP) return _packet }