<commit_before>#ifndef SRC_COMMON_NET_DESERIALIZER_H_
#define SRC_COMMON_NET_DESERIALIZER_H_

#include <QDataStream>
#include <memory>

#include "Event.h"
#include "EventId.h"
#include "BombEvent.h"
#include "MoveEvent.h"
#include "PlayerLeftEvent.h"
#include "PlayerJoinedEvent.h"
#include "SetAdminEvent.h"
#include "SettingsEvent.h"

#include "src/common/entity/EntityId.h"
#include "src/common/entity/Block.h"
#include "src/common/entity/Bomb.h"
#include "src/common/entity/Bonus.h"
#include "src/common/entity/Character.h"
#include "src/common/entity/Fire.h"
#include "src/common/entity/Wall.h"

using namespace common::entity;

namespace common {
namespace net {

/**
 * For internal use by the Deserializer class.
 */
struct BaseEventData {
  quint32 id;
  quint32 timestamp;
};

/**
 * Internal use by the Deserializer class
 */
struct BaseEntityData {
  quint32 id;
  quint32 temp_id;
  QPoint position;
};

/**
 * Provides static methods to deserialize events and entities. Part of the common library
 * to make testing serialization and deserialization easier to test (as
 * everything is in one place).
 */
class Deserializer {

  public:
    /**
     * @return the event type of the next event serialized on the stream.
     *         Allows to choose which deserialization method to call next.<commit_msg>Fix entity temp ID being 32 bits on the server (but only 16 on the client).<commit_after>#ifndef SRC_COMMON_NET_DESERIALIZER_H_
#define SRC_COMMON_NET_DESERIALIZER_H_

#include <QDataStream>
#include <memory>

#include "Event.h"
#include "EventId.h"
#include "BombEvent.h"
#include "MoveEvent.h"
#include "PlayerLeftEvent.h"
#include "PlayerJoinedEvent.h"
#include "SetAdminEvent.h"
#include "SettingsEvent.h"

#include "src/common/entity/EntityId.h"
#include "src/common/entity/Block.h"
#include "src/common/entity/Bomb.h"
#include "src/common/entity/Bonus.h"
#include "src/common/entity/Character.h"
#include "src/common/entity/Fire.h"
#include "src/common/entity/Wall.h"

using namespace common::entity;

namespace common {
namespace net {

/**
 * For internal use by the Deserializer class.
 */
struct BaseEventData {
  quint32 id;
  quint32 timestamp;
};

/**
 * Internal use by the Deserializer class
 */
struct BaseEntityData {
  quint32 id;
  quint16 temp_id;
  QPoint position;
};

/**
 * Provides static methods to deserialize events and entities. Part of the common library
 * to make testing serialization and deserialization easier to test (as
 * everything is in one place).
 */
class Deserializer {

  public:
    /**
     * @return the event type of the next event serialized on the stream.
     *         Allows to choose which deserialization method to call next.
{'fraction_non_alphanumeric': 0.10703703703703704, 'fraction_numerical': 0.007407407407407408, 'mean_word_length': 4.369781312127237, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1757607', 'n_tokens_mistral': 899, 'n_tokens_neox': 880, 'n_words': 262}