mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* documentation pass on content.server -> E! * APi pass on content.server for the E folder. * documentation pass on content.shared for e. * Apply suggestions from code review Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> * fixing documentation according to review part 1. * typo * Very minor fixes * And a short explanation about EUI --------- Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> Co-authored-by: SlamBamActionman <slambamactionman@gmail.com>
36 lines
699 B
C#
36 lines
699 B
C#
using Robust.Shared.Random;
|
|
|
|
namespace Content.Shared.EntityTable.ValueSelector;
|
|
|
|
/// <summary>
|
|
/// Gives a constant value.
|
|
/// </summary>
|
|
public sealed partial class ConstantNumberSelector : NumberSelector
|
|
{
|
|
/// <summary>
|
|
/// The constant value of this selector.
|
|
/// </summary>
|
|
[DataField]
|
|
public int Value = 1;
|
|
|
|
public ConstantNumberSelector(int value)
|
|
{
|
|
Value = value;
|
|
}
|
|
|
|
public override int Get(IRobustRandom rand)
|
|
{
|
|
return Value;
|
|
}
|
|
|
|
public override float Odds()
|
|
{
|
|
// You really shouldn't have a constant value of 0 ever.
|
|
return 1;
|
|
}
|
|
|
|
public override float Average()
|
|
{
|
|
return Value;
|
|
}
|
|
}
|