Show / Hide Table of Contents

Class GameValueUtils

Inheritance
System.Object
GameValueUtils
Namespace: Eco.Gameplay.Civics.GameValues
Assembly: Eco.Gameplay.dll
Syntax
public static class GameValueUtils : Object

Methods

DescribeNullSafe(GameValue)

Declaration
public static string DescribeNullSafe(this GameValue val)
Parameters
Type Name Description
GameValue val
Returns
Type Description
System.String

DescribeNullSafe(IDescribable)

Declaration
public static string DescribeNullSafe(this IDescribable val)
Parameters
Type Name Description
IDescribable val
Returns
Type Description
System.String

FailNullSafe<TEvalReturn, TEvalParam>(GameValue, Eval<TEvalParam>, String)

Make a generic Fail Eval param with a nice message. Assumes the paramname is already tagged as localized elsewhere (as members are when marked with [Eco]).

Declaration
public static Eval<TEvalReturn> FailNullSafe<TEvalReturn, TEvalParam>(this GameValue gameValue, Eval<TEvalParam> eval, string paramName)
Parameters
Type Name Description
GameValue gameValue
Eval<TEvalParam> eval
System.String paramName
Returns
Type Description
Eval<TEvalReturn>
Type Parameters
Name Description
TEvalReturn
TEvalParam

IsConstant(GameValue<Single>, Single)

Declaration
public static bool IsConstant(this GameValue<float> num, float val)
Parameters
Type Name Description
GameValue<System.Single> num
System.Single val
Returns
Type Description
System.Boolean

IsNegative(GameValue<Single>)

Declaration
public static bool IsNegative(this GameValue<float> num)
Parameters
Type Name Description
GameValue<System.Single> num
Returns
Type Description
System.Boolean

IsSimpleBool(GameValue<Boolean>)

Declaration
public static bool IsSimpleBool(this GameValue<bool> num)
Parameters
Type Name Description
GameValue<System.Boolean> num
Returns
Type Description
System.Boolean

IsSimpleFalse(GameValue<Boolean>)

If the game value is a simple wrapped value that's always false then we return true.

Declaration
public static bool IsSimpleFalse(this GameValue<bool> num)
Parameters
Type Name Description
GameValue<System.Boolean> num
Returns
Type Description
System.Boolean

IsSimpleTrue(GameValue<Boolean>)

If the game value is a simple wrapped value that's always true then we return true.

Declaration
public static bool IsSimpleTrue(this GameValue<bool> num)
Parameters
Type Name Description
GameValue<System.Boolean> num
Returns
Type Description
System.Boolean

IsZero(GameValue<Single>)

Declaration
public static bool IsZero(this GameValue<float> num)
Parameters
Type Name Description
GameValue<System.Single> num
Returns
Type Description
System.Boolean

Missing<TEvalReturn>(GameValue, String)

Declaration
public static Eval<TEvalReturn> Missing<TEvalReturn>(this GameValue gameValue, string paramName)
Parameters
Type Name Description
GameValue gameValue
System.String paramName
Returns
Type Description
Eval<TEvalReturn>
Type Parameters
Name Description
TEvalReturn

NonZero(GameValue<Single>)

Declaration
public static bool NonZero(this GameValue<float> num)
Parameters
Type Name Description
GameValue<System.Single> num
Returns
Type Description
System.Boolean

NullOrZero(GameValue<Single>)

Declaration
public static bool NullOrZero(this GameValue<float> num)
Parameters
Type Name Description
GameValue<System.Single> num
Returns
Type Description
System.Boolean

TryGetConstant(GameValue<Single>, out Single)

Declaration
public static bool TryGetConstant(this GameValue<float> num, out float val)
Parameters
Type Name Description
GameValue<System.Single> num
System.Single val
Returns
Type Description
System.Boolean

TryLoc(GameValue<Boolean>, FormattableString, IContextObject, User)

Does the test for a GameValue, notifies in a failure, and returns true or false for "should we continue"

Declaration
public static bool TryLoc(this GameValue<bool> reqs, FormattableString failureDesc, IContextObject context, User notify)
Parameters
Type Name Description
GameValue<System.Boolean> reqs
System.FormattableString failureDesc
IContextObject context
User notify
Returns
Type Description
System.Boolean

UILinkNullSafe(ILinkable)

Declaration
public static LocString UILinkNullSafe(this ILinkable val)
Parameters
Type Name Description
ILinkable val
Returns
Type Description
LocString
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾