summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mtransit.h
blob: a660d73645944a65e8db5d1fcd63f11a391dc9a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * File:       mtransit.h
 * Summary:    Tracking monsters in transit between levels.
 * Written by: Darshan Shaligram
 *
 *  Modified for Crawl Reference by $Author: dshaligram $ on $Date: 2007-03-15T20:10:20.648083Z $
 */

#ifndef MTRANSIT_H
#define MTRANSIT_H

#include "AppHdr.h"
#include "travel.h"
#include <map>
#include <list>

struct follower
{
    monsters mons;
    FixedVector<item_def, NUM_MONSTER_SLOTS> items;

    follower() : mons(), items() { }
    follower(const monsters &m);
    bool place(bool near_player = false);
    void load_mons_items();
    void restore_mons_items(monsters &m);
};

typedef std::list<follower> m_transit_list;
typedef std::map<level_id, m_transit_list> monsters_in_transit;

extern monsters_in_transit the_lost_ones;

m_transit_list *get_transit_list(level_id where);
void add_monster_to_transit(level_id dest, const monsters &m);

// Places (some of the) monsters eligible to be placed on this level.
void place_transiting_monsters();

#endif