Event.cs 555 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. namespace ENet
  2. {
  3. public class Event
  4. {
  5. private readonly Host host;
  6. private readonly ENetEvent ev;
  7. public Event(Host host, ENetEvent ev)
  8. {
  9. this.host = host;
  10. this.ev = ev;
  11. }
  12. public ENetEvent Ev
  13. {
  14. get
  15. {
  16. return this.ev;
  17. }
  18. }
  19. public Packet Packet
  20. {
  21. get
  22. {
  23. return new Packet(this.host, this.Ev.packet);
  24. }
  25. }
  26. public Peer Peer
  27. {
  28. get
  29. {
  30. Peer peer = this.host.PeersManager[this.Ev.peer];
  31. return peer;
  32. }
  33. }
  34. public EventType Type
  35. {
  36. get
  37. {
  38. return this.Ev.type;
  39. }
  40. }
  41. }
  42. }