Random.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System.Collections;
  2. namespace OpenVIII.IGMData.Target
  3. {
  4. public class Random
  5. {
  6. #region Fields
  7. private BitArray fields = new BitArray(3, false);
  8. #endregion Fields
  9. #region Constructors
  10. public Random()
  11. {
  12. }
  13. /// <summary>
  14. /// Set all feilds to a true/false value
  15. /// </summary>
  16. /// <param name="value">true/false</param>
  17. public Random(bool value) => fields.SetAll(value);
  18. #endregion Constructors
  19. #region Properties
  20. /// <summary>
  21. /// Positive spells go to allies and Negative go to enemies.
  22. /// </summary>
  23. public bool PositiveMatters { get => fields[2]; set => fields[2] = value; }
  24. /// <summary>
  25. /// if true the side (enemy or party) is randomized
  26. /// </summary>
  27. public bool Side { get => fields[0]; set => fields[0] = value; }
  28. /// <summary>
  29. /// if true only a single target is chosen at random
  30. /// </summary>
  31. public bool Single { get => fields[1]; set => fields[1] = value; }
  32. #endregion Properties
  33. #region Methods
  34. public static implicit operator Random(bool value) => new Random(value);
  35. #endregion Methods
  36. }
  37. }