<commit_before>#pragma once

#include <string>

#include "damage.h"
#include "Coordinate.h"

#define o_charges	o_arm

/* flags for objects */
#define ISCURSED 000001		/* object is cursed */
#define ISKNOW	0000002		/* player knows details about the object */
#define ISMISL	0000004		/* object is a missile type */
#define ISMANY	0000010		/* object comes in groups */
#ifndef ISFOUND
#define ISFOUND 0000020		/*...is used for both objects and creatures */
#endif /* ISFOUND */
#define ISPROT	0000040		/* armor is permanently protected */


class Item {
public:
  Item() = default;
  Item(Item const&) = default;

  virtual ~Item();

  Item& operator=(Item const&) = default;
  Item& operator=(Item&&) = default;
  virtual Item* clone() const = 0;

  /* Setters */
  void set_position(Coordinate const&);
  void set_x(int);
  void set_y(int);
  void set_nickname(std::string const&);

  /* Getters */
  virtual std::string   get_description() const = 0;
  virtual bool          is_magic() const = 0;

  Coordinate const&     get_position() const;
  int                   get_x() const;
  int                   get_y() const;
  std::string const&    get_nickname() const;
  int                   get_type() const;

  int           o_type;                /* What kind of object it is */
  int           o_launch;              /* What you need to launch it */
  int           o_count;               /* count for plural objects */
  int           o_which;               /* Which object of a type it is */
  int           o_hplus;               /* Plusses to hit */
  int           o_dplus;               /* Plusses to damage */
  int           o_arm;                 /* Armor protection */
  int           o_flags;               /* information about objects */
  char          o_packch;              /* What character it is in the pack */
  damage        o_damage;              /* Damage if used like sword */
  damage        o_hurldmg;             /* Damage if thrown */

private:
  Coordinate    position_on_screen;
  std::string   nickname;
};
<commit_msg>protect Item constructor<commit_after>#pragma once

#include <string>

#include "damage.h"
#include "Coordinate.h"

#define o_charges	o_arm

// flags for objects
#define ISCURSED 000001		/* object is cursed */
#define ISKNOW	0000002		/* player knows details about the object */
#define ISMISL	0000004		/* object is a missile type */
#define ISMANY	0000010		/* object comes in groups */
#ifndef ISFOUND
#define ISFOUND 0000020		/*...is used for both objects and creatures */
#endif /* ISFOUND */
#define ISPROT	0000040		/* armor is permanently protected */


class Item {
public:
  Item(Item const&) = default;

  virtual ~Item();

  Item& operator=(Item const&) = default;
  Item& operator=(Item&&) = default;
  virtual Item* clone() const = 0;

  // Setters
  void set_position(Coordinate const&);
  void set_x(int);
  void set_y(int);
  void set_nickname(std::string const&);

  // Getters (virtual)
  virtual std::string   get_description() const = 0;
  virtual bool          is_magic() const = 0;

  // Getters
  Coordinate const&     get_position() const;
  int                   get_x() const;
  int                   get_y() const;
  std::string const&    get_nickname() const;
  int                   get_type() const;

  int           o_type;                // What kind of object it is
  int           o_launch;              // What you need to launch it
  int           o_count;               // count for plural objects
  int           o_which;               // Which object of a type it is
  int           o_hplus;               // Plusses to hit
  int           o_dplus;               // Plusses to damage
  int           o_arm;                 // Armor protection
  int           o_flags;               // information about objects
  char          o_packch;              // What character it is in the pack
  damage        o_damage;              // Damage if used like sword
  damage        o_hurldmg;             // Damage if thrown

protected:
  Item() = default;

private:
  Coordinate    position_on_screen;
  std::string   nickname;
};

{'fraction_non_alphanumeric': 0.09615384615384616, 'fraction_numerical': 0.021421616358325218, 'mean_word_length': 1.8814866760168303, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6360291', 'n_tokens_mistral': 1300, 'n_tokens_neox': 1198, 'n_words': 409}