public void Shuffle(List <HackingNodeInfo> list)
    {
        System.Random rng = new System.Random((int)seed);
        int           n   = list.Count;

        while (n > 1)
        {
            n--;
            int             k     = rng.Next(n + 1);
            HackingNodeInfo value = list[k];
            list[k] = list[n];
            list[n] = value;
        }
    }
Ejemplo n.º 2
0
    public void Shuffle(List <HackingNodeInfo> list, DoorType type)
    {
        int hackSeed = GetHackSeedByDoorType(type);

        System.Random rng = new System.Random(hackSeed);
        int           n   = list.Count;

        while (n > 1)
        {
            n--;
            int             k     = rng.Next(n + 1);
            HackingNodeInfo value = list[k];
            list[k] = list[n];
            list[n] = value;
        }
    }