using System;
using Unity.Collections;
namespace LitMotion
{
///
/// Type of characters used to fill in invisible strings.
///
public enum ScrambleMode : byte
{
///
/// None
///
None = 0,
///
/// A-Z
///
Uppercase = 1,
///
/// a-z
///
Lowercase = 2,
///
/// 0-9
///
Numerals = 3,
///
/// A-Z, a-z, 0-9
///
All = 4,
///
/// Custom characters.
///
Custom = 5
}
///
/// Options for string type motion.
///
public struct StringOptions : IMotionOptions, IEquatable
{
public ScrambleMode ScrambleMode;
public bool RichTextEnabled;
public FixedString64Bytes CustomScrambleChars;
public Unity.Mathematics.Random RandomState;
public readonly bool Equals(StringOptions other)
{
return other.ScrambleMode == ScrambleMode &&
other.RichTextEnabled == RichTextEnabled &&
other.CustomScrambleChars == CustomScrambleChars &&
other.RandomState.state == RandomState.state;
}
public override readonly bool Equals(object obj)
{
if (obj is StringOptions options) return Equals(options);
return false;
}
public override readonly int GetHashCode()
{
return HashCode.Combine(ScrambleMode, RichTextEnabled, CustomScrambleChars, RandomState);
}
}
}