ddnet/src/game/server/entities/dragger_beam.h
heinrich5991 17402cc43f Rename all variables for strict camel-casing of abbreviations
This is the strict version, ID → Id, UI → Ui, except DDNet which stays
DDNet.

This would fix #7750.

Done using a naive rename script (for bash, use `shopt -s globstar`):

```fish
sed -i \
	-e 's/\([a-z]_\?\)ID/\1Id/g' \
	-e 's/\([^ ]\)\<UI\>/\1Ui/g' \
	-e 's/UI()/Ui()/g' \
	-e 's/\<CUI\>/CUi/g' \
	-e 's/\([\ta-z.(&]\|[,=|] \)ID\>/\1Id/g' \
	-e 's/\<ID\>\([^ ").]\)/Id\1/g' \
	-e 's/\<ID\([0-9]\)/Id\1/g' \
	-e 's/\<ID\>\( [<=>:+*/-]\)/Id\1/g' \
	-e 's/int ID/int Id/g' \
	-e 's/\([a-z]_\?\)GPU/\1Gpu/g' \
	-e 's/\([a-z]_\?\)IP/\1Ip/g' \
	-e 's/\([a-z]_\?\)CID/\1Cid/g' \
	-e 's/\([a-z]_\?\)MySQL/\1Mysql/g' \
	-e 's/MySql/Mysql/g' \
	-e 's/\([a-xz]_\?\)SQL/\1Sql/g' \
	-e 's/DPMode/DpMode/g' \
	-e 's/TTWGraphics/TTwGraphics/g' \
	\
	-e 's/Ipointer/IPointer/g' \
	-e 's/\.vendorId/.vendorID/g' \
	-e 's/\.windowId/.windowID/g' \
	-e 's/SDL_GetWindowFromId/SDL_GetWindowFromID/g' \
	-e 's/SDL_AudioDeviceId/SDL_AudioDeviceID/g' \
	-e 's/SDL_JoystickId/SDL_JoystickID/g' \
	-e 's/SDL_JoystickInstanceId/SDL_JoystickInstanceID/g' \
	-e 's/AVCodecId/AVCodecID/g' \
	src/**/*.cpp src/**/*.h {datasrc,scripts}/**/*.py
git checkout -- src/engine/external
```

I like this option because it presents clear rules.

Still needs fixups because of the naive replacement, I'd do this if we
want this merged.
2024-03-05 15:44:09 +01:00

45 lines
1.6 KiB
C++

/* See "licence DDRace.txt" and the readme.txt in the root of the distribution for more information. */
#ifndef GAME_SERVER_ENTITIES_DRAGGER_BEAM_H
#define GAME_SERVER_ENTITIES_DRAGGER_BEAM_H
#include <game/server/entity.h>
class CDragger;
class CGameWorld;
/**
* Dragger beams pull a selected player towards their center
*
* Dragger beams are generated by a particular dragger for the player closest to it and for whom certain criteria are
* met. Dragger beams exist until these criteria are no longer met. Dragger beams dissolve and automatically
* de-register from their dragger source as soon as the player for whom they were created:
* - is no longer alive
* - is no longer in range (sv_dragger_range)
* - can no longer be dragged because the beam is intercepted by a laser stopper (or if !IgnoreWalls by solid blocks)
*
* Dragger beams accelerate the selected player every tick towards their center. The length of the speed vector, which
* is added to that of the player, depends only on the strength of the dragger and is between 1 and 3 units long. If
* the player is in the center of the dragger, it will not accelerate.
*/
class CDraggerBeam : public CEntity
{
CDragger *m_pDragger;
float m_Strength;
bool m_IgnoreWalls;
int m_ForClientId;
int m_EvalTick;
bool m_Active;
public:
CDraggerBeam(CGameWorld *pGameWorld, CDragger *pDragger, vec2 Pos, float Strength, bool IgnoreWalls, int ForClientId, int Layer, int Number);
void SetPos(vec2 Pos);
void Reset() override;
void Tick() override;
void Snap(int SnappingClient) override;
void SwapClients(int Client1, int Client2) override;
};
#endif // GAME_SERVER_ENTITIES_DRAGGER_BEAM_H