<commit_before>//  illarionserver - server for the game Illarion
//  Copyright 2011 Illarion e.V.
//
//  This file is part of illarionserver.
//
//  illarionserver is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Affero General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  illarionserver is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Affero General Public License for more details.
//
//  You should have received a copy of the GNU Affero General Public License
//  along with illarionserver.  If not, see <http://www.gnu.org/licenses/>.


#ifndef NEWCLIENTVIEW_HPP_
#define NEWCLIENTVIEW_HPP_

#define MAP_DIMENSION 17 // map extends into all 4 directions for this number of tiles
#define MAP_DOWN_EXTRA 3 // extra downwards extension

#include "globals.hpp"
#include "WorldMap.hpp"

// forward declarations
class Field;

/**
* class which holds isometric view specific data
*/
class NewClientView {

public:

    /**
    * in which direction is the stripe
    */
    enum stripedirection {
        dir_right,
        dir_down
    };

    /**
    * defines one mapstripe
    */
    typedef Field *MAPSTRIPE[ 100 /*MAP_DIMENSION + 1 + MAP_DOWN_EXTRA + 6*/ ];

    /**
    * stores the pointers to the fields inside a specific mapstripe
    */
    MAPSTRIPE mapStripe;

    /**
    * returns the initial position of this stripe
    * @return the starting position of the stripe
    */
    position getViewPosition() {
        return viewPosition;
    }

    /**
    * returns if the stripe exists
    * @return true if the stripe exists otherwise false
    */
    bool getExists() {
        return exists;
    }

    /**
    * returns the number of tiles in the view
    * @return the number of maximal tiles in the view
    */
    uint8_t getMaxTiles() {
        return maxtiles;
    }

    /**
    * reduces the tiles which should be sended (for smaller areas )
    * @param number the number which should be reduced
    */
    inline void removeLastTiles(uint8_t number) {
        number -= (MAP_DIMENSION + 2 - maxtiles) < number ? (MAP_DIMENSION + 2 - maxtiles) : number;

        if (number > 0) {
            if (maxtiles <= number) {
                maxtiles = 0;
                exists = false;
            } else {
                maxtiles -= number;
            }
        }
    }

    /**
    * the stripedirection, in which direction the mapstripe shows
    * @return the current direction of the mapstripe
    */
    stripedirection getStripeDirection() {
        return stripedir;
    }

    /**
    * constructor
    */
    NewClientView();

    /**
    * destructor
    */
    ~NewClientView();

    /**<commit_msg>Remove unused member function<commit_after>//  illarionserver - server for the game Illarion
//  Copyright 2011 Illarion e.V.
//
//  This file is part of illarionserver.
//
//  illarionserver is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Affero General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  illarionserver is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Affero General Public License for more details.
//
//  You should have received a copy of the GNU Affero General Public License
//  along with illarionserver.  If not, see <http://www.gnu.org/licenses/>.


#ifndef NEWCLIENTVIEW_HPP_
#define NEWCLIENTVIEW_HPP_

#define MAP_DIMENSION 17 // map extends into all 4 directions for this number of tiles
#define MAP_DOWN_EXTRA 3 // extra downwards extension

#include "globals.hpp"
#include "WorldMap.hpp"

// forward declarations
class Field;

/**
* class which holds isometric view specific data
*/
class NewClientView {

public:

    /**
    * in which direction is the stripe
    */
    enum stripedirection {
        dir_right,
        dir_down
    };

    /**
    * defines one mapstripe
    */
    typedef Field *MAPSTRIPE[ 100 /*MAP_DIMENSION + 1 + MAP_DOWN_EXTRA + 6*/ ];

    /**
    * stores the pointers to the fields inside a specific mapstripe
    */
    MAPSTRIPE mapStripe;

    /**
    * returns the initial position of this stripe
    * @return the starting position of the stripe
    */
    position getViewPosition() {
        return viewPosition;
    }

    /**
    * returns if the stripe exists
    * @return true if the stripe exists otherwise false
    */
    bool getExists() {
        return exists;
    }

    /**
    * returns the number of tiles in the view
    * @return the number of maximal tiles in the view
    */
    uint8_t getMaxTiles() {
        return maxtiles;
    }

    /**
    * the stripedirection, in which direction the mapstripe shows
    * @return the current direction of the mapstripe
    */
    stripedirection getStripeDirection() {
        return stripedir;
    }

    /**
    * constructor
    */
    NewClientView();

    /**
    * destructor
    */
    ~NewClientView();

    /**
{'fraction_non_alphanumeric': 0.08370702541106129, 'fraction_numerical': 0.006539611360239163, 'mean_word_length': 2.3836915297092287, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4188406', 'n_tokens_mistral': 1587, 'n_tokens_neox': 1495, 'n_words': 587}