<?xml version="1.0" encoding="UTF-8"?>

<!-- Definition of the boolean enum values -->
<!ENTITY % boolean "(false|true)">
<!ELEMENT true EMPTY>
<!ELEMENT false EMPTY>

<!-- Definition of the loop mode enum values -->
<!ELEMENT pingpong EMPTY>

<!-- Definition of some base types... -->
<!ENTITY % integer "CDATA" >
<!ENTITY % real "CDATA" >

<!ELEMENT resources (author, alias+, sprite+, clothe+, movement+)>

<!-- Author part -->
<!ELEMENT author (name,nickname?,email,country?)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT nickname (#PCDATA)>
<!ELEMENT email (#PCDATA)>
<!ELEMENT country (#PCDATA)>

<!-- sprite -->
<!ELEMENT sprite (image, anchor?, animation?, (attached+)? )>
<!ATTLIST sprite
          name CDATA #REQUIRED
          type CDATA #REQUIRED
          go_through_ground %boolean; #IMPLIED>

<!ELEMENT image (grid?)>
<!ATTLIST image file CDATA #REQUIRED>
<!ELEMENT grid EMPTY>
<!ATTLIST grid
          pos CDATA #REQUIRED
          size CDATA #REQUIRED
          array CDATA #REQUIRED>

<!ELEMENT animation EMPTY>
<!ATTLIST animation
          speed %integer; #IMPLIED
          loop_wait %integer; #IMPLIED
          loop_wait_random %integer; #IMPLIED
          loop_mode (pingpong) #IMPLIED >

<!ELEMENT anchor EMPTY>
<!ATTLIST anchor
          dx %integer; #REQUIRED
          dy %integer; #REQUIRED>

<!ELEMENT attached EMPTY>
<!ATTLIST attached
          member_type CDATA #REQUIRED
          dx %integer; #REQUIRED
          dy %integer; #REQUIRED
          frame CDATA #IMPLIED>

<!-- clothe -->
<!ELEMENT clothe (c_member+)>
<!ATTLIST clothe
          name CDATA #REQUIRED
          layer %integer; #IMPLIED>

<!ELEMENT c_member EMPTY>
<!ATTLIST c_member
          name CDATA #REQUIRED
          layer CDATA #IMPLIED>

<!-- alias -->
<!ELEMENT alias EMPTY>
<!ATTLIST alias
          movement CDATA #REQUIRED
          correspond_to CDATA #IMPLIED>

<!-- movement -->
<!ELEMENT movement (collision_rect, frame+)>
<!ATTLIST movement
          name CDATA #REQUIRED
          duration_per_frame %integer; #REQUIRED
          nb_loops %integer; #IMPLIED
          play_mode (play_once|loop) "loop">

<!ELEMENT collision_rect EMPTY>
<!ATTLIST collision_rect
          left %integer; #REQUIRED
          right %integer; #REQUIRED
          top %integer; #REQUIRED
          bottom %integer; #REQUIRED>

<!ELEMENT frame (member+)>
<!ATTLIST frame number %integer; #IMPLIED>

<!ELEMENT member EMPTY>
<!ATTLIST member
          type CDATA #REQUIRED
          dx %integer; #IMPLIED
          dy %integer; #IMPLIED
          scale_x %real; #IMPLIED
          scale_y %real; #IMPLIED
          angle %integer; #IMPLIED
          follow_crosshair %boolean; #IMPLIED
          follow_half_crosshair %boolean; #IMPLIED
          follow_speed %boolean; #IMPLIED
          follow_direction CDATA #IMPLIED
          follow_cursor %boolean; #IMPLIED
          follow_cursor_limit %integer; #IMPLIED>
