LethalCompanyCommunity / LethalAPI.Core

A core modding library for Lethal Company
GNU Lesser General Public License v3.0
24 stars 6 forks source link

API-level Random instance #7

Open MaxWasUnavailable opened 10 months ago

MaxWasUnavailable commented 10 months ago

Is your feature request related to a problem? Please describe. I feel like it'd be cleaner to have a single random I can reuse everywhere, rather than make one for each mod I have that needs a Random instance.

Describe the solution you'd like Something akin to

using LethalAPI.Random

// (...)
APIRandom.Next()
// (...)

Describe alternatives you've considered Using a Random instance per mod that uses it.

Additional context It's a very minor thing, but there might be benefits to having a "global" random anyone can use. People that require a specific seed still need their own instance, though.

KrayOristine commented 10 months ago

This is probably useless because of Random that mscorlib/System.Private.Corelib have by default. Is there anything else that you would think that can make this standout of the default random?

Redforce04 commented 10 months ago

Unity ransoms are a static and via a range. Depending on use case this may work.