engine_api.vala 769 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2012-2017 Daniele Bartolini and individual contributors.
  3. * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
  4. */
  5. namespace Crown
  6. {
  7. namespace EngineApi
  8. {
  9. public string compile(Guid id, string data_dir, string platform)
  10. {
  11. return "{\"type\":\"compile\",\"id\":\"%s\",\"data_dir\":\"%s\",\"platform\":\"%s\"}".printf(id.to_string()
  12. , data_dir.replace("\\", "\\\\").replace("\"", "\\\"")
  13. , platform
  14. );
  15. }
  16. public string reload(string type, string name)
  17. {
  18. return "{\"type\":\"reload\",\"resource_type\":\"%s\",\"resource_name\":\"%s\"}".printf(type, name);
  19. }
  20. public string pause()
  21. {
  22. return "{\"type\":\"pause\"}";
  23. }
  24. public string unpause()
  25. {
  26. return "{\"type\":\"unpause\"}";
  27. }
  28. }
  29. }