public void ReFillEnergySuppliers(ref GameMasterData master) { var random = new Random(RandomSeed); foreach (ref var energySupplier in EnergySuppliers) { if (energySupplier.Value > 0) { continue; } var _ = random.NextUInt4(); random.state = _.x; energySupplier.Position.x = random.NextInt(0, master.Width - 1); random.state = _.y; energySupplier.Position.y = random.NextInt(0, master.Height - 1); random.state = _.z; energySupplier.Value = random.NextInt(500, 20000); random.state = _.w; } RandomSeed = random.state; }