Event.cs 699 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. namespace ENet
  3. {
  4. public enum EventState
  5. {
  6. CONNECTED = 0,
  7. DISCONNECTED = 1,
  8. }
  9. public class Event
  10. {
  11. private readonly ENetEvent ev;
  12. private EventState peerState = EventState.CONNECTED;
  13. public Event(ENetEvent ev)
  14. {
  15. this.ev = ev;
  16. }
  17. public EventState EventState
  18. {
  19. get
  20. {
  21. return this.peerState;
  22. }
  23. set
  24. {
  25. this.peerState = value;
  26. }
  27. }
  28. public ENetEvent Ev
  29. {
  30. get
  31. {
  32. return this.ev;
  33. }
  34. }
  35. public IntPtr PacketPtr
  36. {
  37. get
  38. {
  39. return this.Ev.packet;
  40. }
  41. }
  42. public IntPtr PeerPtr
  43. {
  44. get
  45. {
  46. return this.Ev.peer;
  47. }
  48. }
  49. public EventType Type
  50. {
  51. get
  52. {
  53. return this.Ev.type;
  54. }
  55. }
  56. }
  57. }