Attributes.cs 579 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Tutorial030.Models
  7. {
  8. public class Attributes
  9. {
  10. public float Speed { get; set; }
  11. public static Attributes operator +(Attributes a, Attributes b)
  12. {
  13. return new Attributes()
  14. {
  15. Speed = a.Speed + b.Speed,
  16. };
  17. }
  18. public static Attributes operator -(Attributes a, Attributes b)
  19. {
  20. return new Attributes()
  21. {
  22. Speed = a.Speed - b.Speed,
  23. };
  24. }
  25. }
  26. }