mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Cleanup: indentation of public/protected/private keywords
This commit is contained in:
@@ -18,7 +18,7 @@ class Dependency;
|
||||
/** K should be an integer type, the keys should be dense. */
|
||||
template <typename K, typename V>
|
||||
class VectorIntMap {
|
||||
public:
|
||||
public:
|
||||
inline V& operator [] (K key) {
|
||||
if (values.size() <= key) {
|
||||
values.resize(key + 1);
|
||||
@@ -27,7 +27,7 @@ class VectorIntMap {
|
||||
}
|
||||
/// Get access to the vector
|
||||
inline const vector<V>& get() const { return values; }
|
||||
private:
|
||||
private:
|
||||
vector<V> values;
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ class VectorIntMap {
|
||||
|
||||
/// Context for script evaluation
|
||||
class Context {
|
||||
public:
|
||||
public:
|
||||
Context();
|
||||
|
||||
/// Evaluate a script inside this context.
|
||||
@@ -74,7 +74,7 @@ class Context {
|
||||
/// Make a closure of the function with the direct parameters of the current call
|
||||
ScriptValueP makeClosure(const ScriptValueP& fun);
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
/// Open a new scope
|
||||
/** returns the number of shadowed binding before that scope */
|
||||
@@ -83,7 +83,7 @@ class Context {
|
||||
void closeScope(size_t scope);
|
||||
friend class LocalScope;
|
||||
|
||||
public:// public for FOR_EACH
|
||||
public:// public for FOR_EACH
|
||||
/// Record of a variable
|
||||
struct VariableValue {
|
||||
VariableValue() : level(0) {}
|
||||
@@ -95,7 +95,7 @@ class Context {
|
||||
Variable variable; ///< Name of the overwritten variable.
|
||||
VariableValue value; ///< Old value of that variable.
|
||||
};
|
||||
private:
|
||||
private:
|
||||
/// Variables, indexed by integer name (using string_to_variable)
|
||||
VectorIntMap<unsigned int, VariableValue> variables;
|
||||
/// Shadowed variable bindings
|
||||
@@ -129,10 +129,10 @@ class Context {
|
||||
|
||||
/// A class that creates a local scope
|
||||
class LocalScope {
|
||||
public:
|
||||
public:
|
||||
inline LocalScope(Context& ctx) : ctx(ctx), scope(ctx.openScope()) {}
|
||||
inline ~LocalScope() { ctx.closeScope(scope); }
|
||||
private:
|
||||
private:
|
||||
Context& ctx;
|
||||
size_t scope;
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ enum DependencyType
|
||||
|
||||
/// A 'pointer' to some script that depends on another script
|
||||
class Dependency {
|
||||
public:
|
||||
public:
|
||||
inline Dependency(DependencyType type, size_t index, void* data = nullptr)
|
||||
: type(type), index(index), data(data)
|
||||
{}
|
||||
@@ -50,7 +50,7 @@ class Dependency {
|
||||
|
||||
/// A list of dependencies
|
||||
class Dependencies : public vector<Dependency> {
|
||||
public:
|
||||
public:
|
||||
/// Add a dependency, prevents duplicates
|
||||
inline void add(const Dependency& d) {
|
||||
if (d.type == DEP_DUMMY) return;
|
||||
@@ -58,7 +58,7 @@ class Dependencies : public vector<Dependency> {
|
||||
push_back(d);
|
||||
}
|
||||
}
|
||||
private:
|
||||
private:
|
||||
using vector<Dependency>::push_back;
|
||||
};
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ struct NegTag {
|
||||
|
||||
/// A stack of opened HTML tags
|
||||
class TagStack {
|
||||
public:
|
||||
public:
|
||||
void open(String& ret, Tag& tag) {
|
||||
add(ret, NegTag(&tag, false));
|
||||
}
|
||||
@@ -113,7 +113,7 @@ class TagStack {
|
||||
pending_tags.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
vector<Tag*> tags; ///< Tags opened in the html output
|
||||
vector<NegTag> pending_tags; ///< Tags opened in the tagged string, but not (yet) in the output
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ DECLARE_POINTER_TYPE(ScriptRegex);
|
||||
|
||||
/// A regular expression for use in a script
|
||||
class ScriptRegex : public ScriptValue, public Regex {
|
||||
public:
|
||||
public:
|
||||
virtual ScriptType type() const { return SCRIPT_REGEX; }
|
||||
virtual String typeName() const { return _("regex"); }
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class CachedScriptableMask;
|
||||
* - The image can be scaled
|
||||
*/
|
||||
class ScriptableImage {
|
||||
public:
|
||||
public:
|
||||
inline ScriptableImage() {}
|
||||
inline ScriptableImage(const String& script) : script(script) {}
|
||||
inline ScriptableImage(const GeneratedImageP& gen) : value(gen) {}
|
||||
@@ -60,7 +60,7 @@ class ScriptableImage {
|
||||
/// Get access to the script, always returns a valid script
|
||||
ScriptP getValidScriptP();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
OptionalScript script; ///< The script, not really optional
|
||||
GeneratedImageP value; ///< The image generator
|
||||
|
||||
@@ -74,7 +74,7 @@ inline ScriptValueP to_script(const ScriptableImage&) { return script_nil; }
|
||||
|
||||
/// A version of ScriptableImage that does caching
|
||||
class CachedScriptableImage : public ScriptableImage {
|
||||
public:
|
||||
public:
|
||||
inline CachedScriptableImage() {}
|
||||
inline CachedScriptableImage(const String& script) : ScriptableImage(script) {}
|
||||
inline CachedScriptableImage(const GeneratedImageP& gen) : ScriptableImage(gen) {}
|
||||
@@ -97,7 +97,7 @@ class CachedScriptableImage : public ScriptableImage {
|
||||
/// Clears the cache
|
||||
void clearCache();
|
||||
|
||||
private:
|
||||
private:
|
||||
Image cached_i; ///< The cached image
|
||||
Bitmap cached_b; ///< *or* the cached bitmap
|
||||
RealSize cached_size; ///< The size of the image before rotating
|
||||
@@ -108,7 +108,7 @@ class CachedScriptableImage : public ScriptableImage {
|
||||
|
||||
/// A version of ScriptableImage that caches an AlphaMask
|
||||
class CachedScriptableMask {
|
||||
public:
|
||||
public:
|
||||
|
||||
/// Update the script, returns true if the value has changed
|
||||
bool update(Context& ctx);
|
||||
@@ -130,7 +130,7 @@ class CachedScriptableMask {
|
||||
/** Should only be used after get() was called before, otherwise an old mask might be returned */
|
||||
inline const AlphaMask& getFromCache() const { return mask; }
|
||||
|
||||
private:
|
||||
private:
|
||||
ScriptableImage script;
|
||||
AlphaMask mask;
|
||||
friend class Reader;
|
||||
|
||||
@@ -58,13 +58,13 @@ DECLARE_POINTER_TYPE(FunctionProfile);
|
||||
|
||||
/// Simple execution timer
|
||||
class Timer {
|
||||
public:
|
||||
public:
|
||||
Timer();
|
||||
/// The time the timer has been running, resets the timer
|
||||
inline ProfileTime time();
|
||||
/// Exclude the time since the last reset from ALL running timers
|
||||
inline void exclude_time();
|
||||
private:
|
||||
private:
|
||||
ProfileTime start;
|
||||
static ProfileTime delta; ///< Time excluded
|
||||
};
|
||||
@@ -73,7 +73,7 @@ class Timer {
|
||||
|
||||
/// How much time was spent in a function?
|
||||
class FunctionProfile : public IntrusivePtrBase<FunctionProfile> {
|
||||
public:
|
||||
public:
|
||||
FunctionProfile(const String& name)
|
||||
: name(name), time_ticks(0), time_ticks_max(0), calls(0)
|
||||
{}
|
||||
@@ -106,7 +106,7 @@ const FunctionProfile& profile_aggregated(int level = 1);
|
||||
|
||||
/// Profile a single function call
|
||||
class Profiler {
|
||||
public:
|
||||
public:
|
||||
/// Log the fact that the function function_name is entered, ends when profiler goes out of scope.
|
||||
/** Time between the construction of Timer and the construction of Profiler is excluded from ALL profiles.
|
||||
*/
|
||||
@@ -118,7 +118,7 @@ class Profiler {
|
||||
Profiler(Timer& timer, void* function_object, const String& function_name);
|
||||
/// Log the fact that the function is left
|
||||
~Profiler();
|
||||
private:
|
||||
private:
|
||||
Timer& timer;
|
||||
static FunctionProfile* function; ///< function we are in
|
||||
FunctionProfile* parent;
|
||||
|
||||
@@ -54,7 +54,7 @@ protected:
|
||||
* itself owns this object.
|
||||
*/
|
||||
class SetScriptManager : public SetScriptContext, public ActionListener {
|
||||
public:
|
||||
public:
|
||||
SetScriptManager(Set& set);
|
||||
~SetScriptManager();
|
||||
|
||||
@@ -70,7 +70,7 @@ class SetScriptManager : public SetScriptContext, public ActionListener {
|
||||
*/
|
||||
void updateAll();
|
||||
|
||||
private:
|
||||
private:
|
||||
void onInit(const StyleSheetP& stylesheet, Context& ctx) override;
|
||||
|
||||
void initDependencies(Context&, Game&);
|
||||
@@ -105,7 +105,7 @@ class SetScriptManager : public SetScriptContext, public ActionListener {
|
||||
};
|
||||
int delay;
|
||||
|
||||
protected:
|
||||
protected:
|
||||
/// Respond to actions by updating scripts
|
||||
void onAction(const Action&, bool undone);
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ inline void change(Defaultable<T>& v, const Defaultable<T>& new_v) { v.assignDon
|
||||
|
||||
/// An optional script
|
||||
class OptionalScript {
|
||||
public:
|
||||
public:
|
||||
inline OptionalScript() {}
|
||||
OptionalScript(const String& script_);
|
||||
~OptionalScript();
|
||||
@@ -90,7 +90,7 @@ class OptionalScript {
|
||||
inline String& getMutableUnparsed() { return unparsed; }
|
||||
inline void setUnparsed(String& new_unparsed) { unparsed = new_unparsed; }
|
||||
|
||||
protected:
|
||||
protected:
|
||||
ScriptP script; ///< The script, may be null if there is no script
|
||||
String unparsed; ///< Unparsed script, for writing back to a file
|
||||
// parse the unparsed string, while reading
|
||||
@@ -103,7 +103,7 @@ class OptionalScript {
|
||||
|
||||
/// An optional script which is parsed in string mode
|
||||
class StringScript : public OptionalScript {
|
||||
public:
|
||||
public:
|
||||
const String& get() const;
|
||||
void set(const String&);
|
||||
DECLARE_REFLECTION();
|
||||
@@ -115,7 +115,7 @@ class StringScript : public OptionalScript {
|
||||
/** NOTE: reading MUST happen inside a block */
|
||||
template <typename T>
|
||||
class Scriptable {
|
||||
public:
|
||||
public:
|
||||
Scriptable() : value() {}
|
||||
Scriptable(const T& value) : value(value) {}
|
||||
|
||||
@@ -139,7 +139,7 @@ class Scriptable {
|
||||
script.initDependencies(ctx, dep);
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
T value; ///< The actual value
|
||||
OptionalScript script; ///< The optional script
|
||||
|
||||
|
||||
Reference in New Issue
Block a user