mirror of
https://github.com/ddnet/ddnet.git
synced 2024-10-20 07:48:18 +00:00
17402cc43f
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.
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
/* (c) Shereef Marzouk. See "licence DDRace.txt" and the readme.txt in the root of the distribution for more information. */
|
|
#ifndef GAME_TEAMSCORE_H
|
|
#define GAME_TEAMSCORE_H
|
|
|
|
#include <engine/shared/protocol.h>
|
|
|
|
enum
|
|
{
|
|
TEAM_FLOCK = 0,
|
|
TEAM_SUPER = MAX_CLIENTS,
|
|
NUM_TEAMS = TEAM_SUPER + 1,
|
|
VANILLA_TEAM_SUPER = VANILLA_MAX_CLIENTS
|
|
};
|
|
|
|
// do not change the values of the following enum
|
|
enum
|
|
{
|
|
SV_TEAM_FORBIDDEN = 0, // teams are disabled on the map
|
|
SV_TEAM_ALLOWED = 1, // teams are enabled on the map, but optional
|
|
SV_TEAM_MANDATORY = 2, // map must be played with a team
|
|
SV_TEAM_FORCED_SOLO = 3 // map forces a random team for each individual player
|
|
};
|
|
|
|
class CTeamsCore
|
|
{
|
|
int m_aTeam[MAX_CLIENTS];
|
|
bool m_aIsSolo[MAX_CLIENTS];
|
|
|
|
public:
|
|
bool m_IsDDRace16;
|
|
|
|
CTeamsCore();
|
|
|
|
bool SameTeam(int ClientId1, int ClientId2) const;
|
|
|
|
bool CanKeepHook(int ClientId1, int ClientId2) const;
|
|
bool CanCollide(int ClientId1, int ClientId2) const;
|
|
|
|
int Team(int ClientId) const;
|
|
void Team(int ClientId, int Team);
|
|
|
|
void Reset();
|
|
void SetSolo(int ClientId, bool Value);
|
|
bool GetSolo(int ClientId) const;
|
|
};
|
|
|
|
#endif
|