18 #ifndef HEADER_CONTROLLER_HPP 19 #define HEADER_CONTROLLER_HPP 21 #include <irrString.h> 32 #include "input/input.hpp" 33 #include "states_screens/state_manager.hpp" 36 class BareNetworString;
63 virtual void reset () = 0;
64 virtual void update (
int ticks) = 0;
65 virtual void handleZipper (
bool play_sound) = 0;
66 virtual void collectedItem (
const ItemState &item,
67 float previous_energy=0) = 0;
69 virtual void crashed (
const Material *m) = 0;
70 virtual void setPosition (
int p) = 0;
74 virtual bool isLocalPlayerController ()
const = 0;
78 virtual bool isPlayerController ()
const = 0;
79 virtual bool disableSlipstreamBonus()
const = 0;
82 virtual void rumble(
float strength_low,
float strength_high, uint16_t duration) {}
86 { m_controller_name = name; }
92 virtual bool action(
PlayerAction action,
int value,
bool dry_run=
false) = 0;
96 virtual void newLap(
int lap) = 0;
98 virtual void skidBonusTriggered() = 0;
101 virtual void finishedRace(
float time) = 0;
106 void setControls(
KartControl* kc) { m_controls = kc; }
114 virtual core::stringw getName(
bool include_handicap_string =
true)
const;
This is the base class for kart controller - that can be a player or a a robot.
Definition: controller.hpp:45
const std::string & getControllerName() const
Returns the name of this controller.
Definition: controller.hpp:89
Definition: three_d_animation.hpp:32
Definition: kart_control.hpp:29
KartControl * m_controls
A pointer to the main controller, from which the kart takes it commands.
Definition: controller.hpp:55
virtual void setControllerName(const std::string &name)
Sets the controller name for this controller.
Definition: controller.hpp:85
Definition: material.hpp:47
std::string m_controller_name
The name of the controller, mainly used for debugging purposes.
Definition: controller.hpp:58
Describes a chain of 8-bit unsigned integers.
Definition: network_string.hpp:52
AbstractKart * m_kart
Pointer to the kart that is controlled by this controller.
Definition: controller.hpp:51
virtual bool canGetAchievements() const
Only local players can get achievements.
Definition: controller.hpp:109
Contains the state information of an item, i.e.
Definition: item.hpp:52
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:61
virtual KartControl * getControls()
Get a pointer on the kart controls.
Definition: controller.hpp:104
AbstractKart * getKart() const
Returns the kart controlled by this controller.
Definition: controller.hpp:117