Skip to content

Commit

Permalink
refactor: Player now inherits directly from Actor
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed May 22, 2024
1 parent 13f2733 commit 69f8d35
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 269 deletions.
37 changes: 0 additions & 37 deletions include/endstone/actor/human.h

This file was deleted.

62 changes: 0 additions & 62 deletions include/endstone/detail/actor/human.h

This file was deleted.

6 changes: 4 additions & 2 deletions include/endstone/detail/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

#pragma once

#include "endstone/detail/actor/human.h"
#include "endstone/detail/actor/actor.h"
#include "endstone/player.h"

class Player;
class ServerNetworkHandler;

namespace endstone::detail {

class EndstonePlayer : public EndstoneHumanActor, public endstone::Player {
class EndstonePlayer : public EndstoneActor, public endstone::Player {
public:
explicit EndstonePlayer(EndstoneServer &server, ::Player &player);
~EndstonePlayer() override;
Expand Down Expand Up @@ -54,6 +54,7 @@ class EndstonePlayer : public EndstoneHumanActor, public endstone::Player {
[[nodiscard]] bool isInWater() const override;
[[nodiscard]] bool isInLava() const override;
[[nodiscard]] Level &getLevel() const override;
[[nodiscard]] Dimension &getDimension() const override;

// Player
[[nodiscard]] UUID getUniqueId() const override;
Expand All @@ -74,6 +75,7 @@ class EndstonePlayer : public EndstoneHumanActor, public endstone::Player {
::ServerNetworkHandler *network_handler_;
UUID uuid_;
SocketAddress address_;
PermissibleBase perm_;
};

} // namespace endstone::detail
4 changes: 2 additions & 2 deletions include/endstone/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <chrono>

#include "endstone/actor/human.h"
#include "endstone/actor/actor.h"
#include "endstone/util/socket_address.h"
#include "endstone/util/uuid.h"

Expand All @@ -25,7 +25,7 @@ namespace endstone {
/**
* @brief Represents a player.
*/
class Player : public HumanActor {
class Player : public Actor {
public:
Player() = default;
Player(const Player &) = delete;
Expand Down
135 changes: 0 additions & 135 deletions src/endstone_core/actor/human.cpp

This file was deleted.

Loading

0 comments on commit 69f8d35

Please sign in to comment.