148 void readStick(
float& x,
float& y)
const;
159 std::array<std::uint8_t, SDL_SCANCODE_COUNT>
keys{};
162 std::array<std::uint8_t, CONTROL_COUNT>
keyHolds{};
Definition match_engine.h:517
Definition match_play_controller.h:55
bool controlsHome() const
Definition match_play_controller.h:80
float chargeShare(const MatchEngine &engine) const
Definition match_play_controller.cpp:549
bool isCharging() const
Definition match_play_controller.h:107
PlayerID manual_skip
Definition match_play_controller.h:185
void applySwitchingRules(MatchEngine &engine, PlayerID current, bool idle)
Definition match_play_controller.cpp:341
void update(MatchEngine &engine, float simulatedSeconds, const PlayScreenBasis &basis)
Definition match_play_controller.cpp:384
SDL_Gamepad * gamepad
Definition match_play_controller.h:168
void readStick(float &x, float &y) const
Definition match_play_controller.cpp:280
bool pause_requested
Definition match_play_controller.h:166
std::uint64_t charge_step
Definition match_play_controller.h:173
std::array< std::uint8_t, SDL_SCANCODE_COUNT > keys
Definition match_play_controller.h:159
static Control controlForButton(int button)
Definition match_play_controller.cpp:121
MatchPlayController & operator=(const MatchPlayController &)=delete
bool handleEvent(const SDL_Event &event)
Definition match_play_controller.cpp:145
std::array< bool, CONTROL_COUNT > pressed
Definition match_play_controller.h:164
~MatchPlayController()
Definition match_play_controller.cpp:56
void setOptions(const Options &changed)
Definition match_play_controller.h:81
PlayerID next_switch
Definition match_play_controller.h:180
MatchInputAction charging
Definition match_play_controller.h:172
MatchInputAction pending
Definition match_play_controller.h:175
bool takePauseRequest()
Definition match_play_controller.cpp:240
MatchPlayController(const MatchPlayController &)=delete
void begin(MatchEngine &engine, bool homeTeam, const Options &options)
Definition match_play_controller.cpp:62
void release(Control control)
Definition match_play_controller.cpp:220
const MatchPlayerInput & lastInput() const
Definition match_play_controller.h:116
bool submitted_any
Definition match_play_controller.h:179
PlayerID nextSwitch() const
Definition match_play_controller.h:104
double idle_since
Definition match_play_controller.h:187
void switchTo(MatchEngine &engine, PlayerID player)
Definition match_play_controller.cpp:323
bool was_idle
Definition match_play_controller.h:188
bool home
Definition match_play_controller.h:154
void clearPresses()
Definition match_play_controller.cpp:230
float pending_power
Definition match_play_controller.h:176
static Control controlForKey(const SDL_KeyboardEvent &key)
Definition match_play_controller.cpp:96
void openGamepad(SDL_JoystickID which)
Definition match_play_controller.cpp:247
std::array< bool, CONTROL_COUNT > padHolds
Definition match_play_controller.h:163
void closeGamepad()
Definition match_play_controller.cpp:266
void press(Control control)
Definition match_play_controller.cpp:210
void end(MatchEngine &engine)
Definition match_play_controller.cpp:88
bool held(Control control) const
Definition match_play_controller.cpp:225
bool gamepad_subsystem
Definition match_play_controller.h:169
std::array< std::uint8_t, CONTROL_COUNT > keyHolds
Definition match_play_controller.h:162
bool active
Definition match_play_controller.h:153
bool isActive() const
Definition match_play_controller.h:79
double last_switch_seconds
Definition match_play_controller.h:183
double last_manual_seconds
Definition match_play_controller.h:184
bool hasGamepad() const
Definition match_play_controller.h:112
Control
Definition match_play_controller.h:121
@ PASS
Definition match_play_controller.h:126
@ DOWN
Definition match_play_controller.h:123
@ RIGHT
Definition match_play_controller.h:125
@ PAUSE
Definition match_play_controller.h:133
@ LEFT
Definition match_play_controller.h:124
@ SHOOT
Definition match_play_controller.h:127
@ UP
Definition match_play_controller.h:122
@ SWITCH
Definition match_play_controller.h:130
@ THROUGH
Definition match_play_controller.h:128
@ JOCKEY
Definition match_play_controller.h:132
@ CONTROL_COUNT
Definition match_play_controller.h:134
@ SPRINT
Definition match_play_controller.h:131
@ LOB
Definition match_play_controller.h:129
static constexpr float FULL_POWER_SECONDS
Definition match_play_controller.h:68
const Options & options() const
Definition match_play_controller.h:82
Options settings
Definition match_play_controller.h:155
const char * gamepadName() const
Definition match_play_controller.cpp:274
MatchPlayController()=default
MatchPlayerInput submitted
Definition match_play_controller.h:178
void openFirstGamepad()
Definition match_play_controller.cpp:255
std::array< bool, CONTROL_COUNT > released
Definition match_play_controller.h:165
MatchInputAction
Definition match_engine.h:387
PlayAutoSwitch
Definition match_play_controller.h:20
Definition match_play_controller.h:59
float deadZone
Definition match_play_controller.h:64
PlayAutoSwitch autoSwitch
Definition match_play_controller.h:60
std::uint8_t passAssist
Definition match_play_controller.h:62
Definition match_play_controller.h:36
float lengthY
Definition match_play_controller.h:38
float widthY
Definition match_play_controller.h:40
float lengthX
Definition match_play_controller.h:37
float widthX
Definition match_play_controller.h:39
uint32_t PlayerID
Type alias for Player identifiers.
Definition types.h:21