SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #pragma once
9 #include "GameCommandList.h"
10 
11 #include "MapEvents.h"
12 #include "MapLink.h"
13 
14 #include <QtCore/QString>
15 
16 class FloatingDamage final : public GameCommand
17 {
18 public:
21  int damage_amount; // should be float?
22  FloatingDamage(int source,int target,int amount) : GameCommand(MapEventTypes::evFloatingDamage),
23  whos_fault_was_it(source),
24  who_was_damaged(target),
25  damage_amount(amount)
26  {
27  }
28  void serializeto(BitStream &bs) const override {
29  bs.StorePackedBits(1,type()-MapEventTypes::evFirstServerToClient);
30 
34  }
35  void serializefrom(BitStream &src);
36 };
int whos_fault_was_it
Definition: FloatingDamage.h:19
void serializefrom(BitStream &src)
Definition: BitStream.h:30
void StorePackedBits(uint32_t nBits, uint32_t dataBits)
Definition: BitStream.cpp:161
int who_was_damaged
Definition: FloatingDamage.h:20
void serializeto(BitStream &bs) const override
Definition: FloatingDamage.h:28
uint32_t type() const
Definition: GameCommandList.h:21
Definition: GameCommandList.h:15
Definition: FloatingDamage.h:16
FloatingDamage(int source, int target, int amount)
Definition: FloatingDamage.h:22
int damage_amount
Definition: FloatingDamage.h:21
Definition: MapEventTypes.h:11