00001 #ifndef ENV_H
00002 #define ENV_H
00003
00004 #include "map_knowledge.h"
00005 #include "monster.h"
00006 #include "show.h"
00007 #include "trap_def.h"
00008 #include <set>
00009
00010 typedef FixedArray<short, GXM, GYM> grid_heightmap;
00011 typedef uint32_t terrain_property_t;
00012
00013 typedef std::set<std::string> string_set;
00014
00015 struct vault_placement;
00016 typedef std::vector<vault_placement*> vault_placement_refv;
00017
00018 struct crawl_environment
00019 {
00020 uint8_t rock_colour;
00021 uint8_t floor_colour;
00022
00023 FixedVector< item_def, MAX_ITEMS > item;
00024 FixedVector< monster, MAX_MONSTERS+1 > mons;
00025
00026 feature_grid grid;
00027 FixedArray<terrain_property_t, GXM, GYM> pgrid;
00028 FixedArray< unsigned short, GXM, GYM > mgrid;
00029 FixedArray< int, GXM, GYM > igrid;
00030 FixedArray< unsigned short, GXM, GYM > cgrid;
00031 FixedArray< unsigned short, GXM, GYM > grid_colours;
00032 FixedArray< unsigned short, GXM, GYM > tgrid;
00033
00034 map_mask level_map_mask;
00035 map_mask level_map_ids;
00036
00037 string_set level_uniq_maps;
00038 string_set level_uniq_map_tags;
00039 string_set level_layout_types;
00040
00041 std::string level_build_method;
00042
00043 vault_placement_refv level_vaults;
00044
00045 std::auto_ptr<grid_heightmap> heightmap;
00046
00047
00048 FixedArray< map_cell, GXM, GYM > map_knowledge;
00049
00050 FixedArray< map_cell, GXM, GYM > map_shadow;
00051 std::set<coord_def> visible;
00052
00053 #ifdef USE_TILE
00054
00055 FixedArray<tile_fg_store, GXM, GYM> tile_bk_fg;
00056 FixedArray<tileidx_t, GXM, GYM> tile_bk_bg;
00057 FixedArray<tile_flavour, GXM, GYM> tile_flv;
00058
00059 FixedArray<tileidx_t, ENV_SHOW_DIAMETER, ENV_SHOW_DIAMETER> tile_fg;
00060 FixedArray<tileidx_t, ENV_SHOW_DIAMETER, ENV_SHOW_DIAMETER> tile_bg;
00061 tile_flavour tile_default;
00062 std::vector<std::string> tile_names;
00063 #endif
00064
00065 FixedVector< cloud_struct, MAX_CLOUDS > cloud;
00066 short cloud_no;
00067
00068 FixedVector< shop_struct, MAX_SHOPS > shop;
00069 FixedVector< trap_def, MAX_TRAPS > trap;
00070
00071 FixedVector< monster_type, MAX_MONS_ALLOC > mons_alloc;
00072 map_markers markers;
00073
00074
00075
00076 CrawlHashTable properties;
00077
00078
00079
00080
00081 int spawn_random_rate;
00082
00083
00084
00085 int elapsed_time;
00086
00087
00088 coord_def old_player_pos;
00089
00090
00091 int turns_on_level;
00092
00093
00094
00095 uint32_t level_flags;
00096
00097
00098 unsigned int dactions_done;
00099
00100 coord_def sanctuary_pos;
00101 int sanctuary_time;
00102 int forest_awoken_until;
00103 int density;
00104
00105
00106 std::vector<final_effect> final_effects;
00107 };
00108
00109 #ifdef DEBUG_GLOBALS
00110 #define env (*real_env)
00111 #endif
00112 extern struct crawl_environment env;
00113
00114 #endif