Fixed basic whitespace problems.
Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines.
This commit is contained in:
parent
c3b4b70a73
commit
993fd14ddf
@ -107,3 +107,7 @@ class cListAllocationPool : public cAllocationPool<T>
|
||||
std::list<void *> m_FreeList;
|
||||
std::auto_ptr<typename cAllocationPool<T>::cStarvationCallbacks> m_Callbacks;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -2326,7 +2326,7 @@ bool cChunk::DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBl
|
||||
return false;
|
||||
}
|
||||
|
||||
// The correct block entity is here,
|
||||
// The correct block entity is here
|
||||
if (a_Callback.Item((cNoteEntity *)*itr))
|
||||
{
|
||||
return false;
|
||||
@ -2422,7 +2422,7 @@ bool cChunk::DoWithFlowerPotAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFlower
|
||||
return false;
|
||||
}
|
||||
|
||||
// The correct block entity is here,
|
||||
// The correct block entity is here
|
||||
if (a_Callback.Item((cFlowerPotEntity *)*itr))
|
||||
{
|
||||
return false;
|
||||
|
22
src/Group.h
22
src/Group.h
@ -5,18 +5,22 @@
|
||||
|
||||
|
||||
|
||||
class cGroup // tolua_export
|
||||
{ // tolua_export
|
||||
public: // tolua_export
|
||||
// tolua_begin
|
||||
class cGroup
|
||||
{
|
||||
public:
|
||||
// tolua_end
|
||||
cGroup() {}
|
||||
~cGroup() {}
|
||||
|
||||
void SetName( const AString & a_Name ) { m_Name = a_Name; } // tolua_export
|
||||
const AString & GetName() const { return m_Name; } // tolua_export
|
||||
void SetColor( const AString & a_Color ) { m_Color = a_Color; } // tolua_export
|
||||
void AddCommand( const AString & a_Command ); // tolua_export
|
||||
void AddPermission( const AString & a_Permission ); // tolua_export
|
||||
void InheritFrom( cGroup* a_Group ); // tolua_export
|
||||
// tolua_begin
|
||||
void SetName( const AString & a_Name ) { m_Name = a_Name; }
|
||||
const AString & GetName() const { return m_Name; }
|
||||
void SetColor( const AString & a_Color ) { m_Color = a_Color; }
|
||||
void AddCommand( const AString & a_Command );
|
||||
void AddPermission( const AString & a_Permission );
|
||||
void InheritFrom( cGroup* a_Group );
|
||||
// tolua_end
|
||||
|
||||
typedef std::map< AString, bool > PermissionMap;
|
||||
const PermissionMap & GetPermissions() const { return m_Permissions; }
|
||||
|
12
src/Item.cpp
12
src/Item.cpp
@ -193,17 +193,29 @@ void cItem::FromJson(const Json::Value & a_Value)
|
||||
bool cItem::IsEnchantable(short item)
|
||||
{
|
||||
if ((item >= 256) && (item <= 259))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ((item >= 267) && (item <= 279))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ((item >= 283) && (item <= 286))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ((item >= 290) && (item <= 294))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ((item >= 298) && (item <= 317))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ((item == 346) || (item == 359) || (item == 261))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
class cLog
|
||||
{ // tolua_export
|
||||
{
|
||||
private:
|
||||
FILE * m_File;
|
||||
static cLog * s_Log;
|
||||
@ -23,7 +23,7 @@ public:
|
||||
void ClearLog();
|
||||
static cLog* GetInstance();
|
||||
};
|
||||
// tolua_end
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -10,7 +10,6 @@ class cLog;
|
||||
|
||||
|
||||
|
||||
// tolua_begin
|
||||
class cMCLogger
|
||||
{
|
||||
public:
|
||||
@ -27,9 +26,9 @@ public:
|
||||
cMCLogger(void);
|
||||
|
||||
/** Creates a logger with the specified filename inside "logs" folder */
|
||||
cMCLogger(const AString & a_FileName); // tolua_export
|
||||
cMCLogger(const AString & a_FileName);
|
||||
|
||||
~cMCLogger(); // tolua_export
|
||||
~cMCLogger();
|
||||
|
||||
void Log (const char * a_Format, va_list a_ArgList) FORMATSTRING(2, 0);
|
||||
void Info (const char * a_Format, va_list a_ArgList) FORMATSTRING(2, 0);
|
||||
@ -37,7 +36,7 @@ public:
|
||||
void Error(const char * a_Format, va_list a_ArgList) FORMATSTRING(2, 0);
|
||||
|
||||
/** Logs the simple text message at the specified log level. */
|
||||
void LogSimple(const char * a_Text, eLogLevel a_LogLevel = llRegular); // tolua_export
|
||||
void LogSimple(const char * a_Text, eLogLevel a_LogLevel = llRegular);
|
||||
|
||||
static cMCLogger * GetInstance();
|
||||
private:
|
||||
@ -63,7 +62,7 @@ private:
|
||||
|
||||
/// Common initialization for all constructors, creates a logfile with the specified name and assigns s_MCLogger to this
|
||||
void InitLog(const AString & a_FileName);
|
||||
}; // tolua_export
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
16
src/Map.h
16
src/Map.h
@ -29,12 +29,11 @@ class cMap;
|
||||
|
||||
|
||||
/** Encapsulates a map decorator.
|
||||
*
|
||||
* A map decorator represents an object drawn on the map that can move freely.
|
||||
* (e.g. player trackers and item frame pointers)
|
||||
*
|
||||
* Excluding manually placed decorators,
|
||||
* decorators are automatically managed (allocated and freed) by their parent cMap instance.
|
||||
A map decorator represents an object drawn on the map that can move freely.
|
||||
(e.g. player trackers and item frame pointers)
|
||||
|
||||
Excluding manually placed decorators,
|
||||
decorators are automatically managed (allocated and freed) by their parent cMap instance.
|
||||
*/
|
||||
class cMapDecorator
|
||||
{
|
||||
@ -194,9 +193,8 @@ public:
|
||||
protected:
|
||||
|
||||
/** Encapsulates the state of a map client.
|
||||
*
|
||||
* In order to enhance performace, maps are streamed column-by-column to each client.
|
||||
* This structure stores the state of the stream.
|
||||
In order to enhance performace, maps are streamed column-by-column to each client.
|
||||
This structure stores the state of the stream.
|
||||
*/
|
||||
struct cMapClient
|
||||
{
|
||||
|
@ -32,8 +32,7 @@ public:
|
||||
cMapManager(cWorld * a_World);
|
||||
|
||||
/** Returns the map with the specified ID, NULL if out of range.
|
||||
*
|
||||
* WARNING: The returned map object is not thread safe.
|
||||
WARNING: The returned map object is not thread safe.
|
||||
*/
|
||||
cMap * GetMapData(unsigned int a_ID);
|
||||
|
||||
@ -41,15 +40,13 @@ public:
|
||||
cMap * CreateMap(int a_CenterX, int a_CenterY, int a_Scale = 3);
|
||||
|
||||
/** Calls the callback for the map with the specified ID.
|
||||
*
|
||||
* Returns true if the map was found and the callback called, false if map not found.
|
||||
* Callback return ignored.
|
||||
Returns true if the map was found and the callback called, false if map not found.
|
||||
Callback return value is ignored.
|
||||
*/
|
||||
bool DoWithMap(int a_ID, cMapCallback & a_Callback); // Exported in ManualBindings.cpp
|
||||
|
||||
/** Calls the callback for each map.
|
||||
*
|
||||
* Returns true if all maps processed, false if the callback aborted by returning true.
|
||||
Returns true if all maps processed, false if the callback aborted by returning true.
|
||||
*/
|
||||
bool ForEachMap(cMapCallback & a_Callback);
|
||||
|
||||
|
18
src/Root.h
18
src/Root.h
@ -36,20 +36,24 @@ namespace Json
|
||||
|
||||
|
||||
/// The root of the object hierarchy
|
||||
class cRoot // tolua_export
|
||||
{ // tolua_export
|
||||
// tolua_begin
|
||||
class cRoot
|
||||
{
|
||||
public:
|
||||
static cRoot * Get() { return s_Root; } // tolua_export
|
||||
static cRoot * Get() { return s_Root; }
|
||||
// tolua_end
|
||||
|
||||
cRoot(void);
|
||||
~cRoot();
|
||||
|
||||
void Start(void);
|
||||
|
||||
cServer * GetServer(void) { return m_Server; } // tolua_export
|
||||
cWorld * GetDefaultWorld(void); // tolua_export
|
||||
cWorld * GetWorld(const AString & a_WorldName); // tolua_export
|
||||
cWorld * CreateAndInitializeWorld(const AString & a_WorldName); // tolua_export
|
||||
// tolua_begin
|
||||
cServer * GetServer(void) { return m_Server; }
|
||||
cWorld * GetDefaultWorld(void);
|
||||
cWorld * GetWorld(const AString & a_WorldName);
|
||||
cWorld * CreateAndInitializeWorld(const AString & a_WorldName);
|
||||
// tolua_end
|
||||
|
||||
/// Calls the callback for each world; returns true if the callback didn't abort (return true)
|
||||
bool ForEachWorld(cWorldListCallback & a_Callback); // >> Exported in ManualBindings <<
|
||||
|
@ -197,15 +197,18 @@ void cObjective::SendTo(cClientHandle & a_Client)
|
||||
|
||||
|
||||
|
||||
cTeam::cTeam(const AString & a_Name, const AString & a_DisplayName,
|
||||
const AString & a_Prefix, const AString & a_Suffix)
|
||||
cTeam::cTeam(
|
||||
const AString & a_Name, const AString & a_DisplayName,
|
||||
const AString & a_Prefix, const AString & a_Suffix
|
||||
)
|
||||
: m_AllowsFriendlyFire(true)
|
||||
, m_CanSeeFriendlyInvisible(false)
|
||||
, m_DisplayName(a_DisplayName)
|
||||
, m_Name(a_Name)
|
||||
, m_Prefix(a_Prefix)
|
||||
, m_Suffix(a_Suffix)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -262,20 +262,17 @@ public:
|
||||
cTeam * QueryPlayerTeam(const AString & a_Name); // WARNING: O(n logn)
|
||||
|
||||
/** Execute callback for each objective with the specified type
|
||||
*
|
||||
* Returns true if all objectives processed, false if the callback aborted by returning true.
|
||||
Returns true if all objectives processed, false if the callback aborted by returning true.
|
||||
*/
|
||||
bool ForEachObjectiveWith(cObjective::eType a_Type, cObjectiveCallback& a_Callback);
|
||||
|
||||
/** Execute callback for each objective.
|
||||
*
|
||||
* Returns true if all objectives have been processed, false if the callback aborted by returning true.
|
||||
Returns true if all objectives have been processed, false if the callback aborted by returning true.
|
||||
*/
|
||||
bool ForEachObjective(cObjectiveCallback& a_Callback); // Exported in ManualBindings.cpp
|
||||
|
||||
/** Execute callback for each team.
|
||||
*
|
||||
* Returns true if all teams have been processed, false if the callback aborted by returning true.
|
||||
Returns true if all teams have been processed, false if the callback aborted by returning true.
|
||||
*/
|
||||
bool ForEachTeam(cTeamCallback& a_Callback); // Exported in ManualBindings.cpp
|
||||
|
||||
|
@ -143,9 +143,8 @@ public:
|
||||
/** Reset everything. */
|
||||
void Reset();
|
||||
|
||||
/** Increment the specified stat.
|
||||
*
|
||||
* Returns the new value.
|
||||
/** Increments the specified stat.
|
||||
Returns the new value.
|
||||
*/
|
||||
StatValue AddValue(const eStatistic a_Stat, const StatValue a_Delta = 1);
|
||||
|
||||
|
@ -502,8 +502,8 @@ AString & UTF8ToRawBEUTF16(const char * a_UTF8, size_t a_UTF8Length, AString & a
|
||||
return a_UTF16;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
---------------------------------------------------------------------
|
||||
Note A.
|
||||
The fall-through switches in UTF-8 reading code save a
|
||||
temp variable, some decrements & conditionals. The switches
|
||||
@ -516,7 +516,6 @@ AString & UTF8ToRawBEUTF16(const char * a_UTF8, size_t a_UTF8Length, AString & a
|
||||
if (tmpBytesToRead) ch <<= 6;
|
||||
} while (tmpBytesToRead > 0);
|
||||
}
|
||||
|
||||
---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
@ -6,10 +6,7 @@
|
||||
|
||||
|
||||
|
||||
#ifndef STRINGUTILS_H_INCLUDED
|
||||
#define STRINGUTILS_H_INCLUDED
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -101,8 +98,3 @@ extern void SetBEInt(char * a_Mem, Int32 a_Value);
|
||||
|
||||
|
||||
|
||||
#endif // STRINGUTILS_H_INCLUDED
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user