This project is read-only.

API

The API enables you to access easily to the map and the kings.



Note : Currently, only non authenticated content can be accessed (map with Id of the king and kings). You can neither see troops numbers nor send troops.

Conventions

When there is written "x1_x2", you can write for example :
  • 1 (means 1)
  • or 1_5 (means 1, 2, 3, 4 and 5)

Map

  • Command : http://sqwareaapi.cloudapp.net/map/x1_x2/y1_y2
  • Description : Retrieve squares in (x1,y1) - (x2,y2) rectangle (or (x1,y1) square)
  • Restrictions : 0 <= x2 - x1 < 20, 0 <= y2 - y1 < 20
  • Return : Example : http://sqwareaapi.cloudapp.net/map/10_11/10_10
<squares>
  <square>
    <x>10</x>
    <y>10</y>
    <king>8</king>
  </square>
  <square>
    <x>11</x>
    <y>10</y>
    <king>8</king>
  </square>
</squares>
  • Notes :
    • it's better and faster when x1 and y1 are multiple of 20.
    • WARNING : when king is is 0, the square is neutral BUT a square can be neutral even if king id is not 0. To know if a square is neutral, please retrieve the corresponding king and look at "neutral" property.

Kings

  • Command : http://sqwareaapi.cloudapp.net/kings/id1_id2
  • Description : Retrieve kings from id id1 to id2
  • Restrictions : 0 <= id2 - id1 < 10
  • Return :
    • neutral : true if and only if the king is neutral
    • squares : number of squares of the kingdom
Example : http://sqwareaapi.cloudapp.net/kings/10_11
<kings>
  <king>
    <id>10</id>
    <neutral>true</neutral>
    <nickname/>
    <squares/>
  </king>
  <king>
    <id>11</id>
    <neutral>false</neutral>
    <nickname>Mc...</nickname>
    <squares>1</squares>
  </king>
</kings>

Last edited Jun 29, 2010 at 5:16 PM by fabrice102, version 4

Comments

No comments yet.