mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-28 08:33:36 +00:00
Allowing players to join the lobby
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// Edited by Benjamin Henry on 2021-05-20.
|
||||
//
|
||||
|
||||
#include <Component/Controllable/ControllableComponent.hpp>
|
||||
#include "GamepadComponent.hpp"
|
||||
|
||||
namespace BBM
|
||||
@@ -31,4 +32,27 @@ namespace BBM
|
||||
return this->_ID;
|
||||
}
|
||||
|
||||
void GamepadComponent::onStart()
|
||||
{
|
||||
auto *controller = this->_entity.tryGetComponent<ControllableComponent>();
|
||||
if (!controller)
|
||||
return;
|
||||
switch (this->_ID) {
|
||||
case 0:
|
||||
controller->layout = ControllableComponent::GAMEPAD_0;
|
||||
break;
|
||||
case 1:
|
||||
controller->layout = ControllableComponent::GAMEPAD_1;
|
||||
break;
|
||||
case 2:
|
||||
controller->layout = ControllableComponent::GAMEPAD_2;
|
||||
break;
|
||||
case 3:
|
||||
controller->layout = ControllableComponent::GAMEPAD_3;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace BMM
|
||||
|
||||
Reference in New Issue
Block a user