Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tyanmahou committed Dec 28, 2024
1 parent 2933269 commit be8f176
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace abyss::Actor::Gimmick::Door
m_door->getKind(),
startPos->isSave()
};
player->find<StateCtrl>()->changeState<Player::DoorInState>(door, *room);
Player::DoorInState::Change(player, door, *room);
return;
}
}
Expand Down
4 changes: 4 additions & 0 deletions Re-Abyss/app/components/Actor/Player/State/DoorInState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

namespace abyss::Actor::Player
{
void DoorInState::Change(ActorObj* player, const Gimmick::Door::DoorData& door, const Room::RoomData& room)
{
player->find<StateCtrl>()->changeState<Player::DoorInState>(door, room);
}
DoorInState::DoorInState(const Gimmick::Door::DoorData& door, const Room::RoomData& room):
m_door(door),
m_room(room)
Expand Down
8 changes: 7 additions & 1 deletion Re-Abyss/app/components/Actor/Player/State/DoorInState.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include <abyss/components/Actor/Player/State/BaseState.hpp>
#include <abyss/components/Actor/Gimmick/Door/DoorData.hpp>
#include <abyss/modules/Room/RoomData.hpp>
Expand All @@ -7,6 +7,12 @@ namespace abyss::Actor::Player
{
class DoorInState final : public BaseState
{
public:
static void Change(
ActorObj* player,
const Gimmick::Door::DoorData& door,
const Room::RoomData& room
);
public:
DoorInState(const Gimmick::Door::DoorData& door, const Room::RoomData& room);
private:
Expand Down

0 comments on commit be8f176

Please sign in to comment.