• My Pages
  • Comments
  • Add Link
  • Subscribe
  • Subscribe User
  • Edit (GUI)
  • Edit (Text)
  • Rename Page
  • Copy Page
  • Load Page
  • Save Page
  • Delete Page
  • Attachments
  • Check Spelling
  • Diffs
  • Info
  • Revert to this revision
  • XML
  • Render as Docbook
  • Print View
  • Raw Text
  • Delete Cache
  • Like Pages
  • Local Site Map
  • Remove Spam
  • Package Pages
  • Sync Pages
    • Diff for "getTravelTime"
    Differences between revisions 2 and 3
    Revision 2 as of 2013-07-31 05:25:48
    Size: 1077
    Editor: tech
    Comment:
    Revision 3 as of 2013-07-31 05:26:15
    Size: 1091
    Editor: tech
    Comment:
    Deletions are marked like this. Additions are marked like this.
    Line 4: Line 4:
    Line 9: Line 8:
    == example: ==
    coords="123,456" targetId = GetFieldId(coords) troops = "s:100k"
    Line 10: Line 11:
    == example: == troopBean = GetTroops(troops) // converts troop string into troopBean object
    Line 12: Line 13:
    coords="123,456"
    targetId = GetFieldId(coords)
    troops = "s:100k"
    transTime = city.getTravelTime(city.fieldId, targetId, troopBean, 2) // returns time to transport or reinforce target coords in seconds - from point A (city.fieldId) to point B (targetId) using specified troopBean
    Line 16: Line 15:
    troopBean = GetTroops(troops)
    // converts troop string into troopBean object

    transTime = city.getTravelTime(city.fieldId, targetId, troopBean, 2)
    // returns time to transport or reinforce target coords in seconds - from point A (city.fieldId) to point B (targetId) using specified troopBean

    attackTime = city.getTravelTime(city.fieldId, targetId, troopBean, 5)
    // returns time to send attack or scout to targeth coords in seconds - from point A (city.fieldId) to point B (targetId) using specified troopBean
    attackTime = city.getTravelTime(city.fieldId, targetId, troopBean, 5) // returns time to send attack or scout to targeth coords in seconds - from point A (city.fieldId) to point B (targetId) using specified troopBean
    ----
    CategoryFunctions

    this function will return the time in seconds it takes to march from point A to point B using a particular type of troops

    usage:

    city.getTravelTime(fieldId1,fieldId2,troopBean,type)

    fieldId1 and fieldId2 are the fieldId's which represent coordinates for point A and B, troopBean is a special object representing a single wave of troops of any type or combination, and type can be 2 for transport or reinforcement waves or 5 for attack or scout waves.

    example:

    coords="123,456" targetId = GetFieldId(coords) troops = "s:100k"

    troopBean = GetTroops(troops) // converts troop string into troopBean object

    transTime = city.getTravelTime(city.fieldId, targetId, troopBean, 2) // returns time to transport or reinforce target coords in seconds - from point A (city.fieldId) to point B (targetId) using specified troopBean

    attackTime = city.getTravelTime(city.fieldId, targetId, troopBean, 5) // returns time to send attack or scout to targeth coords in seconds - from point A (city.fieldId) to point B (targetId) using specified troopBean


    CategoryFunctions

    getTravelTime (last edited 2014-02-10 18:28:49 by Inanna)