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;
79 virtual bool disableSlipstreamBonus()
const = 0;
82 virtual void rumble(
float strength_low,
float strength_high, uint16_t duration) {}
86 { m_controller_name = name; }
98 virtual void skidBonusTriggered() = 0;
106 void setControls(
KartControl* kc) { m_controls = kc; }
114 virtual core::stringw getName(
bool include_handicap_string =
true)
const;
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
Describes a chain of 8-bit unsigned integers.
Definition: network_string.hpp:53
This is the base class for kart controller - that can be a player or a a robot.
Definition: controller.hpp:46
std::string m_controller_name
The name of the controller, mainly used for debugging purposes.
Definition: controller.hpp:58
virtual void finishedRace(float time)=0
Called whan this controller's kart finishes the last lap.
virtual bool isLocalPlayerController() const =0
This function checks if this is a local player.
virtual void newLap(int lap)=0
Callback whenever a new lap is triggered.
AbstractKart * getKart() const
Returns the kart controlled by this controller.
Definition: controller.hpp:117
KartControl * m_controls
A pointer to the main controller, from which the kart takes it commands.
Definition: controller.hpp:55
virtual KartControl * getControls()
Get a pointer on the kart controls.
Definition: controller.hpp:104
AbstractKart * m_kart
Pointer to the kart that is controlled by this controller.
Definition: controller.hpp:51
virtual void setControllerName(const std::string &name)
Sets the controller name for this controller.
Definition: controller.hpp:85
virtual bool action(PlayerAction action, int value, bool dry_run=false)=0
Default: ignore actions.
virtual bool isPlayerController() const =0
This function checks if this player is not an AI, i.e.
const std::string & getControllerName() const
Returns the name of this controller.
Definition: controller.hpp:89
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:53
Definition: kart_control.hpp:30
Definition: material.hpp:48