World.swift 362 B

12345678910
  1. import Random
  2. public struct WorldMeta {
  3. private init() { }
  4. public static let maxId: UInt32 = 10000
  5. public static let randomId = { () -> UInt32 in UInt32(1) + CryptoRandom.uint32 % maxId }
  6. public static let maxRandomNumber: Int32 = 10000
  7. public static let randomRandomNumber = { () -> Int32 in Int32(1) + abs(CryptoRandom.int32) % maxRandomNumber }
  8. }