GameServer
PacketDamage.h
[詳解]
1 
7 #ifndef __PACKETDAMAGE_H__
8 #define __PACKETDAMAGE_H__
9 
10 #include "PacketBase.h"
12 #include "PacketID.h"
13 
14 
18 class PacketDamage : public PacketBase
19 {
20 
21 public:
22 
28  virtual u8 GetPacketID() const { return PacketID::Damage; }
29 
30 
31 
40 
41 
46  {
47  }
48 
52  PacketDamage(u8 InTargetType, u32 InTargetUuid, s32 InDamageValue, s32 InResultHp)
53  {
54  TargetType = InTargetType;
55  TargetUuid = InTargetUuid;
56  DamageValue = InDamageValue;
57  ResultHp = InResultHp;
58 
59  }
60 
61 
69  {
70  pStream->Serialize(&TargetType);
71  pStream->Serialize(&TargetUuid);
72  pStream->Serialize(&DamageValue);
73  pStream->Serialize(&ResultHp);
74 
75  return true;
76  }
77 };
78 
79 #endif // #ifndef __PACKETDAMAGE_H__
unsigned char u8
Definition: TypeDefs.h:6
u32 TargetUuid
ターゲットのUUID
Definition: PacketDamage.h:35
u8 TargetType
ターゲットタイプ
Definition: PacketDamage.h:33
PacketDamage(u8 InTargetType, u32 InTargetUuid, s32 InDamageValue, s32 InResultHp)
コンストラクタ
Definition: PacketDamage.h:52
ダメージパケット
Definition: PacketID.h:35
virtual bool Serialize(s32 *pValue)=0
virtual u8 GetPacketID() const
パケットID取得.
Definition: PacketDamage.h:28
int s32
Definition: TypeDefs.h:9
unsigned int u32
Definition: TypeDefs.h:10
PacketDamage()
コンストラクタ
Definition: PacketDamage.h:45
ダメージパケット
Definition: PacketDamage.h:18
Definition: PacketBase.h:9
s32 ResultHp
ダメージ後のHP
Definition: PacketDamage.h:39
s32 DamageValue
ダメージ量
Definition: PacketDamage.h:37
Definition: MemoryStreamInterface.h:8
bool Serialize(MemoryStreamInterface *pStream)
シリアライズ
Definition: PacketDamage.h:68