// Copyright (c) Pixel Crushers. All rights reserved.
namespace PixelCrushers.DialogueSystem
{
///
/// A static utility class to work with toggle values.
///
public static class ToggleUtility
{
///
/// Returns the new value of a bool after applying a toggle.
///
///
/// The new value.
///
///
/// The original value to toggle.
///
///
/// The toggle to apply.
///
public static bool GetNewValue(bool oldValue, Toggle state)
{
switch (state)
{
case Toggle.True:
return true;
case Toggle.False:
return false;
case Toggle.Flip:
default:
return !oldValue;
}
}
}
}