00001 /* 00002 * File: mon-transit.h 00003 * Summary: Tracking monsters in transit between levels. 00004 * Written by: Darshan Shaligram 00005 */ 00006 00007 #ifndef MON_TRANSIT_H 00008 #define MON_TRANSIT_H 00009 00010 #include "monster.h" 00011 #include <map> 00012 #include <list> 00013 00014 struct follower 00015 { 00016 monster mons; 00017 FixedVector<item_def, NUM_MONSTER_SLOTS> items; 00018 00019 follower() : mons(), items() { } 00020 follower(const monster& m); 00021 bool place(bool near_player = false); 00022 void load_mons_items(); 00023 void restore_mons_items(monster& m); 00024 }; 00025 00026 typedef std::list<follower> m_transit_list; 00027 typedef std::map<level_id, m_transit_list> monsters_in_transit; 00028 00029 typedef std::list<item_def> i_transit_list; 00030 typedef std::map<level_id, i_transit_list> items_in_transit; 00031 00032 extern monsters_in_transit the_lost_ones; 00033 extern items_in_transit transiting_items; 00034 00035 void transit_lists_clear(); 00036 00037 m_transit_list *get_transit_list(const level_id &where); 00038 void add_monster_to_transit(const level_id &dest, const monster& m); 00039 void add_item_to_transit(const level_id &dest, const item_def &i); 00040 00041 // Places (some of the) monsters eligible to be placed on this level. 00042 void place_transiting_monsters(); 00043 void place_followers(); 00044 00045 void place_transiting_items(); 00046 00047 #endif