2010-08-03 16:44:52 +00:00
|
|
|
#ifndef GAME_MWWORLD_ACTIONTELEPORT_H
|
|
|
|
#define GAME_MWWORLD_ACTIONTELEPORT_H
|
|
|
|
|
2016-12-23 20:27:29 +00:00
|
|
|
#include <set>
|
2010-08-03 16:44:52 +00:00
|
|
|
#include <string>
|
2022-08-27 11:07:59 +00:00
|
|
|
#include <string_view>
|
2010-08-03 16:44:52 +00:00
|
|
|
|
|
|
|
#include <components/esm/defs.hpp>
|
|
|
|
|
|
|
|
#include "action.hpp"
|
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
2012-07-27 10:00:10 +00:00
|
|
|
class ActionTeleport : public Action
|
2010-08-03 16:44:52 +00:00
|
|
|
{
|
2023-01-19 16:31:45 +00:00
|
|
|
std::string mCellName;
|
2010-08-03 16:44:52 +00:00
|
|
|
ESM::Position mPosition;
|
2015-05-22 17:56:39 +00:00
|
|
|
bool mTeleportFollowers;
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2014-08-24 20:51:47 +00:00
|
|
|
/// Teleports this actor and also teleports anyone following that actor.
|
2020-10-16 18:18:54 +00:00
|
|
|
void executeImp(const Ptr& actor) override;
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2014-08-24 20:51:47 +00:00
|
|
|
/// Teleports only the given actor (internal use).
|
|
|
|
void teleport(const Ptr& actor);
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2010-08-03 16:44:52 +00:00
|
|
|
public:
|
2016-12-26 20:46:43 +00:00
|
|
|
/// If cellName is empty, an exterior cell is assumed.
|
2015-05-22 17:56:39 +00:00
|
|
|
/// @param teleportFollowers Whether to teleport any following actors of the target actor as well.
|
2023-01-19 16:31:45 +00:00
|
|
|
ActionTeleport(std::string_view cellName, const ESM::Position& position, bool teleportFollowers);
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2020-10-03 20:05:17 +00:00
|
|
|
/// @param includeHostiles If true, include hostile followers (which won't actually be teleported) in the
|
|
|
|
/// output,
|
|
|
|
/// e.g. so that the teleport action can calm them.
|
2021-10-06 16:25:28 +00:00
|
|
|
static void getFollowers(
|
|
|
|
const MWWorld::Ptr& actor, std::set<MWWorld::Ptr>& out, bool toExterior, bool includeHostiles = false);
|
2010-08-03 16:44:52 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|