godot-cpp-utils/player.hpp

31 lines
573 B
C++

#ifndef UTILS_PLAYER_HPP
#define UTILS_PLAYER_HPP
#include <cstdint>
#include <optional>
#include <godot_cpp/variant/transform3d.hpp>
namespace godot { class Node; }
namespace gd = godot;
namespace utils {
class PlayerInput;
class IPlayer {
friend class GameRoot3D;
public:
virtual void setup_player_input(PlayerInput *input) = 0;
virtual gd::Node *to_node() = 0;
virtual void spawn_at_position(gd::Transform3D const &at) = 0;
uint32_t get_player_id();
private:
std::optional<uint32_t> player_id{std::nullopt};
};
}
#endif // !UTILS_PLAYER_HPP