Const some stuff

This commit is contained in:
Sirius902 2022-04-24 18:19:32 -07:00
commit fbce055324
3 changed files with 7 additions and 6 deletions

View file

@ -20,14 +20,15 @@ namespace Ship {
void Read(OSContPad* pad);
virtual void ReadFromSource() = 0;
virtual void WriteToSource(ControllerCallback* controller) = 0;
virtual bool Connected() const = 0;
virtual bool CanRumble() const = 0;
virtual bool Connected() = 0;
bool isRumbling;
void SetButtonMapping(const std::string& szButtonName, int32_t dwScancode);
std::shared_ptr<ControllerAttachment> GetAttachment() { return Attachment; }
int32_t GetControllerNumber() { return dwControllerNumber; }
virtual bool HasPadConf() = 0;
virtual bool HasPadConf() const = 0;
virtual std::optional<std::string> GetPadConfSection() = 0;
protected:

View file

@ -10,15 +10,15 @@ namespace Ship {
void ReadFromSource();
void WriteToSource(ControllerCallback* controller);
bool Connected() const { return true; }
bool CanRumble() const { return false; }
bool Connected() { return true; }
bool PressButton(int32_t dwScancode);
bool ReleaseButton(int32_t dwScancode);
void ReleaseAllButtons();
bool HasPadConf() const { return false; }
std::optional<std::string> GetPadConfSection() { return {}; }
bool HasPadConf() { return false; };
protected:
std::string GetControllerType();

View file

@ -12,13 +12,13 @@ namespace Ship {
void ReadFromSource();
void WriteToSource(ControllerCallback* controller);
bool Connected() const { return Cont != nullptr; }
bool CanRumble() const { return SDL_GameControllerHasRumble(Cont); }
bool Connected() { return Cont != nullptr; }
std::string GetGuid() { return guid; };
bool HasPadConf() const { return true; }
std::optional<std::string> GetPadConfSection();
bool HasPadConf() { return true; };
protected:
std::string GetControllerType();