• Design
  • API Reference
  • Changelog
  • Contribute
Show / Hide Table of Contents
  • Libplanet
    • Address
    • AddressExtension
    • ByteUtil
    • Hashcash
    • Hashcash.Stamp
    • HashDigest<T>
    • HashDigestExtension
    • Nonce
  • Libplanet.Action
    • AccountStateGetter
    • ActionEvaluation<T>
    • ActionTypeAttribute
    • AddressStateMap
    • IAccountStateDelta
    • IAction
    • IActionContext
    • IRandom
    • MissingActionTypeException
    • PolymorphicAction<T>
  • Libplanet.Blockchain
    • BlockChain<T>
  • Libplanet.Blockchain.Policies
    • BlockPolicy<T>
    • BlockPolicyExtension
    • IBlockPolicy<T>
  • Libplanet.Blocks
    • Block<T>
    • InvalidBlockDifficultyException
    • InvalidBlockException
    • InvalidBlockHashException
    • InvalidBlockIndexException
    • InvalidBlockNonceException
    • InvalidBlockPreviousHashException
    • InvalidBlockTimestampException
  • Libplanet.Crypto
    • InvalidCiphertextException
    • PrivateKey
    • PublicKey
    • SymmetricKey
  • Libplanet.Net
    • BlockDownloadState
    • DifferentAppProtocolVersionException
    • DifferentProtocolVersionEventArgs
    • IceServer
    • IceServerException
    • InvalidMessageException
    • NoSwarmContextException
    • Peer
    • PeerNotFoundException
    • PeerSetDelta
    • Swarm
    • SwarmException
  • Libplanet.Serialization
    • BencodexFormatter<T>
    • SerializationInfoExtension
  • Libplanet.Store
    • BaseIndex<TKey, TVal>
    • BaseStore
    • BlockSet<T>
    • FileStore
    • IStore
    • NamespaceNotFoundException
    • TransactionSet<T>
  • Libplanet.Tx
    • InvalidTxException
    • InvalidTxIdException
    • InvalidTxNonceException
    • InvalidTxPublicKeyException
    • InvalidTxSignatureException
    • InvalidTxUpdatedAddressesException
    • Transaction<T>
    • TxId
    • UnexpectedlyTerminatedTxRehearsalException

Interface IRandom

An pseudorandom number generator interface equivalent to Random.

Although these two types have similar shapes, they are not compatible (i.e., disallowed to be casted to each other).

Namespace: Libplanet.Action
Assembly: Libplanet.dll
Syntax
public interface IRandom

Methods

| Improve this Doc View Source

Next()

Gets a non-negative random integer.

Declaration
int Next()
Returns
Type Description
Int32

A 32-bit signed integer that is greater than or equal to 0 and less than MaxValue.

See Also
Next()
| Improve this Doc View Source

Next(Int32)

Gets a non-negative random integer that is less than the specified maxValue.

Declaration
int Next(int maxValue)
Parameters
Type Name Description
Int32 maxValue

The exclusive upper bound of the random number to be generated. It must be greater than or equal to 0.

Returns
Type Description
Int32

A 32-bit signed integer that is greater than or equal to 0 and less than maxValue; that is, the range of return values ordinarily includes 0 but not maxValue. However, if maxValue equals to 0, maxValue is returned.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when maxValue is less than 0.

See Also
Next(Int32)
| Improve this Doc View Source

Next(Int32, Int32)

Gets a random integer that is within a specified range.

Declaration
int Next(int minValue, int maxValue)
Parameters
Type Name Description
Int32 minValue

The inclusive lower bound of the random number to be generated.

Int32 maxValue

The exclusive upper bound of the random number to be generated. It must be greater than or equal to minValue.

Returns
Type Description
Int32

A 32-bit signed integer that is greater than or equal to minValue and less than maxValue; that is, the range of return values ordinarily includes minValue but not maxValue. If maxValue equals to minValue, minValue is returned.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when maxValue is less than minValue.

See Also
Next(Int32, Int32)
| Improve this Doc View Source

NextBytes(Byte[])

Fills the elements of a specified Bytes buffer with random numbers.

Declaration
void NextBytes(byte[] buffer)
Parameters
Type Name Description
Byte[] buffer

A Byte array to contain random numbers.

Exceptions
Type Condition
ArgumentNullException

Thrown when buffer is null.

See Also
NextBytes(Byte[])
| Improve this Doc View Source

NextDouble()

Gets a random floating-point number that is greater than or equal to 0.0, and less than 1.0.

Declaration
double NextDouble()
Returns
Type Description
Double

A double-precision floating point number that is greater than or equal to 0.0, and less than 1.0.

See Also
NextDouble()
  • Improve this Doc
  • View Source
Back to top Copyright © 2019 Planetarium
Generated by DocFX