Player12
An open source football management simulator
Loading...
Searching...
No Matches
world_rng.cpp File Reference
#include "model/world_rng.h"
#include <algorithm>
#include <array>
#include <bit>
#include <cmath>
#include <limits>

Functions

std::uint64_t mixHash (std::uint64_t a, std::uint64_t b)
 
std::int32_t dayOrdinal (const GameDateValue &date)
 
std::int32_t dateToInt (const GameDateValue &date)
 
GameDateValue dateFromInt (std::int32_t value)
 

Function Documentation

◆ dateFromInt()

GameDateValue dateFromInt ( std::int32_t  value)

Converts the compact integer form YYYYMMDD back to a date.

◆ dateToInt()

std::int32_t dateToInt ( const GameDateValue &  date)

Converts a date to the compact integer form YYYYMMDD.

◆ dayOrdinal()

std::int32_t dayOrdinal ( const GameDateValue &  date)

Days since 1970-01-01 for a proleptic Gregorian date.

◆ mixHash()

std::uint64_t mixHash ( std::uint64_t  a,
std::uint64_t  b 
)

Mixes two 64-bit values into a well distributed hash (splitmix64).