NETManaged.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #include <ThirdParty/SDL/include/SDL.h>
  2. #include <Atomic/IO/FileSystem.h>
  3. #include <Atomic/IO/Log.h>
  4. #include <Atomic/Core/StringUtils.h>
  5. #include "CSEventHelper.h"
  6. #include "CSComponent.h"
  7. #include "NETManaged.h"
  8. namespace Atomic
  9. {
  10. NETManaged::NETManaged(Context* context) :
  11. Object(context),
  12. CSComponentCreate_(0),
  13. CSComponentCallMethod_(0),
  14. CSBeginSendEvent_(0)
  15. {
  16. }
  17. NETManaged::~NETManaged()
  18. {
  19. }
  20. CSComponent* NETManaged::CSComponentCreate(const String& componentName)
  21. {
  22. if (!CSComponentCreate_)
  23. return 0;
  24. return CSComponentCreate_(componentName.CString());
  25. }
  26. void NETManaged::CSComponentCallMethod(unsigned id, CSComponentMethod methodID, float value)
  27. {
  28. if (!CSComponentCallMethod_)
  29. return;
  30. CSComponentCallMethod_(id, methodID, value);
  31. }
  32. void NETManaged::CSBeginSendEvent(unsigned senderRefID, unsigned eventType, VariantMap* eventData)
  33. {
  34. if (!CSBeginSendEvent_)
  35. return;
  36. CSBeginSendEvent_(senderRefID, eventType, eventData);
  37. }
  38. void NETManaged::SetCSComponentCreate(CSComponentCreateFunctionPtr ptr)
  39. {
  40. CSComponentCreate_ = ptr;
  41. }
  42. void NETManaged::SetCSComponentCallMethod(CSComponentCallMethodFunctionPtr ptr)
  43. {
  44. CSComponentCallMethod_ = ptr;
  45. }
  46. void NETManaged::SetCSBeginSendEvent(CSBeginSendEventFunctionPtr ptr)
  47. {
  48. CSBeginSendEvent_ = ptr;
  49. }
  50. }