<commit_before>/* 
 * File:   cGameEntity.h
 * Author: <NAME>
 *
 * Created on January 24, 2012, 8:25 PM
 */

#ifndef GAMEENTITY_H
#define	GAMEENTITY_H

#include <iostream>
#include "cMapper.h"

class cGameEntity {
public:
    /// Set derived class entity position in 2D space
    void setPosition(int x, int y) { x_coord_ = x; y_coord_ = y; }

    /// Get derived class entity position in 2D space
    int getXPosition() { return x_coord_; }

    /// Get derived class entity position in 2D space
    int getYPosition() { return y_coord_; }

    /// Return cMapper pointer to derived class.
    cMapper* getMapper() { return mapper_; }


    /// Virtual update method. Define in base class.
    virtual void update(float) = 0;

    /// Virtual method to set damage output
    virtual void setDamage(const unsigned int) {}

    /// Virtual method to set damage output RANGE
    virtual void setRange(const unsigned int) {}

    /// Virtual method to set target for attacking entity
    virtual void setTarget(cGameEntity*) {}

    /// Virtual method to set name of entity. Define in base class.
    virtual std::string name() = 0;

    /// Virtual destructor for proper derived/base chain dismantling.
    virtual ~cGameEntity() { std::cout << "cGameEntity destruction!" << "\n"; }

protected:
    /// Entity X-coord in 2D space.
    int x_coord_;

    /// Entity Y-coord in 2D space.
    int y_coord_;

    /// Entity hitpoints. Entity removal when hitpoints <= 0
    int hitpoints_;

private:
    /// cMapper pointer. Used in derived classes to inform cMapper of their destruction.
    static cMapper *mapper_;
};

#endif	/* GAMEENTITY_H */
<commit_msg>cMapper getter from public to protected because only derived classes need it.<commit_after>/* 
 * File:   cGameEntity.h
 * Author: <NAME>
 *
 * Created on January 24, 2012, 8:25 PM
 */

#ifndef GAMEENTITY_H
#define	GAMEENTITY_H

#include <iostream>
#include "cMapper.h"

class cGameEntity {
public:
    /// Set derived class entity position in 2D space
    void setPosition(int x, int y) { x_coord_ = x; y_coord_ = y; }

    /// Get derived class entity position in 2D space
    int getXPosition() { return x_coord_; }

    /// Get derived class entity position in 2D space
    int getYPosition() { return y_coord_; }

    /// Virtual update method. Define in base class.
    virtual void update(float) = 0;

    /// Virtual method to set damage output
    virtual void setDamage(const unsigned int) {}

    /// Virtual method to set damage output RANGE
    virtual void setRange(const unsigned int) {}

    /// Virtual method to set target for attacking entity
    virtual void setTarget(cGameEntity*) {}

    /// Virtual method to set name of entity. Define in base class.
    virtual std::string name() = 0;

    /// Virtual destructor for proper derived/base chain dismantling.
    virtual ~cGameEntity() { std::cout << "cGameEntity destruction!" << "\n"; }

protected:
    /// Return cMapper pointer to derived class.
    cMapper* getMapper() { return mapper_; }

    /// Entity X-coord in 2D space.
    int x_coord_;

    /// Entity Y-coord in 2D space.
    int y_coord_;

    /// Entity hitpoints. Entity removal when hitpoints <= 0
    int hitpoints_;

private:
    /// cMapper pointer. Used in derived classes to inform cMapper of their destruction.
    static cMapper *mapper_;
};

#endif	/* GAMEENTITY_H */

{'fraction_non_alphanumeric': 0.09991105840498073, 'fraction_numerical': 0.010080047435517344, 'mean_word_length': 2.8428246013667424, 'pattern_counts': {'":': 0, '<': 17, '<?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': '5478135', 'n_tokens_mistral': 1025, 'n_tokens_neox': 961, 'n_words': 389}