Skip to content

Commit

Permalink
Remove unused private method
Browse files Browse the repository at this point in the history
  • Loading branch information
desplesda committed Dec 19, 2024
1 parent b97dff8 commit 5473b1d
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions Runtime/InMemoryVariableStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,46 +75,6 @@ public string GetDebugList()

#region Setters

/// <summary>
/// Used internally by serialization functions to wrap around the
/// SetValue() methods.
/// </summary>
void SetVariable(string name, Yarn.IType type, string value)
{
if (type == Yarn.Types.Boolean)
{
bool newBool;
if (bool.TryParse(value, out newBool))
{
SetValue(name, newBool);
}
else
{
throw new System.InvalidCastException($"Couldn't initialize default variable {name} with value {value} as Bool");
}
}
else if (type == Yarn.Types.Number)
{
float newNumber;
if (float.TryParse(value, out newNumber))
{ // TODO: this won't work for different cultures (e.g. French write "0.53" as "0,53")
SetValue(name, newNumber);
}
else
{
throw new System.InvalidCastException($"Couldn't initialize default variable {name} with value {value} as Number (Float)");
}
}
else if (type == Yarn.Types.String)
{
SetValue(name, value); // no special type conversion required
}
else
{
throw new System.ArgumentOutOfRangeException($"Unsupported type {type.Name}");
}
}

/// <summary>
/// Throws a <see cref="System.ArgumentException"/> if <paramref
/// name="variableName"/> is not a valid Yarn Spinner variable name.
Expand Down

0 comments on commit 5473b1d

Please sign in to comment.