You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw-tes3mp/apps/openmw-mp/Actors.hpp

60 lines
1.4 KiB
C++

//
// Created by koncord on 25.08.17.
//
#pragma once
#include <string>
#include <components/openmw-mp/Base/BaseActor.hpp>
#include "NetActor.hpp"
class LuaState;
class Player;
class Actor: public NetActor
{
friend class ActorController;
public:
static void Init(LuaState &lua);
public:
Actor();
std::string getRefId() const;
void setRefId(const std::string &refId);
unsigned getRefNumIndex() const;
void setRefNumIndex(unsigned refNumIndex);
unsigned getMpNum() const;
void setMpNum(unsigned mpNum);
void followPlayer(int pid);
void followActor(unsigned int refNumIndex, unsigned int mpNum);
bool doesHavePosition() const; // ????
bool doesHaveStatsDynamic() const; // ????
std::shared_ptr<mwmp::BaseActor> actor;
};
class ActorController
{
public:
static void Init(LuaState &lua);
public:
ActorController();
~ActorController();
std::shared_ptr<Actor> createActor();
void sendActors(std::shared_ptr<Player> player, std::vector<std::shared_ptr<Actor>> actors, const ESM::Cell &cell, bool sendToAll = false);
void sendList(std::shared_ptr<Player> player, std::vector<std::shared_ptr<Actor>> actors, const ESM::Cell &cell, bool sendToAll = false);
void requestList(std::shared_ptr<Player> player, const ESM::Cell &cell);
std::vector<std::shared_ptr<Actor>> getActors(std::shared_ptr<Player> player, const ESM::Cell &cell);
private:
mwmp::BaseActorList actorList;
};