|
stmm-games-doc
0.32.0
|

Public Member Functions | |
| RandomParts () noexcept | |
| void | clear () noexcept |
| Removes all parts. More... | |
| int32_t | addRandomPart (int32_t nProb, const T &oData) noexcept |
| Adds a random part. More... | |
| int32_t | addRandomPart (int32_t nProb, T &&oData) noexcept |
| Adds a random part. More... | |
| T & | getRandomPart (int32_t nIdx) noexcept |
| Get random part object. More... | |
| T & | getRandomPart (int32_t nIdx, int32_t &nProb) noexcept |
| Get random part object and info. More... | |
| T & | getRandomPart (int32_t nIdx, int32_t &nProb, int32_t &nPrecProb) noexcept |
| Get random part object and info. More... | |
| int32_t | getTotRandomParts () const noexcept |
| The number of added parts. More... | |
| int32_t | getRandomRange () const noexcept |
| The sum of all the parts weights. More... | |
| int32_t | getRandomPartProbIdx (int32_t nRandom) noexcept |
| T & | getRandomPartProb (int32_t nRandom, int32_t &nIdx, int32_t &nRel) noexcept |
| Get the part given the probability. More... | |
| T & | getRandomPartProb (int32_t nRandom, int32_t &nIdx) noexcept |
| Get the part given the probability. More... | |
| T & | getRandomPartProb (int32_t nRandom) noexcept |
| Get the part given the probability. More... | |
|
inlinenoexcept |
|
inlinenoexcept |
Adds a random part.
| nProb | The weight of the part (must be non negative). |
| oData | The associated data. A copy is made. |
|
inlinenoexcept |
Adds a random part.
| nProb | The weight of the part (must be non negative). |
| oData | The associated data. |
|
inlinenoexcept |
Removes all parts.
|
inlinenoexcept |
Get random part object.
| nIdx | The index of the random part. Must be >= 0 and < getTotRandomParts(). |
|
inlinenoexcept |
Get random part object and info.
| nIdx | The index of the random part. Must be >= 0 and < getTotRandomParts(). |
| nProb | [output] The weight of the part. |
|
inlinenoexcept |
Get random part object and info.
| nIdx | The index of the random part. Must be >= 0 and < getTotRandomParts(). |
| nProb | [output] The weight of the part. |
| nPrecProb | [output] The sum of the weights of the preceding parts. |
|
inlinenoexcept |
Get the part given the probability.
nRel is set by this function to the value relative to the part 0 .. nProb-1, where nProb is what is returned by getRandomPart(nIdx, nProb)
| nRandom | The probability. Must be >= 0 and < getRandomRange(). |
| nIdx | [output] The index of the selected part. |
| nRel | [output] The probability within the weight of the part. |
|
inlinenoexcept |
Get the part given the probability.
| nRandom | The probability. Must be >= 0 and < getRandomRange(). |
| nIdx | [output] The index of the selected part. |
|
inlinenoexcept |
Get the part given the probability.
| nRandom | The probability. Must be >= 0 and < getRandomRange(). |
|
inlinenoexcept |
|
inlinenoexcept |
The sum of all the parts weights.
|
inlinenoexcept |
The number of added parts.
1.8.13