Move RandomDelay from AmbientSound to Util

This commit is contained in:
reaperrr
2017-02-04 12:28:26 +01:00
parent 958d1cd365
commit e23a866979
2 changed files with 14 additions and 14 deletions

View File

@@ -164,5 +164,16 @@ namespace OpenRA.Mods.Common
yield return p;
}
}
public static int RandomDelay(World world, int[] range)
{
if (range.Length == 0)
return 0;
if (range.Length == 1)
return range[0];
return world.SharedRandom.Next(range[0], range[1]);
}
}
}