Library.cs 517 B

1234567891011121314151617181920212223242526272829303132
  1. namespace ENet
  2. {
  3. public static class Library
  4. {
  5. public static void Initialize()
  6. {
  7. var inits = new ENetCallbacks();
  8. int ret = Native.enet_initialize_with_callbacks(Native.ENET_VERSION, ref inits);
  9. if (ret < 0)
  10. {
  11. throw new ENetException(ret, "Initialization failed.");
  12. }
  13. }
  14. public static void Deinitialize()
  15. {
  16. Native.enet_deinitialize();
  17. }
  18. public static uint Time
  19. {
  20. get
  21. {
  22. return Native.enet_time_get();
  23. }
  24. set
  25. {
  26. Native.enet_time_set(value);
  27. }
  28. }
  29. }
  30. }