summaryrefslogtreecommitdiffstats
path: root/src/ProbabDistrib.h
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2024-11-02 22:27:47 +0100
committerAlexander Harkness <me@bearbin.net>2024-11-02 22:27:47 +0100
commitcb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a (patch)
treef647b20e1823f1846af88e832cf82a4a02e96e69 /src/ProbabDistrib.h
parentImprove clang-format config file, remove automatically enforced code style from contrib guide. (diff)
downloadcuberite-clang-format-codebase.tar
cuberite-clang-format-codebase.tar.gz
cuberite-clang-format-codebase.tar.bz2
cuberite-clang-format-codebase.tar.lz
cuberite-clang-format-codebase.tar.xz
cuberite-clang-format-codebase.tar.zst
cuberite-clang-format-codebase.zip
Diffstat (limited to 'src/ProbabDistrib.h')
-rw-r--r--src/ProbabDistrib.h21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/ProbabDistrib.h b/src/ProbabDistrib.h
index a051c29d3..d0611e6d3 100644
--- a/src/ProbabDistrib.h
+++ b/src/ProbabDistrib.h
@@ -28,26 +28,26 @@ Usage:
class cProbabDistrib
{
-public:
+ public:
class cPoint
{
- public:
+ public:
int m_Value;
int m_Probability;
cPoint(int a_Value, int a_Probability) :
- m_Value(a_Value),
- m_Probability(a_Probability)
+ m_Value(a_Value), m_Probability(a_Probability)
{
}
- } ;
+ };
typedef std::vector<cPoint> cPoints;
cProbabDistrib(int a_MaxValue);
- /** Sets the distribution curve using an array of [value, probability] points, linearly interpolated. a_Points must not be empty. */
+ /** Sets the distribution curve using an array of [value, probability] points, linearly interpolated. a_Points must
+ * not be empty. */
void SetPoints(const cPoints & a_Points);
/** Sets the distribution curve using a definition string; returns true on successful parse */
@@ -61,8 +61,7 @@ public:
int GetSum(void) const { return m_Sum; }
-protected:
-
+ protected:
int m_MaxValue;
/** Cumulative probability of the values, sorted, for fast bsearch lookup */
@@ -70,8 +69,4 @@ protected:
/** Sum of all the probabilities across all values in the domain; -1 if not set */
int m_Sum;
-} ;
-
-
-
-
+};