Person.cs 995 B

12345678910111213141516171819202122232425262728293031323334
  1. #if !BESTHTTP_DISABLE_SIGNALR_CORE
  2. using System;
  3. using System.Collections.Generic;
  4. namespace BestHTTP.Examples
  5. {
  6. public enum PersonStates
  7. {
  8. Unknown,
  9. Joined
  10. }
  11. /// <summary>
  12. /// Helper class to demonstrate strongly typed callbacks
  13. /// </summary>
  14. internal sealed class Person
  15. {
  16. public UnityEngine.Vector3[] Positions { get; set; }
  17. public string Name { get; set; }
  18. public long Age { get; set; }
  19. public DateTime Joined { get; set; }
  20. public PersonStates State { get; set; }
  21. public List<Person> Friends { get; set; }
  22. public override string ToString()
  23. {
  24. return string.Format("[Person Name: '{0}', Age: '<color=yellow>{1}</color>', Joined: {2}, State: {3}, Friends: {4}, Position: {5}]",
  25. this.Name, this.Age, this.Joined, this.State, this.Friends != null ? this.Friends.Count : 0, this.Positions != null ? this.Positions.Length : 0);
  26. }
  27. }
  28. }
  29. #endif