Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
91 lines (82 sloc) 2.69 KB
#ifndef LEVEL_H
#define LEVEL_H
#include <limits.h>
#include <map>
#include <set>
#include <string>
#include <vector>
#include "Globals.h"
#include "Point.h"
#include "Stash.h"
#include "Tile.h"
/* max amount of nodes in pathing_queue */
#define PATHING_QUEUE_SIZE 16384
namespace data {
class Monster;
class Item;
class Monster;
class Level {
Level(int level, const std::string &name, int branch = BRANCH_MAIN);
static bool isPassable(unsigned char symbol);
static const Tile& outsideMap();
static void init();
static void destroy();
int branch() const;
int branch(int branch);
int depth() const;
const std::string& name() const;
Tile& tile();
Tile& tile(const Point& point);
const std::map<Point, Monster*>& monsters() const;
const std::map<Point, Stash>& stashes() const;
const std::map<Point, int>& symbols(unsigned char symbol) const;
void analyze();
int identifier() const;
void parseMessages(const std::string& messages);
void setDirtyStash(const Point& point);
void setDungeonSymbol(const Point& point, unsigned char symbol);
void setDungeonSymbolValue(const Point& point, int value);
static void setFarlookResults(const std::map<Point, std::string>& farlooks);
static void clearFarlookData();
std::vector<Point> farlooksNeeded();
void increaseAdjacentSearchCount(const Point& point, int count = 1);
void leftLevel();
static Point _pathing_queue[PATHING_QUEUE_SIZE];
static int _pathing_queue_size;
static unsigned char _uniquemap[UCHAR_MAX + 1][CHAR_MAX + 1];
static int _pathcost[UCHAR_MAX + 1];
static bool _passable[UCHAR_MAX + 1];
static bool _dungeon[UCHAR_MAX + 1];
static bool _monster[UCHAR_MAX + 1];
static bool _item[UCHAR_MAX + 1];
static bool _got_pickup_menu;
static bool _got_drop_menu;
static Tile _outside_map;
static std::map<Point,std::string> _turn_farlooks;
static unsigned _farlooked_turn;
static Coordinate _prev_position;
int _level;
Tile _map[MAP_ROW_END + 1][MAP_COL_END + 1];
std::map<Point, Monster*> _monsters;
std::set<Point> _monster_points;
std::map<Point, Stash> _stashes;
std::map<Point, int> _symbols[UCHAR_MAX + 1];
std::string _name;
int _depth;
int _branch;
bool _walls_diggable;
bool _floor_diggable;
bool _new_level;
Point _last_pathing_root;
void updateMapPoint(const Point& point, unsigned char symbol, int color);
void updateLight(const Point& point);
void updateMonsters();
bool parseFarlook(Point c, bool& shopkeeper, bool& priest, int& attitude, std::string& name, const data::Monster*& data);
void updatePathMap(bool left_level);
void updatePathMapSetCost(const Point& to, const Tile& prev, bool left_level);
unsigned int updatePathMapCalculateCost(const Tile& next, const Tile& prev, bool left_level);
Something went wrong with that request. Please try again.