66 void setConfigValues();
68 virtual void tick(
float dt)
override;
75 { this->ball_ = ball; }
78 void calculateRandomOffset();
79 void calculateBallEndPosition();
80 void move(
char direction,
bool bUseDelay);
The PongAI is an artificial intelligence for the Pong gametype.
Definition: PongAI.h:60
bool bChangedRandomOffset_
Helper boolean, to change the random offset more often.
Definition: PongAI.h:87
Declaration of the Tickable interface.
Vector2 ballDirection_
Vector to store the (x,z) direction in which the ball is flying.
Definition: PongAI.h:84
float ballEndPosition_
The calculated end position of the ball.
Definition: PongAI.h:85
char oldMove_
The previous movement.
Definition: PongAI.h:93
float randomOffset_
A random offset to introduce random errors (weighted by the strength of the AI) into the AI's behavio...
Definition: PongAI.h:86
WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted.
Definition: CorePrereqs.h:236
char movement_
The planned movement.
Definition: PongAI.h:92
Declaration and implementation of several math-functions, typedefs of some Ogre::Math classes to the ...
void setPongBall(PongBall *ball)
Set the ball for the AI.
Definition: PongAI.h:74
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
std::list< std::pair< Timer *, char > > reactionTimers_
A list of reaction timers and the directions that take effect when their timer expires.
Definition: PongAI.h:91
bool bOscillationAvoidanceActive_
Boolean, to avoid oscillations.
Definition: PongAI.h:94
float relHysteresisOffset_
A hysteresis offset.
Definition: PongAI.h:88
This class manages the ball for Pong.
Definition: PongBall.h:59
Definition: Controller.h:38
float strength_
The strength of the AI. Ranging from 0 to 1.
Definition: PongAI.h:89
WeakPtr< PongBall > ball_
A weak pointer to the ball.
Definition: PongAI.h:83
#define _PongExport
Definition: PongPrereqs.h:60
Shared library macros, enums, constants and forward declarations for the pong module ...
The Tickable interface provides a tick(dt) function, that gets called every frame.
Definition: Tickable.h:52
Declaration of the PongBall class.