SEGS  0.6.1-develop [39915b3b]
Super Entity Game Server
FloatingDamage.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2019 SEGS Team (see AUTHORS.md)
5  * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details.
6  */
7 
8 #pragma once
9 #include "GameCommand.h"
10 #include "MapEventTypes.h"
11 #include "BitStream.h"
12 
13 #include <QtCore/QString>
14 
15 namespace SEGSEvents
16 {
17 
18 // [[ev_def:type]]
19 class FloatingDamage final : public GameCommandEvent
20 {
21 public:
22  // [[ev_def:field]]
24  // [[ev_def:field]]
26  // [[ev_def:field]]
27  int m_amount; // should be float?
28  explicit FloatingDamage() : GameCommandEvent(evFloatingDamage) {}
29  FloatingDamage(int source,int target,int amount) : GameCommandEvent(evFloatingDamage),
30  m_damage_source(source),
31  m_damage_target(target),
32  m_amount(amount)
33  {
34  }
35  void serializeto(BitStream &bs) const override
36  {
37  bs.StorePackedBits(1,type()-evFirstServerToClient); // packet 21
38 
39  bs.StorePackedBits(1,m_damage_source);
40  bs.StorePackedBits(1,m_damage_target);
41  bs.StorePackedBits(1,m_amount);
42  }
44 };
45 
46 } //end of SEGSEvents namespace
Definition: GameCommand.h:16
Definition: FloatingDamage.h:19
FloatingDamage()
Definition: FloatingDamage.h:28
FloatingDamage(int source, int target, int amount)
Definition: FloatingDamage.h:29
void serializeto(BitStream &bs) const override
Definition: FloatingDamage.h:35
Definition: BitStream.h:34
Definition: LinkLevelEvent.h:13
int m_damage_source
Definition: FloatingDamage.h:23
void StorePackedBits(uint32_t nBits, uint32_t dataBits)
Definition: BitStream.cpp:161
int m_amount
Definition: FloatingDamage.h:27
int m_damage_target
Definition: FloatingDamage.h:25
uint32_t type() const
Definition: SEGSEvent.h:66
#define EVENT_IMPL(name)
Definition: SEGSEvent.h:77