Browse Source

Improve naming convention for variable specific operators

master
Jorge Ramirez 7 years ago
parent
commit
45c5652f4d
  1. 10
      Assets/Fungus/Scripts/Commands/SetVariable.cs
  2. 2
      Assets/Fungus/Scripts/VariableTypes/BooleanVariable.cs
  3. 2
      Assets/Fungus/Scripts/VariableTypes/FloatVariable.cs
  4. 2
      Assets/Fungus/Scripts/VariableTypes/GameObjectVariable.cs
  5. 2
      Assets/Fungus/Scripts/VariableTypes/IntegerVariable.cs
  6. 2
      Assets/Fungus/Scripts/VariableTypes/StringVariable.cs

10
Assets/Fungus/Scripts/Commands/SetVariable.cs

@ -79,11 +79,11 @@ namespace Fungus
#region Public members
public static readonly Dictionary<System.Type, SetOperator[]> operatorsByVariableType = new Dictionary<System.Type, SetOperator[]>() {
{ typeof(BooleanVariable), BooleanVariable.operators },
{ typeof(IntegerVariable), IntegerVariable.operators },
{ typeof(FloatVariable), FloatVariable.operators },
{ typeof(StringVariable), StringVariable.operators },
{ typeof(GameObjectVariable), GameObjectVariable.operators }
{ typeof(BooleanVariable), BooleanVariable.setOperators },
{ typeof(IntegerVariable), IntegerVariable.setOperators },
{ typeof(FloatVariable), FloatVariable.setOperators },
{ typeof(StringVariable), StringVariable.setOperators },
{ typeof(GameObjectVariable), GameObjectVariable.setOperators }
};
/// <summary>

2
Assets/Fungus/Scripts/VariableTypes/BooleanVariable.cs

@ -13,7 +13,7 @@ namespace Fungus
[System.Serializable]
public class BooleanVariable : VariableBase<bool>
{
public static readonly SetOperator[] operators = { SetOperator.Assign, SetOperator.Negate };
public static readonly SetOperator[] setOperators = { SetOperator.Assign, SetOperator.Negate };
public virtual bool Evaluate(CompareOperator compareOperator, bool booleanValue)
{

2
Assets/Fungus/Scripts/VariableTypes/FloatVariable.cs

@ -13,7 +13,7 @@ namespace Fungus
[System.Serializable]
public class FloatVariable : VariableBase<float>
{
public static readonly SetOperator[] operators = { SetOperator.Assign, SetOperator.Add, SetOperator.Subtract, SetOperator.Multiply, SetOperator.Divide };
public static readonly SetOperator[] setOperators = { SetOperator.Assign, SetOperator.Add, SetOperator.Subtract, SetOperator.Multiply, SetOperator.Divide };
public virtual bool Evaluate(CompareOperator compareOperator, float floatValue)
{

2
Assets/Fungus/Scripts/VariableTypes/GameObjectVariable.cs

@ -14,7 +14,7 @@ namespace Fungus
[System.Serializable]
public class GameObjectVariable : VariableBase<GameObject>
{
public static readonly SetOperator[] operators = { SetOperator.Assign };
public static readonly SetOperator[] setOperators = { SetOperator.Assign };
public override void Apply(SetOperator setOperator, GameObject value)
{

2
Assets/Fungus/Scripts/VariableTypes/IntegerVariable.cs

@ -13,7 +13,7 @@ namespace Fungus
[System.Serializable]
public class IntegerVariable : VariableBase<int>
{
public static readonly SetOperator[] operators = { SetOperator.Assign, SetOperator.Add, SetOperator.Subtract, SetOperator.Multiply, SetOperator.Divide };
public static readonly SetOperator[] setOperators = { SetOperator.Assign, SetOperator.Add, SetOperator.Subtract, SetOperator.Multiply, SetOperator.Divide };
public virtual bool Evaluate(CompareOperator compareOperator, int integerValue)
{

2
Assets/Fungus/Scripts/VariableTypes/StringVariable.cs

@ -13,7 +13,7 @@ namespace Fungus
[System.Serializable]
public class StringVariable : VariableBase<string>
{
public static readonly SetOperator[] operators = { SetOperator.Assign };
public static readonly SetOperator[] setOperators = { SetOperator.Assign };
public virtual bool Evaluate(CompareOperator compareOperator, string stringValue)
{

Loading…
Cancel
Save