SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InteractWithEntity.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 #include "Logging.h"
11 
12 #include "MapEvents.h"
13 #include "MapLink.h"
14 
15 class InteractWithEntity final : public MapLinkEvent
16 {
17 public:
18  uint32_t m_srv_idx = 0;
19  InteractWithEntity() : MapLinkEvent(MapEventTypes::evInteractWithEntity) {}
20  void serializeto(BitStream &bs) const override
21  {
22  bs.StorePackedBits(1, type() - MapEventTypes::evConsoleCommand); // 7
23  bs.StorePackedBits(12, m_srv_idx);
24  }
26  {
27  m_srv_idx = src.GetPackedBits(12);
28  }
29 };
Definition: InteractWithEntity.h:15
uint32_t type() const
Definition: SEGSEvent.h:63
int32_t GetPackedBits(uint32_t minbits)
Definition: BitStream.cpp:285
Definition: BitStream.h:30
uint32_t m_srv_idx
Definition: InteractWithEntity.h:18
void StorePackedBits(uint32_t nBits, uint32_t dataBits)
Definition: BitStream.cpp:161
void serializefrom(BitStream &src)
Definition: InteractWithEntity.h:25
void serializeto(BitStream &bs) const override
Definition: InteractWithEntity.h:20
InteractWithEntity()
Definition: InteractWithEntity.h:19
Definition: MapEventTypes.h:11
EventProcessor * src() const
Definition: SEGSEvent.h:62