]> git.lizzy.rs Git - nothing.git/blobdiff - devtools/svg2rects.xqe
(#408) use stdbool in camera unit
[nothing.git] / devtools / svg2rects.xqe
index b360eb3b74cb8a814420760ffc94aa6aef4f518a..e944b9424f57ccfa3035f8b254628f5ddd09078d 100644 (file)
@@ -65,7 +65,11 @@ let $backplatforms := for $rect in $rects where matches($rect/@id, "^backrect.*"
     $rect/@height, " ",
     replace($rect/@style, ".*fill:#([0-9a-z]{6}).*", "$1")
   )
-return (
+return if (count($player) = 0) then (
+  error(QName('', 'ERROR'), 'Position of the Player is not defined. Create a rectangle with id "player"')
+) else if (count($background) = 0) then (
+  error(QName('', 'ERROR'), 'Color of the Background is not defined. Create a rectangle with id "background"')
+) else (
   $background,
   $player,
   count($platforms),