mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 08:07:28 +00:00
* push * fix * push * abstract and more accurate * new abstract method I guess * that table does not explode * webedit major * Update Content.Shared/EntityTable/ValueSelector/BinomialNumberSelector.cs Co-authored-by: SnappingOpossum <snappingopossum@outlook.com> * big ass merge conflicts * sadas * review --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> Co-authored-by: Tayrtahn <tayrtahn@gmail.com> Co-authored-by: SnappingOpossum <snappingopossum@outlook.com>
32 lines
588 B
C#
32 lines
588 B
C#
namespace Content.Shared.EntityTable.ValueSelector;
|
|
|
|
/// <summary>
|
|
/// Gives a constant value.
|
|
/// </summary>
|
|
public sealed partial class ConstantNumberSelector : NumberSelector
|
|
{
|
|
[DataField]
|
|
public int Value = 1;
|
|
|
|
public ConstantNumberSelector(int value)
|
|
{
|
|
Value = value;
|
|
}
|
|
|
|
public override int Get(System.Random 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;
|
|
}
|
|
}
|