forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmagic_teleporter_list.h
43 lines (36 loc) · 1.46 KB
/
magic_teleporter_list.h
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
41
42
43
#pragma once
#ifndef CATA_SRC_MAGIC_TELEPORTER_LIST_H
#define CATA_SRC_MAGIC_TELEPORTER_LIST_H
#include <iosfwd>
#include <map>
#include <set>
#include "coordinates.h"
#include "optional.h"
class Character;
class JsonIn;
class JsonObject;
class JsonOut;
struct tripoint;
class teleporter_list
{
private:
// OMT locations of all known teleporters
std::map<tripoint_abs_omt, std::string> known_teleporters;
// ui for selection of desired teleport location.
// returns overmap tripoint, or nullopt if canceled
cata::optional<tripoint_abs_omt> choose_teleport_location();
// returns true if a teleport is successful
// does not do any loading or unloading
bool place_avatar_overmap( Character &you, const tripoint_abs_omt &omt_pt ) const;
public:
bool knows_translocator( const tripoint_abs_omt &omt_pos ) const;
// adds teleporter to known_teleporters and does any other activation necessary
bool activate_teleporter( const tripoint_abs_omt &omt_pt, const tripoint &local_pt );
void deactivate_teleporter( const tripoint_abs_omt &omt_pt, const tripoint &local_pt );
// calls the necessary functions to select translocator location
// and teleports the target(s) there
void translocate( const std::set<tripoint> &targets );
void serialize( JsonOut &json ) const;
void deserialize( const JsonObject &data );
};
#endif // CATA_SRC_MAGIC_TELEPORTER_LIST_H