lil upd
This commit is contained in:
26
Gameplay/Globals.cs
Normal file
26
Gameplay/Globals.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public static partial class Globals
|
||||
{
|
||||
public static bool _animationRunning;
|
||||
public static Random _rng = new();
|
||||
public static List<string> _addressTranslation = new(){"NW","N","NE","W","C","E","SW","S","SE"};
|
||||
|
||||
public static void Shuffle<T>(this IList<T> list)
|
||||
{
|
||||
int n = list.Count;
|
||||
while (n > 1) {
|
||||
n--;
|
||||
int k = _rng.Next(n + 1);
|
||||
T value = list[k];
|
||||
list[k] = list[n];
|
||||
list[n] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public static void LoadSeed(int SEED)
|
||||
{
|
||||
_rng = new(SEED);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user