| 599 | } |
| 600 | |
| 601 | bool Player::lounge(EntityId loungeableEntityId, size_t anchorIndex) { |
| 602 | if (!canUseTool()) |
| 603 | return false; |
| 604 | |
| 605 | auto loungeableEntity = world()->get<LoungeableEntity>(loungeableEntityId); |
| 606 | if (!loungeableEntity || anchorIndex >= loungeableEntity->anchorCount() |
| 607 | || !loungeableEntity->entitiesLoungingIn(anchorIndex).empty() |
| 608 | || !loungeableEntity->loungeAnchor(anchorIndex)) |
| 609 | return false; |
| 610 | |
| 611 | m_state = State::Lounge; |
| 612 | m_movementController->setAnchorState({loungeableEntityId, anchorIndex}); |
| 613 | return true; |
| 614 | } |
| 615 | |
| 616 | void Player::stopLounging() { |
| 617 | if (loungingIn()) { |
no test coverage detected