unit_preview_api.vala 506 B

123456789101112131415161718192021
  1. /*
  2. * Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
  3. * License: https://github.com/taylor001/crown/blob/master/LICENSE-GPLv2
  4. */
  5. namespace Crown
  6. {
  7. namespace UnitPreviewApi
  8. {
  9. const string[] _placeables =
  10. {
  11. "unknown",
  12. "core/units/sound",
  13. };
  14. public string set_preview_unit(PlaceableType placeable_type, string name)
  15. {
  16. return "UnitPreview:set_preview_unit(\"%s\")".printf(placeable_type == PlaceableType.UNIT ? name : _placeables[(int)placeable_type]);
  17. }
  18. }
  19. }