Attributes.cs 760 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Tutorial026.Models
  7. {
  8. public class Attributes
  9. {
  10. public float Speed { get; set; }
  11. /// <summary>
  12. /// How long the Attribute lasts for
  13. /// </summary>
  14. public float Timer { get; set; }
  15. public Attributes()
  16. {
  17. Timer = 5f;
  18. }
  19. public static Attributes operator +(Attributes a, Attributes b)
  20. {
  21. return new Attributes()
  22. {
  23. Speed = a.Speed + b.Speed,
  24. };
  25. }
  26. public static Attributes operator -(Attributes a, Attributes b)
  27. {
  28. return new Attributes()
  29. {
  30. Speed = a.Speed - b.Speed,
  31. };
  32. }
  33. }
  34. }