[
  {
    "path": ".gitignore",
    "content": "#built application files\n*.apk\n*.ap_\n\n# files for the dex VM\n*.dex\n\n# Java class files\n*.class\n\n# generated files\nbin/\ngen/\nbuild/\napp/build/\n\n# Local configuration file (sdk path, etc)\nlocal.properties\n\n# Windows thumbnail db\nThumbs.db\n\n# OSX files\n.DS_Store\n\n# Eclipse project files\n.classpath\n.project\n\n# Android Studio project files\n.idea/workspace.xml\n.gradle\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"dependencies/fplutil\"]\n\tpath = dependencies/fplutil\n\turl = http://github.com/google/fplutil.git\n"
  },
  {
    "path": ".idea/.name",
    "content": "ExampleGame"
  },
  {
    "path": ".idea/compiler.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"CompilerConfiguration\">\n    <option name=\"DEFAULT_COMPILER\" value=\"Javac\" />\n    <resourceExtensions />\n    <wildcardResourcePatterns>\n      <entry name=\"!?*.java\" />\n      <entry name=\"!?*.form\" />\n      <entry name=\"!?*.class\" />\n      <entry name=\"!?*.groovy\" />\n      <entry name=\"!?*.scala\" />\n      <entry name=\"!?*.flex\" />\n      <entry name=\"!?*.kt\" />\n      <entry name=\"!?*.clj\" />\n    </wildcardResourcePatterns>\n    <annotationProcessing>\n      <profile default=\"true\" name=\"Default\" enabled=\"false\">\n        <processorPath useClasspath=\"true\" />\n      </profile>\n    </annotationProcessing>\n  </component>\n</project>\n\n"
  },
  {
    "path": ".idea/copyright/Apache_2_0.xml",
    "content": "<component name=\"CopyrightManager\">\n  <copyright>\n    <option name=\"notice\" value=\"Copyright 2015 Google Inc. All Rights Reserved.&#10;&#10;Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10;you may not use this file except in compliance with the License.&#10;You may obtain a copy of the License at&#10;&#10;    http://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10;See the License for the specific language governing permissions and&#10;limitations under the License.\" />\n    <option name=\"keyword\" value=\"Copyright\" />\n    <option name=\"allowReplaceKeyword\" value=\"\" />\n    <option name=\"myName\" value=\"Apache 2.0\" />\n    <option name=\"myLocal\" value=\"true\" />\n  </copyright>\n</component>"
  },
  {
    "path": ".idea/copyright/profiles_settings.xml",
    "content": "<component name=\"CopyrightManager\">\n  <settings default=\"Apache 2.0\" />\n</component>"
  },
  {
    "path": ".idea/encodings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"Encoding\" useUTFGuessing=\"true\" native2AsciiForPropertiesFiles=\"false\" />\n</project>\n\n"
  },
  {
    "path": ".idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"distributionType\" value=\"LOCAL\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"gradleHome\" value=\"$APPLICATION_HOME_DIR$/gradle/gradle-2.2.1\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/app\" />\n          </set>\n        </option>\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>\n\n"
  },
  {
    "path": ".idea/libraries/appcompat_v7_21_0_3.xml",
    "content": "<component name=\"libraryTable\">\n  <library name=\"appcompat-v7-21.0.3\">\n    <CLASSES>\n      <root url=\"file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/res\" />\n      <root url=\"jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/classes.jar!/\" />\n    </CLASSES>\n    <JAVADOC />\n    <SOURCES />\n  </library>\n</component>"
  },
  {
    "path": ".idea/libraries/junit_3_8.xml",
    "content": "<component name=\"libraryTable\">\n  <library name=\"junit-3.8\">\n    <CLASSES>\n      <root url=\"jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/junit/junit/3.8/b4cd87d6abbc43078ffc915c7181e4c8961e5b7b/junit-3.8.jar!/\" />\n    </CLASSES>\n    <JAVADOC />\n    <SOURCES />\n  </library>\n</component>"
  },
  {
    "path": ".idea/libraries/play_services_6_1_71.xml",
    "content": "<component name=\"libraryTable\">\n  <library name=\"play-services-6.1.71\">\n    <CLASSES>\n      <root url=\"file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services/6.1.71/res\" />\n      <root url=\"jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.google.android.gms/play-services/6.1.71/classes.jar!/\" />\n    </CLASSES>\n    <JAVADOC />\n    <SOURCES />\n  </library>\n</component>"
  },
  {
    "path": ".idea/libraries/support_annotations_21_0_3.xml",
    "content": "<component name=\"libraryTable\">\n  <library name=\"support-annotations-21.0.3\">\n    <CLASSES>\n      <root url=\"jar://$USER_HOME$/projects/android-sdk/extras/android/m2repository/com/android/support/support-annotations/21.0.3/support-annotations-21.0.3.jar!/\" />\n    </CLASSES>\n    <JAVADOC />\n    <SOURCES>\n      <root url=\"jar://$USER_HOME$/projects/android-sdk/extras/android/m2repository/com/android/support/support-annotations/21.0.3/support-annotations-21.0.3-sources.jar!/\" />\n    </SOURCES>\n  </library>\n</component>"
  },
  {
    "path": ".idea/libraries/support_v4_21_0_3.xml",
    "content": "<component name=\"libraryTable\">\n  <library name=\"support-v4-21.0.3\">\n    <CLASSES>\n      <root url=\"file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.3/res\" />\n      <root url=\"jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.3/classes.jar!/\" />\n      <root url=\"jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.3/libs/internal_impl-21.0.3.jar!/\" />\n    </CLASSES>\n    <JAVADOC />\n    <SOURCES>\n      <root url=\"jar://$USER_HOME$/projects/android-sdk/extras/android/m2repository/com/android/support/support-v4/21.0.3/support-v4-21.0.3-sources.jar!/\" />\n    </SOURCES>\n  </library>\n</component>"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"EntryPointsManager\">\n    <entry_points version=\"2.0\" />\n  </component>\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_7\" assert-keyword=\"true\" jdk-15=\"true\" project-jdk-name=\"1.7\" project-jdk-type=\"JavaSDK\">\n    <output url=\"file://$PROJECT_DIR$/build/classes\" />\n  </component>\n</project>\n\n"
  },
  {
    "path": ".idea/modules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n      <module fileurl=\"file://$PROJECT_DIR$/ExampleGame.iml\" filepath=\"$PROJECT_DIR$/ExampleGame.iml\" />\n      <module fileurl=\"file://$PROJECT_DIR$/app/app.iml\" filepath=\"$PROJECT_DIR$/app/app.iml\" />\n    </modules>\n  </component>\n</project>\n\n"
  },
  {
    "path": ".idea/scopes/scope_settings.xml",
    "content": "<component name=\"DependencyValidationManager\">\n  <state>\n    <option name=\"SKIP_IMPORT_STATEMENTS\" value=\"false\" />\n  </state>\n</component>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"\" vcs=\"\" />\n  </component>\n</project>\n\n"
  },
  {
    "path": "CONTRIBUTING",
    "content": "Contributing    {#contributing}\n============\n\nWant to contribute? Great! First, read this page (including the small print at\nthe end).\n\n# Before you contribute\nBefore we can use your code, you must sign the\n[Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1)\n(CLA), which you can do online. The CLA is necessary mainly because you own the\ncopyright to your changes, even after your contribution becomes part of our\ncodebase, so we need your permission to use and distribute your code. We also\nneed to be sure of various other things—for instance that you'll tell us if you\nknow that your code infringes on other people's patents. You don't have to sign\nthe CLA until after you've submitted your code for review and a member has\napproved it, but you must do it before we can put your code into our codebase.\nBefore you start working on a larger contribution, you should get in touch with\nus first through the issue tracker with your idea so that we can help out and\npossibly guide you. Coordinating up front makes it much easier to avoid\nfrustration later on.\n\n# Code reviews\nAll submissions, including submissions by project members, require review. We\nuse Github pull requests for this purpose.\n\n# The small print\nContributions made by corporations are covered by a different agreement than\nthe one above, the Software Grant and Corporate Contributor License Agreement.\n"
  },
  {
    "path": "ExampleGame.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.path=\"$MODULE_DIR$\" external.root.project.path=\"$MODULE_DIR$\" external.system.id=\"GRADLE\" external.system.module.group=\"\" external.system.module.version=\"unspecified\" type=\"JAVA_MODULE\" version=\"4\">\n  <component name=\"FacetManager\">\n    <facet type=\"java-gradle\" name=\"Java-Gradle\">\n      <configuration>\n        <option name=\"BUILD_FOLDER_PATH\" value=\"$MODULE_DIR$/build\" />\n      </configuration>\n    </facet>\n  </component>\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <excludeFolder url=\"file://$MODULE_DIR$/.gradle\" />\n    </content>\n    <orderEntry type=\"inheritedJdk\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n  </component>\n</module>\n\n"
  },
  {
    "path": "LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "app/app.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.path=\"$MODULE_DIR$\" external.root.project.path=\"$MODULE_DIR$/..\" external.system.id=\"GRADLE\" external.system.module.group=\"ExampleGame\" external.system.module.version=\"unspecified\" type=\"JAVA_MODULE\" version=\"4\">\n  <component name=\"FacetManager\">\n    <facet type=\"android-gradle\" name=\"Android-Gradle\">\n      <configuration>\n        <option name=\"GRADLE_PROJECT_PATH\" value=\":app\" />\n      </configuration>\n    </facet>\n    <facet type=\"android\" name=\"Android\">\n      <configuration>\n        <option name=\"SELECTED_BUILD_VARIANT\" value=\"debug\" />\n        <option name=\"SELECTED_TEST_ARTIFACT\" value=\"_android_test_\" />\n        <option name=\"ASSEMBLE_TASK_NAME\" value=\"assembleDebug\" />\n        <option name=\"COMPILE_JAVA_TASK_NAME\" value=\"compileDebugSources\" />\n        <option name=\"ASSEMBLE_TEST_TASK_NAME\" value=\"assembleDebugTest\" />\n        <option name=\"SOURCE_GEN_TASK_NAME\" value=\"generateDebugSources\" />\n        <option name=\"TEST_SOURCE_GEN_TASK_NAME\" value=\"generateDebugTestSources\" />\n        <option name=\"ALLOW_USER_CONFIGURATION\" value=\"false\" />\n        <option name=\"MANIFEST_FILE_RELATIVE_PATH\" value=\"/src/main/AndroidManifest.xml\" />\n        <option name=\"RES_FOLDER_RELATIVE_PATH\" value=\"/src/main/res\" />\n        <option name=\"RES_FOLDERS_RELATIVE_PATH\" value=\"file://$MODULE_DIR$/src/main/res\" />\n        <option name=\"ASSETS_FOLDER_RELATIVE_PATH\" value=\"/src/main/assets\" />\n      </configuration>\n    </facet>\n  </component>\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"false\">\n    <output url=\"file://$MODULE_DIR$/build/intermediates/classes/debug\" />\n    <output-test url=\"file://$MODULE_DIR$/build/intermediates/classes/test/debug\" />\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/r/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/aidl/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/buildConfig/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/rs/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/rs/debug\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/generated/debug\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/r/test/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/aidl/test/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/buildConfig/test/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/rs/test/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/rs/test/debug\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/generated/test/debug\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/res\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/resources\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/assets\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/aidl\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/java\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/jni\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/rs\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/res\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/resources\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/assets\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/aidl\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/java\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/jni\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/rs\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/res\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/resources\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/assets\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/aidl\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/java\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/jni\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/rs\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/assets\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/bundles\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/classes\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/dependency-cache\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/dex\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/dex-cache\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/incremental\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/jacoco\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/javaResources\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/libs\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/lint\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/manifests\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/ndk\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/pre-dexed\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/proguard\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/res\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/rs\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/symbols\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/outputs\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/tmp\" />\n    </content>\n    <orderEntry type=\"jdk\" jdkName=\"Android API 21 Platform\" jdkType=\"Android SDK\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"appcompat-v7-21.0.3\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-annotations-21.0.3\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-v4-21.0.3\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"junit-3.8\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"play-services-6.1.71\" level=\"project\" />\n  </component>\n</module>\n\n"
  },
  {
    "path": "app/build.gradle",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\napply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 21\n    buildToolsVersion \"19.1\"\n\n    defaultConfig {\n        applicationId \"com.google.fpl.gim.examplegame\"\n        minSdkVersion 16\n        targetSdkVersion 21\n        versionCode 1\n        versionName \"1.0\"\n    }\n    buildTypes {\n    }\n}\n\nrepositories {\n    mavenCentral()\n    flatDir {\n        dirs 'libs'\n    }\n}\n\ndependencies {\n    compile group: 'junit', name: 'junit', version: '3.8'\n    compile 'com.android.support:appcompat-v7:21.+'\n    compile 'com.google.android.gms:play-services:6.1.+'\n}"
  },
  {
    "path": "app/src/androidTest/java/com/google/fpl/gim/examplegame/MissionParseTest.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport com.google.fpl.gim.examplegame.utils.MissionParseException;\nimport com.google.fpl.gim.examplegame.utils.MissionParser;\nimport com.google.fpl.gim.examplegame.utils.Utils;\n\nimport junit.framework.Assert;\nimport junit.framework.TestCase;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\n/**\n * Tests the functionality of mission parsing from XML.\n */\npublic class MissionParseTest extends TestCase {\n\n    private static final String TAG = MissionParseTest.class.getSimpleName();\n\n    private Mission mMission;\n    private MissionData mMissionData;\n\n    public void setUp() {\n        Utils.logDebug(TAG, \"Setting up...\");\n        // Set up mission data that will be used for every test case\n        String missionId = \"Mission 1\";\n        float lengthOfGameMinutes = 30f; // 30-minute game\n        float lengthOfIntervalMinutes = 1f; // 1-minute intervals\n        float challengePaceMinutesPerMile = 8.0f;\n        mMissionData = new MissionData(missionId, missionId, lengthOfGameMinutes,\n                lengthOfIntervalMinutes, challengePaceMinutesPerMile);\n    }\n\n    public void tearDown() {\n        Utils.logDebug(TAG, \"Tearing down...\");\n    }\n\n    /**\n     * Test for correct construction of a timer moment.\n     */\n    public void testTimerMomentConstruction() {\n        String xml = \"\";\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createTimerMomentXml(                // <moment type=\"timer\"> [...]\n                \"start\",                            // Moment id.\n                \"start\",                            // Next moment id.\n                0.5);                               // Length of timer moment (minutes).\n                                                    // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream momentInputStream =\n                new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n        }\n\n        Assert.assertEquals(\"Mission 1\", mMissionData.getMissionId());\n        Assert.assertEquals(1, mMissionData.getNumMoments());\n        Assert.assertEquals(true, mMissionData.getMomentFromId(\"start\") instanceof TimerMoment);\n        Assert.assertEquals(\"start\", mMissionData.getMomentFromId(\"start\").getNextMomentId());\n    }\n\n    /**\n     * Test for correct construction of a choice moment.\n     */\n    public void testChoiceMomentConstruction() {\n        String xml = \"\";\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createStartChoiceMomentXml(          // <moment type=\"choice\"> [...]\n                \"start\",                            // Moment id.\n                0.5,                                // Length of choice timeout in minutes.\n                \"Example ChoiceMoment Description\", // Description of choice moment.\n                \"choice_2\");                        // Id of default choice.\n\n        xml += createChoiceXml(                     // <choice> [...]\n                \"fire\",                             // Choice id.\n                \"Example Choice Description 1\",     // Description of choice.\n                \"start\",                            // Next moment id.\n                true,                               // Whether the weapon charge should be depleted\n                false,                              // Whether the number of enemies defeated should\n                                                    //    be incremented.\n                \"test_icon\");                       // Icon resource name.\n                                                    // </choice>\n\n        xml += createChoiceXml(                     // <choice> [...]\n                \"choice_2\",                         // Choice id.\n                \"Example Choice Description 2\",     // Description of choice.\n                \"start\",                            // Next moment id.\n                false,                              // Whether the weapon charge should be depleted\n                false,                              // Whether the number of enemies defeated should\n                                                    //    be incremented.\n                \"test_icon\");                       // Icon resource name.\n                                                    // </choice>\n\n        xml += createChoiceXml(                     // <choice> [...]\n                \"choice_3\",                         // Choice id.\n                \"Example Choice Description 3\",     // Description of choice.\n                \"start\",                            // Next moment id.\n                true,                               // Whether the weapon charge should be depleted\n                false,                              // Whether the number of enemies defeated should\n                                                    //    be incremented.\n                \"test_icon\");                       // Icon resource name.\n                                                    // </choice>\n\n        xml += createEndChoiceMomentXml();          // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        Utils.logDebug(TAG, xml);\n\n        InputStream momentInputStream =\n                new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n        }\n\n        Assert.assertEquals(\"Mission 1\", mMissionData.getMissionId());\n        Assert.assertEquals(1, mMissionData.getNumMoments());\n        Assert.assertEquals(true, mMissionData.getMomentFromId(\"start\") instanceof ChoiceMoment);\n\n        ChoiceMoment choiceMoment = ((ChoiceMoment) mMissionData.getMomentFromId(\"start\"));\n        Assert.assertEquals(3, choiceMoment.getMomentData().getNumChoices());\n\n        Choice choice1 = choiceMoment.getMomentData().getChoiceById(\"choice_2\");\n        Assert.assertEquals(\"Example Choice Description 2\", choice1.getDescription());\n        Assert.assertEquals(\"start\", choice1.getNextMomentId());\n        Assert.assertEquals(false, choice1.getOutcome().weaponChargeDepleted());\n        Assert.assertEquals(false, choice1.getOutcome().numEnemiesDefeatedIncremented());\n        Assert.assertEquals(\"test_icon\", choice1.getDrawableResourceName());\n        Assert.assertEquals(null, mMissionData.getMomentFromId(\"start\").getNextMomentId());\n    }\n\n    /**\n     * Test for correct construction of an sfx moment.\n     */\n    public void testSfxMomentConstruction() {\n        String xml = \"\";\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createSfxMomentXml(                  // <moment type=\"sfx\"> [...]\n                \"start\",                            // Moment id.\n                \"start\",                            // Next moment id.\n                \"path/to/something\");               // Path to sound effect resource.\n                                                    // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream momentInputStream = new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n        }\n\n        Assert.assertEquals(\"Mission 1\", mMissionData.getMissionId());\n        Assert.assertEquals(1, mMissionData.getNumMoments());\n        Assert.assertEquals(true, mMissionData.getMomentFromId(\"start\") instanceof SfxMoment);\n        Assert.assertEquals(\"start\", mMissionData.getMomentFromId(\"start\").getNextMomentId());\n    }\n\n    /**\n     * Test for correct construction of a spoken text moment.\n     */\n    public void testSpokenTextMomentConstruction() {\n        String xml = \"\";\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createSpokenTextMomentXml(           // <moment type=\"spoken_text\"> [...]\n                \"start\",                            // Moment id.\n                \"start\",                            // Next moment id.\n                \"Hello!\");                          // Text to speak out loud.\n                                                    // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream momentInputStream =\n                new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n        }\n\n        Assert.assertEquals(\"Mission 1\", mMissionData.getMissionId());\n        Assert.assertEquals(1, mMissionData.getNumMoments());\n        Assert.assertEquals(true,\n                mMissionData.getMomentFromId(\"start\") instanceof SpokenTextMoment);\n        Assert.assertEquals(\"start\", mMissionData.getMomentFromId(\"start\").getNextMomentId());\n    }\n\n    /**\n     * Test for correct construction of a mission with four different types of moments.\n     */\n    public void testFourMomentConstruction() {\n        String xml = \"\";\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createSpokenTextMomentXml(           // <moment type=\"spoken_text\"> [...]\n                \"start\",                            // Moment id.\n                \"second\",                           // Next moment id.\n                \"Hello!\");                          // Text to speak out loud.\n                                                    // </moment>\n\n        xml += createSfxMomentXml(                  // <moment type=\"sfx\"> [...]\n                \"second\",                           // Moment id.\n                \"third\",                            // Next moment id.\n                \"path/to/something\");               // Path to sound effect resource.\n                                                    // </moment>\n\n        xml += createStartChoiceMomentXml(          // <moment type=\"choice\"> [...]\n                \"third\",                            // Moment id.\n                0.5,                                // Length of choice timeout in minutes.\n                \"Example ChoiceMoment Description\", // Description of choice moment.\n                \"choice_2\");                        // Id of default choice.\n        xml += createChoiceXml(                     // <choice> [...]\n                \"fire\",                             // Choice id.\n                \"Example Choice Description 1\",     // Description of choice.\n                \"fourth\",                            // Next moment id.\n                true,                               // Whether the weapon charge should be depleted\n                false,                              // Whether the number of enemies defeated should\n                                                    //    be incremented.\n                \"test_icon\");                       // Icon resource name.\n                                                    // </choice>\n        xml += createChoiceXml(                     // <choice> [...]\n                \"choice_2\",                         // Choice id.\n                \"Example Choice Description 2\",     // Description of choice.\n                \"fourth\",                           // Next moment id.\n                false,                              // Whether the weapon charge should be depleted\n                false,                              // Whether the number of enemies defeated should\n                                                    //    be incremented.\n                \"test_icon\");                       // Icon resource name.\n                                                    // </choice>\n        xml += createEndChoiceMomentXml();          // </moment>\n\n        xml += createTimerMomentXml(                // <moment type=\"timer\"> [...]\n                \"fourth\",                           // Moment id.\n                null,                               // Next moment id.\n                0.25);                              // Length of timer moment (minutes).\n                                                    // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream momentInputStream = new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n        }\n\n        Assert.assertEquals(\"Mission 1\", mMissionData.getMissionId());\n        Assert.assertEquals(4, mMissionData.getNumMoments());\n\n        Moment spokenTextMoment = mMissionData.getMomentFromId(\"start\");\n        Moment sfxMoment = mMissionData.getMomentFromId(\"second\");\n        Moment choiceMoment = mMissionData.getMomentFromId(\"third\");\n        Moment timerMoment = mMissionData.getMomentFromId(\"fourth\");\n\n        Assert.assertEquals(true, spokenTextMoment instanceof SpokenTextMoment);\n        Assert.assertEquals(true, sfxMoment instanceof SfxMoment);\n        Assert.assertEquals(true, choiceMoment instanceof ChoiceMoment);\n        Assert.assertEquals(true, timerMoment instanceof TimerMoment);\n\n        SpokenTextMoment moment1 = (SpokenTextMoment) spokenTextMoment;\n        SfxMoment moment2 = (SfxMoment) sfxMoment;\n        ChoiceMoment moment3 = (ChoiceMoment) choiceMoment;\n        TimerMoment moment4 = (TimerMoment) timerMoment;\n\n        Assert.assertEquals(\"second\", moment1.getNextMomentId());\n        Assert.assertEquals(\"third\", moment2.getNextMomentId());\n        // The next ID of a ChoiceMoment is null until the user has made their choice.\n        Assert.assertEquals(null, moment3.getNextMomentId());\n        Assert.assertEquals(\"fourth\", moment3.getMomentData().getChoices()[0].getNextMomentId());\n        // The final moment has a 'null' next moment.\n        Assert.assertEquals(null, moment4.getNextMomentId());\n\n        Assert.assertEquals(true, moment3.getMomentData().getChoiceById(\"fire\")\n                .requiresChargedWeapon());\n        Assert.assertEquals(false, moment3.getMomentData().getChoiceById(\"choice_2\")\n                .requiresChargedWeapon());\n    }\n\n    /**\n     * Test for correct error handling with a moment has an invalid 'type'.\n     */\n    public void testMomentWithInvalidTypeErrorHandling() {\n        String xml = \"\";\n\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createStartMomentXml(                // <moment> [...]\n                \"invalid\",                          // Moment type is invalid.\n                \"start\");                           // Moment id.\n        xml += createNextMomentXml(\"start\");        // Next moment id.\n        xml += createLengthMinutesXml(0.25);        // Length of (timer) moment in minutes.\n        xml += createEndMomentXml();                // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream momentInputStream = new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        boolean didMissionParseFail = false;\n\n\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            didMissionParseFail = true;\n        }\n\n        Assert.assertEquals(true, didMissionParseFail);\n    }\n\n    /**\n     * Test for correct error handling with a moment has no 'type' attribute.\n     */\n    public void testMomentWithNoTypeErrorHandling() {\n        String xml = \"\";\n\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += \"<moment \" +                         // <moment> [...]\n                \"id='start' >\";                     // Moment id. Moment type is missing.\n        xml += createNextMomentXml(\"start\");        // Next moment id.\n        xml += createLengthMinutesXml(0.25);        // Length of (timer) moment in minutes.\n        xml += createEndMomentXml();                // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream momentInputStream = new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        boolean didMissionParseFail = false;\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            didMissionParseFail = true;\n        }\n\n        Assert.assertEquals(true, didMissionParseFail);\n    }\n\n    /*\n    * Test for correct behavior when a moment has no 'next_moment' attribute (signifies that this\n    * moment is the final moment in the mission.)\n    */\n    public void testTimerMomentMissingNextMomentMission() {\n        String xml = \"\";\n\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Name of mission.\n\n        xml += createStartMomentXml(                // <moment> [...]\n                \"timer\",                            // Moment type.\n                \"start\");                           // Moment id.\n        xml += createLengthMinutesXml(0.25);        // Length of (timer) moment in minutes.\n\n        xml += createEndMomentXml();                // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream momentInputStream = new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n        }\n\n        Assert.assertEquals(\"Mission 1\", mMissionData.getMissionId());\n        Assert.assertEquals(1, mMissionData.getNumMoments());\n        Assert.assertEquals(true, mMissionData.getMomentFromId(\"start\") instanceof TimerMoment);\n        Assert.assertEquals(null, mMissionData.getMomentFromId(\"start\").getNextMomentId());\n    }\n\n    /**\n     * Test for correct reading of a mission name.\n     */\n    public void testMissionNameConstruction() {\n        String xml = \"\";\n\n        xml += createStartMissionXml(               // <mission> [...]\n                \"\",                                 // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream missionInputStream = new ByteArrayInputStream(xml.getBytes());\n        String missionName = null;\n        try {\n            missionName = MissionParser.getMissionName(missionInputStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n        }\n\n        Assert.assertEquals(\"Name\", missionName);\n    }\n\n    /**\n     * Test for correct error handling for a mission with no \"name\" attribute.\n     */\n    public void testMissingMissionNameHandling() {\n        String xml = \"\";\n\n        xml += \"<mission \" +                        // <mission> [...]\n                \"start_id='' >\";                    // First moment in mission. Mission name is\n                                                    // missing.\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream missionInputStream = new ByteArrayInputStream(xml.getBytes());\n        boolean didMissionNameParseFail = false;\n        try {\n            MissionParser.getMissionName(missionInputStream);\n        } catch (MissionParseException e) {\n            didMissionNameParseFail = true;\n        }\n\n        Assert.assertEquals(true, didMissionNameParseFail);\n    }\n\n    /**\n     * Test for correct parsing of fictional progress for a SpokenText moment.\n     */\n    public void testFictionalProgressSpokenTextMomentParsing() {\n        String xml = \"\";\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createSpokenTextMomentWithFictionalProgressXML(\n                                                    // <moment> [...]\n                \"start\",                            // Moment id.\n                null,                               // Next moment id.\n                \"Text to speak\",                    // Text to speak out loud.\n                \"Fictional progress.\");             // Fictional progress.\n                                                    // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream momentInputStream =\n                new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n        }\n\n        Assert.assertEquals(1, mMissionData.getMomentFromId(\"start\").getFictionalProgress().size());\n        Assert.assertEquals(\"Fictional progress.\",\n                mMissionData.getMomentFromId(\"start\").getFictionalProgress().get(0));\n    }\n\n    /**\n     * Test for correct parsing of fictional progress for a Timer moment.\n     */\n    public void testFictionalProgressTimerMomentParsing() {\n        String xml = \"\";\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createTimerMomentWithFictionalProgressXML(\n                                                    // <moment> [...]\n                \"start\",                            // Moment id.\n                null,                               // Next moment id.\n                1.0,                                // Length of timer moment (minutes).\n                \"Fictional progress.\");             // Fictional progress.\n                                                    // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream momentInputStream =\n                new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n        }\n\n        Assert.assertEquals(1, mMissionData.getMomentFromId(\"start\").getFictionalProgress().size());\n        Assert.assertEquals(\"Fictional progress.\",\n                mMissionData.getMomentFromId(\"start\").getFictionalProgress().get(0));\n    }\n\n    /**\n     * Test for correct parsing of fictional progress for an Sfx moment.\n     */\n    public void testFictionalProgressSfxMomentParsing() {\n        String xml = \"\";\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createSfxMomentWithFictionalProgressXML(\n                                                    // <moment> [...]\n                \"start\",                            // Moment id.\n                null,                               // Next moment id.\n                \"path/to/something\",                // Path to sound effect resource.\n                \"Fictional progress.\");             // Fictional progress.\n                                                    // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream momentInputStream =\n                new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n        }\n\n        Assert.assertEquals(1, mMissionData.getMomentFromId(\"start\").getFictionalProgress().size());\n        Assert.assertEquals(\"Fictional progress.\",\n                mMissionData.getMomentFromId(\"start\").getFictionalProgress().get(0));\n    }\n\n    /**\n     * Test for correct parsing of fictional progress for a Choice moment, and for correct parsing\n     * of fictional progress for Choices.\n     */\n    public void testFictionalProgressChoiceMomentParsing() {\n        String xml = \"\";\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createStartChoiceMomentWithFictionalProgressXML(\n                                                    // <moment> [...]\n                \"start\",                            // Moment id.\n                1.0,                                // Next moment id.\n                \"Choice Description\",               // Description of choice moment.\n                \"choice_2\",                         // Id of default choice.\n                \"Fictional progress.\");             // Fictional progress.\n\n        xml += createChoiceWithFictionalProgressXML(\n                                                    // <choice> [...]\n                \"fire\",                             // Choice id.\n                \"Example Choice Description 1\",     // Description of choice.\n                null,                               // Next moment id.\n                true,                               // Whether the weapon charge should be depleted.\n                false,                              // Whether the number of enemies defeated should\n                                                    //    be incremented.\n                \"Description 1\",                    // Fictional progress.\n                \"test_icon\");                       // Icon resource name.\n                                                    // </choice>\n\n        xml += createChoiceXml(                     // <choice> [...]\n                \"choice_2\",                         // Choice id.\n                \"Choice 2 description\",             // Description of choice.\n                null,                               // Next moment id.\n                false,                              // Whether the weapon charge should be depleted.\n                false,                              // Whether the number of enemies defeated should\n                //    be incremented.\n                \"test_icon\");                       // Icon resource name.\n                                                    // </choice>\n\n        xml += createEndMomentXml();                // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream momentInputStream =\n                new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n        }\n\n        ChoiceMoment choiceMoment = ((ChoiceMoment) mMissionData.getMomentFromId(\"start\"));\n\n        Choice fireChoice = choiceMoment.getMomentData().getChoiceById(\"fire\");\n        Assert.assertEquals(1, fireChoice.getFictionalProgress().size());\n        Assert.assertEquals(\"Description 1\", fireChoice.getFictionalProgress().get(0));\n\n        Choice choice2 = choiceMoment.getMomentData().getChoiceById(\"choice_2\");\n        Assert.assertEquals(0, choice2.getFictionalProgress().size());\n\n        Assert.assertEquals(1, mMissionData.getMomentFromId(\"start\").getFictionalProgress().size());\n        Assert.assertEquals(\"Fictional progress.\",\n                mMissionData.getMomentFromId(\"start\").getFictionalProgress().get(0));\n    }\n\n    /**\n     * Test for correct error handling for a fictional progress element that is empty.\n     */\n    public void testFictionalProgressErrorHandling() {\n        String xml = \"\";\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createTimerMomentWithFictionalProgressXML(\n                                                    // <moment> [...]\n                \"start\",                            // Moment id.\n                null,                               // Next moment id.\n                1.0,                                // Length of timer moment (minutes).\n                \"\");                                // Empty fictional progress.\n                                                    // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        InputStream momentInputStream = new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        boolean didMissionParseFail = false;\n\n\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            didMissionParseFail = true;\n        }\n\n        Assert.assertEquals(true, didMissionParseFail);\n    }\n\n    /**\n     * Test for correct error handling for a Choice that has no icon element.\n     */\n    public void testChoiceMissingIconErrorHandling() {\n        String xml = \"\";\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createStartChoiceMomentXml(          // <moment type=\"choice\"> [...]\n                \"start\",                            // Moment id.\n                0.5,                                // Length of choice timeout in minutes.\n                \"Example ChoiceMoment Description\", // Description of choice moment.\n                \"choice_2\");                        // Id of default choice.\n\n        xml += createChoiceXml(                     // <choice> [...]\n                \"fire\",                             // Choice id.\n                \"Example Choice Description 1\",     // Description of choice.\n                \"start\",                            // Next moment id.\n                true,                               // Whether the weapon charge should be depleted\n                false,                              // Whether the number of enemies defeated should\n                                                    //    be incremented.\n                \"test_icon\");                       // Icon resource name.\n                                                    // </choice>\n\n\n        xml += createChoiceXml(                     // <choice> [...]\n                \"choice_2\",                         // Choice id.\n                \"Example Choice Description 2\",     // Description of choice.\n                \"start\",                            // Next moment id.\n                false,                               // Whether the weapon charge should be depleted\n                false,                              // Whether the number of enemies defeated should\n                                                    //    be incremented.\n                null);                              // Missing icon element.\n                                                    // </choice>\n\n        xml += createEndChoiceMomentXml();          // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        Utils.logDebug(TAG, xml);\n\n        InputStream momentInputStream =\n                new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        boolean didMissionParseFail = false;\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n            didMissionParseFail = true;\n        }\n\n        Assert.assertEquals(true, didMissionParseFail);\n    }\n\n    /**\n     * Test for correct error handling for a Choice that has an empty icon element.\n     */\n    public void testChoiceEmptyIconErrorHandling() {\n        String xml = \"\";\n        xml += createStartMissionXml(               // <mission> [...]\n                \"start\",                            // First moment in mission.\n                \"Name\");                            // Mission name.\n\n        xml += createStartChoiceMomentXml(          // <moment type=\"choice\"> [...]\n                \"start\",                            // Moment id.\n                0.5,                                // Length of choice timeout in minutes.\n                \"Example ChoiceMoment Description\", // Description of choice moment.\n                \"choice_2\");                        // Id of default choice.\n\n        xml += createChoiceXml(                     // <choice> [...]\n                \"fire\",                             // Choice id.\n                \"Example Choice Description 1\",     // Description of choice.\n                \"start\",                            // Next moment id.\n                true,                               // Whether the weapon charge should be depleted\n                false,                              // Whether the number of enemies defeated should\n                                                    //    be incremented.\n                \"test_icon\");                       // Icon resource name.\n                                                    // </choice>\n\n        xml += createChoiceXml(                     // <choice> [...]\n                \"choice_2\",                             // Choice id.\n                \"Example Choice Description 2\",     // Description of choice.\n                \"start\",                            // Next moment id.\n                false,                              // Whether the weapon charge should be depleted\n                false,                              // Whether the number of enemies defeated should\n                                                    //    be incremented.\n                \"\");                                // Empty icon resource name.\n                                                    // </choice>\n\n\n        xml += createEndChoiceMomentXml();          // </moment>\n\n        xml += createEndChoiceMomentXml();          // </moment>\n\n        xml += createEndMissionXml();               // </mission>\n\n        Utils.logDebug(TAG, xml);\n\n        InputStream momentInputStream =\n                new ByteArrayInputStream(xml.getBytes());\n        mMission = new Mission(mMissionData);\n        boolean didMissionParseFail = false;\n        try {\n            mMission.readMoments(momentInputStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n            didMissionParseFail = true;\n        }\n\n        Assert.assertEquals(true, didMissionParseFail);\n    }\n\n    /**\n     * A helper function to create an XML string representing the start of a mission.\n     * @param startMomentId The id of the first moment in the mission.\n     * @param missionName The plain text name of the mission.\n     * @return An XML string of the following format:\n     *      <?xml version='1.0' encoding='utf-8'?>\n     *      <mission start_id=\"[startMomentId]\" name=\"[missionName]\">\n     */\n    private String createStartMissionXml(String startMomentId, String missionName) {\n        return \"<?xml version='1.0' encoding='utf-8'?>\" +\n               \"<mission \" +\n                \"start_id='\" + startMomentId + \"' \" +\n                \"name='\" + missionName + \"' >\";\n    }\n\n    /**\n     * A helper function to create an XML string representing the end of a mission.\n     * @return A mission XML end-tag: </mission>\n     */\n    private String createEndMissionXml() {\n        return \"</mission>\";\n    }\n\n    /**\n     * A helper function to create an XML string representing the start of a generic moment.\n     * @param momentType The type of moment to be created.\n     * @param momentId The unique id of this moment.\n     * @return An XML string of the following format:\n     *      <moment type=\"[momentType]\" id=\"[momentId]\">\n     */\n    private String createStartMomentXml(String momentType, String momentId) {\n        return  \"<moment \" +\n                \"type='\" + momentType + \"' \" +\n                \"id='\" + momentId + \"' >\";\n    }\n\n    /**\n     * A helper function to create an XML string representing the end of a moment.\n     * @return A moment XML end-tag: </moment>\n     */\n    private String createEndMomentXml() {\n        return \"</moment>\";\n    }\n\n    /**\n     * A helper function to create an XML string representing a timer moment.\n     * @param momentId The unique id of the moment.\n     * @param nextMomentId The id of the next moment if this choice is chosen.  Can be null if this\n     *                     moment is the last moment in the mission.\n     * @param lengthMinutes The length of the timer moment in minutes.\n     * @return An XML string of the following format:\n     *      <moment type=\"timer\" id=\"[momentId]\">\n     *          <next_moment id=\"[nextMomentId]\" />\n     *          <length_minutes>[lengthMinutes]</length_minutes>\n     *      </moment>\n     */\n    private String createTimerMomentXml(String momentId, String nextMomentId,\n                                        double lengthMinutes) {\n        String xml = \"\";\n\n        xml += createStartMomentXml(\"timer\", momentId);\n        xml += createNextMomentXml(nextMomentId);\n        xml += createLengthMinutesXml(lengthMinutes);\n        xml += createEndMomentXml();\n\n        return xml;\n    }\n\n    /**\n     * A helper function to create an XML string representing a 'next_moment id' attribute.\n     * All moment types can have 'next_moment id''s, and the lack of a 'next_moment id' signifies\n     * that the current moment is the last moment in the mission.\n     * @param nextMomentId The id of the next moment if this choice is chosen.  Can be null if this\n     *                     moment is the last moment in the mission.\n     * @return If 'nextMomentId' is null, return an empty string.  Otherwise, an XML string of the\n     * following format is returned:\n     *      <next_moment id=\"[nextMomentId]\" />\n     */\n    private String createNextMomentXml(String nextMomentId) {\n        if (nextMomentId == null) {\n            return \"\";\n        }\n        return \"<next_moment id='\" + nextMomentId + \"' />\";\n    }\n\n    /**\n     * A helper function to create an XML string representing the start of a choice moment.\n     * @param momentId The unique id of the moment.\n     * @param timeoutLengthMinutes The length of time in minutes after which the default choice\n     *                             should be chosen for the user.\n     * @param choiceDescription A meaningful, human-readable description of the choice to be made,\n     *                          which is most likely in the form of either a direct or indirect\n     *                          question.\n     * @param defaultChoiceId The id of the choice that should be chosen if the decision times out\n     *                        before the user has chosen their own choice.\n     * @return An XML string with the following format:\n     *      <moment type=\"choice\" id=\"[momentId]\">\n     *          <timeout_length_minutes>[timeoutLengthMinutes]</timeout_length_minutes>\n     *          <description>[choiceDescription]</description>\n     *          <default_choice id=\"[defaultChoiceId]\"/>\n     *      </moment>\n     */\n    private String createStartChoiceMomentXml(String momentId, double timeoutLengthMinutes,\n                                              String choiceDescription, String defaultChoiceId) {\n        String xml = \"\";\n\n        xml += createStartMomentXml(\"choice\", momentId);\n        xml += \"<timeout_length_minutes>\" + Double.toString(timeoutLengthMinutes)\n                + \"</timeout_length_minutes>\";\n        xml += \"<description>\" + choiceDescription + \"</description>\";\n        xml += \"<default_choice id='\" + defaultChoiceId + \"'/>\";\n\n        return xml;\n    }\n\n    /**\n     * A helper function to create an XML string representing a choice.  Choices are found within\n     * choice moments.\n     * @param choiceId The id of the choice.\n     * @param choiceDescription A meaningful, human-readable description of the choice.\n     * @param nextMomentId The id of the next moment if this choice is chosen.  Can be null if this\n     *                     moment is the last moment in the mission.\n     * @param depleteWeaponCharge Whether the user's weapon should be depleted if they select this\n     *                            choice.\n     * @param incrementNumEnemiesDefeated Whether the number of enemies defeated should be\n     *                                    incremented if the user selects this choice.\n     * @param iconResourceName The name of the drawable resource for this choice action.\n     * @return An XML string with the following format:\n     *      <choice id=\"[choiceId]\">\n     *          <description>[choiceDescription]</description>\n     *          <next_moment id=\"[nextMomentId]\"/>\n     *          <outcome\n     *              deplete_weapon=\"[depleteWeaponCharge]\"\n     *              increment_enemies=\"[incrementNumEnemiesDefeated]\"/>\n     *          <icon name=\"[iconResourceName]\" />\n     *      </choice>\n     */\n    private String createChoiceXml(String choiceId, String choiceDescription, String nextMomentId,\n                                   boolean depleteWeaponCharge,\n                                   boolean incrementNumEnemiesDefeated, String iconResourceName) {\n        String xml = \"\";\n\n        xml += \"<choice \";\n        xml += \"id='\" + choiceId + \"' >\";\n        xml += \"<description>\" + choiceDescription + \"</description>\";\n        xml += createNextMomentXml(nextMomentId);\n        xml += \"<outcome \";\n        xml += \"deplete_weapon='\" + Boolean.toString(depleteWeaponCharge) + \"' \";\n        xml += \"increment_enemies='\" + Boolean.toString(incrementNumEnemiesDefeated) + \"' />\";\n        if (iconResourceName != null) {\n            xml += createIconXML(iconResourceName);\n        }\n        xml += \"</choice>\";\n\n        return xml;\n    }\n\n    /**\n     * A helper function to create an XML string representing the end of a choice moment.\n     * @return A moment XML end-tag: </moment>\n     */\n    private String createEndChoiceMomentXml() {\n        return createEndMomentXml();\n    }\n\n    /**\n     * A helper function to create an XML string representing a spoken text moment.\n     * @param momentId The unique id of this moment.\n     * @param nextMomentId The id of the next moment in the mission.  Can be null if this moment is\n     *                     the last moment in the mission.\n     * @param textToSpeak A string that should be spoken aloud as part of this moment.\n     * @return An XML string with the following format:\n     *      <moment type=\"spoken_text\" id=\"[momentId]\">\n     *          <next_moment id=\"[nextMomentId]\" />\n     *          <text_to_speak>[textToSpeak]</text_to_speak>\n     *      </moment>\n     */\n    private String createSpokenTextMomentXml(String momentId, String nextMomentId,\n                                             String textToSpeak) {\n        String xml = \"\";\n\n        xml += createStartMomentXml(\"spoken_text\", momentId);\n        xml += createNextMomentXml(nextMomentId);\n        xml += \"<text_to_speak>\" + textToSpeak + \"</text_to_speak>\";\n        xml += createEndMomentXml();\n\n        return xml;\n    }\n\n    /**\n     * A helper function to create an XML string representing a sfx moment.\n     * @param momentId The unique id of this moment.\n     * @param nextMomentId The id of the next moment in the mission. Can be null if this moment is\n     *                     the last moment in the mission.\n     * @param pathToResource The absolute path to the sound resource to be played as part of this\n     *                       moment.\n     * @return An XML string with the following format:\n     *      <moment type=\"sfx\" id=\"[momentId]\">\n     *          <next_moment id=\"[nextMomentId]\" />\n     *          <uri>[pathToResource]</uri>\n     *       </moment>\n     */\n    private String createSfxMomentXml(String momentId, String nextMomentId, String pathToResource) {\n        String xml = \"\";\n\n        xml += createStartMomentXml(\"sfx\", momentId);\n        xml += createNextMomentXml(nextMomentId);\n        xml += \"<uri>\" + pathToResource + \"</uri>\";\n        xml += createEndMomentXml();\n\n        return xml;\n    }\n\n    /**\n     * A helper function to create an XML string representing a timer moment's 'length_minutes'\n     * element.\n     * @param lengthMinutes The length of the timer moment in minutes.\n     * @return An XML string with the following format:\n     *      <length_minutes>[lengthMinutes]</length_minutes>\n     */\n    private String createLengthMinutesXml(double lengthMinutes) {\n        return \"<length_minutes>\" + Double.toString(lengthMinutes) + \"</length_minutes>\";\n    }\n\n    /**\n     * A helper function to create an XML string representing a 'fictional_progress' element.\n     * @param progressDescription The fictional progress made.\n     * @return An XML string with the following format:\n     *      <fictional_progress>[progressDescription]</fictional_progress>\n     */\n    private String createFictionalProgressXml(String progressDescription) {\n        return \"<fictional_progress>\" + progressDescription + \"</fictional_progress>\";\n    }\n\n    /**\n     * A helper function to create an XML string representing an 'icon' element.\n     * @param iconResourceName The name of the drawable resource for this choice action.\n     * @return An XML string with the following format:\n     *      <icon name=\"[iconResourceName]\" />\n     */\n    private String createIconXML(String iconResourceName) {\n        return \"<icon name='\" + iconResourceName + \"'/>\";\n    }\n\n    /**\n     * A helper function to create an XML string representing a spoken text moment with fictional\n     * progress.\n     * @param momentId The unique id of this moment.\n     * @param nextMomentId The id of the next moment in the mission.  Can be null if this moment is\n     *                     the last moment in the mission.\n     * @param textToSpeak A string that should be spoken aloud as part of this moment.\n     * @param progressDescription A string describing the fictional progress.\n     * @return An XML string with the following format:\n     *      <moment type=\"spoken_text\" id=\"[momentId]\">\n     *          <next_moment id=\"[nextMomentId]\" />\n     *          <text_to_speak>[textToSpeak]</text_to_speak>\n     *          <fictional_progress>[progressDescription]</fictional_progress>\n     *      </moment>\n     */\n    private String createSpokenTextMomentWithFictionalProgressXML(String momentId,\n            String nextMomentId, String textToSpeak, String progressDescription) {\n        String xml = \"\";\n        xml += createStartMomentXml(\"spoken_text\", momentId);\n        xml += createNextMomentXml(nextMomentId);\n        xml += \"<text_to_speak>\" + textToSpeak + \"</text_to_speak>\";\n        xml += createFictionalProgressXml(progressDescription);\n        xml += createEndMomentXml();\n        return xml;\n    }\n\n    /**\n     * A helper function to create an XML string representing a timer moment with fictional\n     * progress.\n     * @param momentId The unique id of the moment.\n     * @param nextMomentId The id of the next moment if this choice is chosen.  Can be null if this\n     *                     moment is the last moment in the mission.\n     * @param lengthMinutes The length of the timer moment in minutes.\n     * @param progressDescription A string describing the fictional progress.\n     * @return An XML string of the following format:\n     *      <moment type=\"timer\" id=\"[momentId]\">\n     *          <next_moment id=\"[nextMomentId]\" />\n     *          <length_minutes>[lengthMinutes]</length_minutes>\n     *          <fictional_progress>[progressDescription]</fictional_progress>\n     *      </moment>\n     */\n    private String createTimerMomentWithFictionalProgressXML(String momentId, String nextMomentId,\n            double lengthMinutes, String progressDescription) {\n        String xml = \"\";\n\n        xml += createStartMomentXml(\"timer\", momentId);\n        xml += createNextMomentXml(nextMomentId);\n        xml += createLengthMinutesXml(lengthMinutes);\n        xml += createFictionalProgressXml(progressDescription);\n        xml += createEndMomentXml();\n\n        return xml;\n    }\n\n    /**\n     * A helper function to create an XML string representing a sfx moment with fictional progress.\n     * @param momentId The unique id of this moment.\n     * @param nextMomentId The id of the next moment in the mission. Can be null if this moment is\n     *                     the last moment in the mission.\n     * @param pathToResource The absolute path to the sound resource to be played as part of this\n     *                       moment.\n     * @param progressDescription A string describing the fictional progress.\n     * @return An XML string with the following format:\n     *      <moment type=\"sfx\" id=\"[momentId]\">\n     *          <next_moment id=\"[nextMomentId]\" />\n     *          <uri>[pathToResource]</uri>\n     *          <fictional_progress>[progressDescription]</fictional_progress>\n     *       </moment>\n     */\n    private String createSfxMomentWithFictionalProgressXML(String momentId, String nextMomentId,\n            String pathToResource, String progressDescription) {\n        String xml = \"\";\n\n        xml += createStartMomentXml(\"sfx\", momentId);\n        xml += createNextMomentXml(nextMomentId);\n        xml += \"<uri>\" + pathToResource + \"</uri>\";\n        xml += createFictionalProgressXml(progressDescription);\n        xml += createEndMomentXml();\n\n        return xml;\n\n    }\n\n    /**\n     * A helper function to create an XML string representing the start of a choice moment with\n     * fictional progress.\n     * @param momentId The unique id of the moment.\n     * @param timeoutLengthMinutes The length of time in minutes after which the default choice\n     *                             should be chosen for the user.\n     * @param choiceDescription A meaningful, human-readable description of the choice to be made,\n     *                          which is most likely in the form of either a direct or indirect\n     *                          question.\n     * @param defaultChoiceId The id of the choice that should be chosen if the decision times out\n     *                        before the user has chosen their own choice.\n     * @param progressDescription A string describing the fictional progress.\n     * @return An XML string with the following format:\n     *      <moment type=\"choice\" id=\"[momentId]\">\n     *          <timeout_length_minutes>[timeoutLengthMinutes]</timeout_length_minutes>\n     *          <description>[choiceDescription]</description>\n     *          <default_choice id=\"[defaultChoiceId]\"/>\n     *          <fictional_progress>[progressDescription]</fictional_progress>\n     */\n    private String createStartChoiceMomentWithFictionalProgressXML (String momentId,\n            double timeoutLengthMinutes, String choiceDescription, String defaultChoiceId,\n            String progressDescription) {\n        String xml = \"\";\n        xml += createStartChoiceMomentXml(momentId, timeoutLengthMinutes, choiceDescription,\n                defaultChoiceId);\n        xml += createFictionalProgressXml(progressDescription);\n        return xml;\n    }\n\n    /**\n     * A helper function to create an XML string representing a choice.  Choices are found within\n     * choice moments. Contains a piece of fictional progress.\n     * @param choiceId The id of the choice.\n     * @param choiceDescription A meaningful, human-readable description of the choice.\n     * @param nextMomentId The id of the next moment if this choice is chosen.  Can be null if this\n     *                     moment is the last moment in the mission.\n     * @param depleteWeaponCharge Whether the user's weapon should be depleted if they select this\n     *                            choice.\n     * @param incrementNumEnemiesDefeated Whether the number of enemies defeated should be\n     *                                    incremented if the user selects this choice.\n     * @param iconResourceName The name of the drawable resource for this choice action.\n     * @return An XML string with the following format:\n     *      <choice id=\"[choiceId]\">\n     *          <description>[choiceDescription]</description>\n     *          <next_moment id=\"[nextMomentId]\"/>\n     *          <outcome\n     *              deplete_weapon=\"[depleteWeaponCharge]\"\n     *              increment_enemies=\"[incrementNumEnemiesDefeated]\"/>\n     *          <fictional_progress>[progressDescription]</fictional_progress>\n     *          <icon name=\"[iconResourceName]\" />\n     *      </choice>\n     */\n    private String createChoiceWithFictionalProgressXML(String choiceId, String choiceDescription,\n            String nextMomentId, boolean depleteWeaponCharge, boolean incrementNumEnemiesDefeated,\n            String progressDescription, String iconResourceName) {\n        String xml = \"\";\n\n        xml += \"<choice \";\n        xml += \"id='\" + choiceId + \"' >\";\n        xml += \"<description>\" + choiceDescription + \"</description>\";\n        xml += createNextMomentXml(nextMomentId);\n        xml += \"<outcome \";\n        xml += \"deplete_weapon='\" + Boolean.toString(depleteWeaponCharge) + \"' \";\n        xml += \"increment_enemies='\" + Boolean.toString(incrementNumEnemiesDefeated) + \"' />\";\n        xml += createFictionalProgressXml(progressDescription);\n        if (iconResourceName != null) {\n            xml += createIconXML(iconResourceName);\n        }\n        xml += \"</choice>\";\n\n        return xml;\n    }\n}\n"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.google.fpl.gim.examplegame\" >\n    <uses-permission android:name=\"android.permission.VIBRATE\"/>\n    <uses-permission android:name=\"android.permission.BLUETOOTH\"/>\n    <uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>\n    <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>\n    <uses-feature android:name=\"android.hardware.bluetooth_le\" android:required=\"true\"/>\n    <uses-feature android:name=\"android.hardware.location\" android:required=\"true\"/>\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.google.fpl.gim.examplegame.MainActivity\"\n            android:label=\"@string/app_name\"\n            android:screenOrientation=\"portrait\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n        <service\n            android:name=\".MainService\">\n        </service>\n\n        <meta-data android:name=\"com.google.android.gms.version\"\n            android:value=\"@integer/google_play_services_version\" />\n\n        <meta-data android:name=\"com.google.android.gms.games.APP_ID\"\n            android:value=\"@string/app_id\" />\n\n    </application>\n</manifest>\n"
  },
  {
    "path": "app/src/main/assets/legacy_missions/choice_mission.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- A mission example consisting of a choice moment and a timer moment. -->\n<mission\n    start_id=\"start\"\n    name=\"Choice mission - test\">\n    <moment\n        type=\"choice\"\n        id=\"start\">\n        <timeout_length_minutes>0.5</timeout_length_minutes>\n        <description>What will you do?</description>\n        <default_choice id=\"choice_smoke_bomb\" />\n        <choice\n            id=\"fire\">\n            <description>Fire!!!</description>\n            <next_moment id=\"timer_1\"/>\n            <outcome\n                deplete_weapon=\"true\"\n                increment_enemies=\"false\"/>\n            <icon name=\"ic_fire_white\"/>\n        </choice>\n        <choice\n            id=\"choice_sling_shot\">\n            <description>Use a sling shot.</description>\n            <next_moment id=\"timer_1\"/>\n            <outcome\n                deplete_weapon=\"false\"\n                increment_enemies=\"false\"/>\n            <icon name=\"ic_sling_shot_white\"/>\n        </choice>\n        <choice\n            id=\"choice_smoke_bomb\">\n            <description>Drop a smoke bomb.</description>\n            <next_moment id=\"timer_1\"/>\n            <outcome\n                deplete_weapon=\"true\"\n                increment_enemies=\"false\"/>\n            <icon name=\"ic_smoke_bomb_white\"/>\n        </choice>\n    </moment>\n    <moment\n        type=\"timer\"\n        id=\"timer_1\">\n        <length_minutes>0.1</length_minutes>\n    </moment>\n</mission>\n"
  },
  {
    "path": "app/src/main/assets/legacy_missions/mission.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- An example mission. -->\n<!-- Mission\n    start_id: The id signifying the starting Moment for this mission. -->\n<mission\n    start_id=\"start\"\n    name=\"4 Moment Example - runs only one timer moment\">\n    <!-- All Moments have:\n        type: The kind of Moment.\n        id: A String identifier unique to each Moment. -->\n    <!-- All Moments may optionally have:\n        fictional_progress: A string detailing a fictional achievement for the player.\n                            There may be multiple pieces of fictional progress. -->\n    <!-- TimerMoment -->\n    <moment\n        type=\"timer\"\n        id=\"start\">\n        <!-- TimerMoments have:\n            next_moment: The next Moment to progress to once timer is complete.\n            length_minutes: Time for this TimerMoment to run. -->\n        <length_minutes>0.25</length_minutes>\n        <fictional_progress>Created a mission.</fictional_progress>\n        <fictional_progress>Made a timer moment</fictional_progress>\n    </moment>\n    <!-- ChoiceMoment -->\n    <moment\n        type=\"choice\"\n        id=\"choice_example\" >\n        <!-- ChoiceMoments have:\n            timeout_length_minutes: The time to wait until the default choice is executed.\n            description: A text description of the choice to be made, displayed to user.\n            default_choice: The Choice to execute if the Choice times out.\n            choice(s): At least one Choice to be presented to the user. -->\n        <timeout_length_minutes>0.5</timeout_length_minutes>\n        <description>Example ChoiceMoment Description</description>\n        <default_choice id=\"choice_2\" />\n        <!-- Choices have:\n            id: A String identifier unique to each choice. -->\n        <!-- There must be at least 2 Choices in each ChoiceMoment.  One of these 2 Choices must\n            have an id of \"fire\" to indicate that this Choice will appear only if the user's weapon\n            is charged. There can a maximum of 3 choices per ChoiceMoment because notifications can\n            have no more than 3 actions. -->\n        <choice\n            id=\"fire\">\n            <!-- Choices contain:\n                next_moment: The Moment to progress to if this Choice is selected.\n                outcome: The Outcome containing consequences of this Choice.\n                description: Textual description of this option. -->\n            <!-- Choices may optionally contain:\n                fictional_progress: A string detailing a fictional achievement for the player.\n                            There may be multiple pieces of fictional progress. -->\n            <description>Example Choice Description 1</description>\n            <next_moment id=\"start\"/>\n            <!-- Outcomes have:\n                deplete_weapon: A boolean whether the weapon is fired as a result of this option.\n                increment_enemies: A boolean whether an enemy is defeated as a result of this\n                    option. -->\n            <outcome\n                deplete_weapon=\"true\"\n                increment_enemies=\"false\"/>\n            <fictional_progress>Fired a weapon.</fictional_progress>\n            <icon name=\"ic_fire_white\"/>\n        </choice>\n        <choice\n            id=\"choice_2\">\n            <description>Example Choice Description 2</description>\n            <next_moment id=\"start\"/>\n            <outcome\n                deplete_weapon=\"false\"\n                increment_enemies=\"false\"/>\n            <icon name=\"ic_fire_white\"/>\n        </choice>\n        <choice\n            id=\"choice_3\">\n            <description>Example Choice Description 2</description>\n            <next_moment id=\"start\"/>\n            <outcome\n                deplete_weapon=\"false\"\n                increment_enemies=\"false\"/>\n            <icon name=\"ic_fire_white\"/>\n        </choice>\n    </moment>\n    <!-- SfxMoment -->\n    <moment\n        type=\"sfx\"\n        id=\"sfx1\">\n        <!-- SfxMoments have:\n            next_moment: The next Moment to progress to once timer is complete.\n            uri: The URI path to a sound effect to play. -->\n        <next_moment id=\"start\"/>\n        <uri>path/to/something</uri>\n    </moment>\n    <!-- SpokenTextMoment -->\n    <moment\n        type=\"spoken_text\"\n        id=\"text1\">\n        <!-- SpokenTextMoments have:\n            next_moment: The next Moment to progress to once timer is complete.\n            text_to_speak: The text to be spoken. -->\n        <next_moment id=\"start\"/>\n        <text_to_speak>Hello!</text_to_speak>\n    </moment>\n</mission>\n"
  },
  {
    "path": "app/src/main/assets/legacy_missions/sfx mission.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- A mission example consisting of one sfx and two spoken text moments. -->\n<mission\n    start_id=\"new\"\n    name=\"SFX Example\">\n    <moment\n        type=\"spoken_text\"\n        id=\"new\">\n        <next_moment id=\"start\"/>\n        <text_to_speak>You will now hear a snap sound.</text_to_speak>\n    </moment>\n    <moment\n        type=\"sfx\"\n        id=\"start\">\n        <uri>android.resource://com.google.fpl.gim.examplegame/raw/snap</uri>\n        <next_moment id=\"end\"/>\n    </moment>\n    <moment\n        type=\"spoken_text\"\n        id=\"end\">\n        <text_to_speak>That was a snap! You're welcome.</text_to_speak>\n        </moment>\n</mission>"
  },
  {
    "path": "app/src/main/assets/legacy_missions/spoken_plus_timer_mission.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- A mission example consisting of spoken text and timer moments. -->\n<mission\n    start_id=\"start\"\n    name=\"Spoken + Timer Example\">\n    <moment\n        type=\"spoken_text\"\n        id=\"start\">\n        <next_moment id=\"second\"/>\n        <text_to_speak>\n            This is the first moment in this mission. The next moment should be a timer moment\n            lasting 6 seconds.\n        </text_to_speak>\n    </moment>\n    <moment\n        type=\"timer\"\n        id=\"second\">\n        <next_moment id=\"third\"/>\n        <length_minutes>0.1</length_minutes>\n    </moment>\n    <moment\n        type=\"spoken_text\"\n        id=\"third\">\n        <text_to_speak>\n            This is the final moment, and the previous moment lasted 6 seconds.\n        </text_to_speak>\n    </moment>\n</mission>"
  },
  {
    "path": "app/src/main/assets/legacy_missions/texttospeechmission.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- A mission example consisting only of spoken text moments. -->\n<mission\n    start_id=\"start\"\n    name=\"TTS Example\">\n    <moment\n        type=\"spoken_text\"\n        id=\"start\">\n        <next_moment id=\"second\"/>\n        <text_to_speak>Hello!</text_to_speak>\n    </moment>\n    <moment\n        type=\"spoken_text\"\n        id=\"second\">\n        <text_to_speak>Agent, your mission is simple. Good luck. Godspeed!</text_to_speak>\n    </moment>\n</mission>"
  },
  {
    "path": "app/src/main/assets/legacy_missions/timermission.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- A mission example consisting only of timer moments. -->\n<mission\n    start_id=\"start\"\n    name=\"Timer Moments only Example\">\n    <moment\n        type=\"timer\"\n        id=\"start\">\n        <next_moment id=\"second\"/>\n        <length_minutes>0.1</length_minutes>\n    </moment>\n    <moment\n        type=\"timer\"\n        id=\"second\">\n        <next_moment id=\"third\"/>\n        <length_minutes>0.1</length_minutes>\n    </moment>\n    <moment\n        type=\"timer\"\n        id=\"third\">\n        <length_minutes>0.1</length_minutes>\n    </moment>\n</mission>"
  },
  {
    "path": "app/src/main/assets/missions/01_sample_mission_1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- A mission example consisting of a complete interaction. First, the player is welcomed to the\ngame and given context and a challenge (spoken text moment.)  Then, the player runs for 1.5\nminutes (timer moment.)  Next, the player is notified that a zombie is now chasing them (spoken text\nmoment) and must choose one of two ways to defeat the zombie (choice moment.)  Finally, the user\nlearns the effectiveness of their choice (zombie defeated or not) (sfx moment and spoken text\nmoment) and is notified that they have arrived at the base (spoken text moment.) -->\n<mission\n    start_id=\"start\"\n    name=\"Complete Mission #1\">\n    <moment\n        type=\"spoken_text\"\n        id=\"start\">\n        <next_moment id=\"timer_1\"/>\n        <text_to_speak>\n            Welcome to Games In Motion!  The year is 2012, and the apocalypse is upon us in the form\n            of zombies.  The zombies have decided that your brain looks particularly tasty, and a\n            swarm is after you.  You will be pursued relentlessly until you reach the base, which is\n            approximately 3 minutes away by foot.  You will be notified when a zombie begins to\n            chase you, and you will have to react appropriately.  Keep an eye on your wrist gadget,\n            but don't run into any trees, or else the zombies will surely catch you.  Good luck!\n            Start running now!  You have at least a minute before a zombie will begin to chase you.\n        </text_to_speak>\n        <fictional_progress>Started a mission</fictional_progress>\n        <fictional_progress>Received instructions</fictional_progress>\n    </moment>\n\n    <moment\n        type=\"timer\"\n        id=\"timer_1\">\n        <next_moment id=\"zombie_chase_1\"/>\n        <length_minutes>3</length_minutes>\n    </moment>\n\n    <moment\n        type=\"spoken_text\"\n        id=\"zombie_chase_1\">\n        <next_moment id=\"zombie_choice_1\"/>\n        <text_to_speak>\n            You are now being chased!  Your options are as follows: Number 1. Act like a zombie in\n            order to blend in.  Number 2.  Throw an axe at the zombie.  Make your choice using your\n            mobile device.  Choose wisely.\n        </text_to_speak>\n        <fictional_progress>Encountered a zombie</fictional_progress>\n    </moment>\n\n    <moment\n        type=\"choice\"\n        id=\"zombie_choice_1\">\n        <timeout_length_minutes>0.5</timeout_length_minutes>\n        <description>What will you do?</description>\n        <default_choice id=\"choice_blend\" />\n        <choice\n            id=\"fire\">\n            <description>Fire!!!</description>\n            <next_moment id=\"zombie_axe_success\"/>\n            <outcome\n                deplete_weapon=\"true\"\n                increment_enemies=\"false\"/>\n            <icon name=\"ic_fire_white\"/>\n        </choice>\n        <choice\n            id=\"choice_axe\">\n            <description>Axe.</description>\n            <next_moment id=\"sfx_zombie_axe\"/>\n            <outcome\n                deplete_weapon=\"false\"\n                increment_enemies=\"true\"/>\n            <fictional_progress>Threw an axe.</fictional_progress>\n            <icon name=\"ic_axe_white\"/>\n        </choice>\n        <choice\n            id=\"choice_blend\">\n            <description>Blend.</description>\n            <next_moment id=\"sfx_zombie_blend\"/>\n            <outcome\n                deplete_weapon=\"false\"\n                increment_enemies=\"false\"/>\n            <fictional_progress>Pretended to be a zombie</fictional_progress>\n            <icon name=\"ic_blend_zombie_white\"/>\n        </choice>\n    </moment>\n\n    <moment\n        type=\"sfx\"\n        id=\"sfx_zombie_axe\">\n        <uri>android.resource://com.google.fpl.gim.examplegame/raw/axe</uri>\n        <next_moment id=\"zombie_axe_success\"/>\n    </moment>\n\n    <moment\n        type=\"sfx\"\n        id=\"sfx_zombie_blend\">\n        <uri>android.resource://com.google.fpl.gim.examplegame/raw/brains</uri>\n        <next_moment id=\"zombie_blend_failure\"/>\n    </moment>\n\n    <moment\n        type=\"spoken_text\"\n        id=\"zombie_axe_success\">\n        <next_moment id=\"final_fiction\"/>\n        <text_to_speak>\n            You defeated the zombie!  Good thing because\n        </text_to_speak>\n        <fictional_progress>Killed the zombie!</fictional_progress>\n    </moment>\n\n    <moment\n        type=\"spoken_text\"\n        id=\"zombie_blend_failure\">\n        <next_moment id=\"final_fiction\"/>\n        <text_to_speak>\n            You were caught!  That's okay because\n        </text_to_speak>\n        <fictional_progress>Failed at pretending to be a zombie.</fictional_progress>\n    </moment>\n\n    <moment\n        type=\"spoken_text\"\n        id=\"final_fiction\">\n        <!--<next_moment id=\"timer_1\"/>-->\n        <text_to_speak>\n            You have arrived at the base.\n        </text_to_speak>\n        <fictional_progress>Arrived at the base.</fictional_progress>\n    </moment>\n</mission>\n"
  },
  {
    "path": "app/src/main/assets/missions/02_sample_mission_2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- A mission example consisting of 4 complete interactions. -->\n\n<mission\n    start_id=\"start\"\n    name=\"Complete Mission #2\">\n\n    <!-- Introductory moment explaining the scenario and basic game. -->\n    <moment\n        type=\"spoken_text\"\n        id=\"start\">\n        <next_moment id=\"timer_1\"/>\n        <text_to_speak>\n            Hello Agent. Welcome to Games In Motion!  The year is 2012, and the apocalypse is upon\n            us in the form of zombies. Your task is to make it to our base. But the zombies have\n            decided that your brain looks particularly tasty, and a swarm is after you.  You will be\n            pursued relentlessly until you reach the base, which is approximately 20 minutes away by\n            foot. Keep an eye on your wrist gadget: you will be notified when a zombie begins to\n            chase you, and you will have to react appropriately. Don’t run into any trees, or else\n            the zombies will surely catch you. We’ve provided you with a simple super charger. Run\n            faster, and you’ll get a shot to use against the zombies. Good luck! Start running now!\n            You have at least a minute before a zombie will begin to chase you.\n        </text_to_speak>\n        <fictional_progress>Agent: Apocalypse</fictional_progress>\n    </moment>\n\n    <!-- Basic timer moment to space out events. -->\n    <moment\n        type=\"timer\"\n        id=\"timer_1\">\n        <next_moment id=\"zombie_chase_1\"/>\n        <length_minutes>3.0</length_minutes>\n    </moment>\n\n    <!-- First choice/first zombie encounter. -->\n    <moment\n        type=\"spoken_text\"\n        id=\"zombie_chase_1\">\n        <next_moment id=\"zombie_choice_1\"/>\n        <text_to_speak>\n            Watch out, there is a zombie behind you! Look at your wrist gadget and act quickly to\n            defeat the them. If you’ve got a shot, you can take it. Otherwise, you can act like a\n            zombie in order to blend in.  Or, throw an axe at the zombie. Choose wisely.\n        </text_to_speak>\n    </moment>\n\n    <moment\n        type=\"choice\"\n        id=\"zombie_choice_1\">\n        <timeout_length_minutes>0.5</timeout_length_minutes>\n        <description>Face the first zombie!</description>\n        <default_choice id=\"choice_blend\" />\n        <choice\n            id=\"fire\">\n            <description>Fire!!!</description>\n            <next_moment id=\"sfx_zombie_fire_1\"/>\n            <outcome\n                deplete_weapon=\"true\"\n                increment_enemies=\"false\"/>\n            <icon name=\"ic_fire_white\"/>\n        </choice>\n        <choice\n            id=\"choice_axe\">\n            <description>Axe.</description>\n            <next_moment id=\"sfx_zombie_axe_1\"/>\n            <outcome\n                deplete_weapon=\"false\"\n                increment_enemies=\"true\"/>\n            <icon name=\"ic_axe_white\"/>\n        </choice>\n        <choice\n            id=\"choice_blend\">\n            <description>Blend.</description>\n            <next_moment id=\"sfx_zombie_blend_1\"/>\n            <outcome\n                deplete_weapon=\"false\"\n                increment_enemies=\"false\"/>\n            <icon name=\"ic_blend_zombie_white\"/>\n        </choice>\n    </moment>\n\n    <!--Sound effects from choice 1-->\n    <moment\n        type=\"sfx\"\n        id=\"sfx_zombie_fire_1\">\n        <uri>android.resource://com.google.fpl.gim.examplegame/raw/fire</uri>\n        <!--TODO: make a fire sound effect-->\n        <next_moment id=\"zombie_fire_1_success\"/>\n    </moment>\n\n    <moment\n        type=\"sfx\"\n        id=\"sfx_zombie_axe_1\">\n        <uri>android.resource://com.google.fpl.gim.examplegame/raw/axe</uri>\n        <next_moment id=\"zombie_axe_1_success\"/>\n    </moment>\n\n    <moment\n        type=\"sfx\"\n        id=\"sfx_zombie_blend_1\">\n        <uri>android.resource://com.google.fpl.gim.examplegame/raw/brains</uri>\n        <next_moment id=\"zombie_blend_1_failure\"/>\n    </moment>\n\n    <!-- Fiction from Choice 1 -->\n\n    <moment\n        type=\"spoken_text\"\n        id=\"zombie_fire_1_success\">\n        <text_to_speak>\n            Right in the eye! Nice work, agent. You just might have this zombie thing down.\n        </text_to_speak>\n        <next_moment id=\"timer_2_success\"/>\n    </moment>\n    <moment\n        type=\"spoken_text\"\n        id=\"zombie_axe_1_success\">\n        <text_to_speak>\n            Hum. I did not expect that to work. Well, keep it up!\n        </text_to_speak>\n        <next_moment id=\"timer_2_success\"/>\n    </moment>\n    <moment\n        type=\"spoken_text\"\n        id=\"zombie_blend_1_failure\">\n        <text_to_speak>\n            Why on earth did you think blending in would work? You barely got out of that! You’ll never be a great agent if you act like that.\n        </text_to_speak>\n        <next_moment id=\"timer_2_failure\"/>\n    </moment>\n\n    <!-- Timer moment spacing out next event. -->\n\n    <moment\n        type=\"timer\"\n        id=\"timer_2_success\">\n        <length_minutes>3.0</length_minutes>\n        <next_moment id=\"prompt_2a\"/>\n    </moment>\n\n    <moment\n        type=\"timer\"\n        id=\"timer_2_failure\">\n        <length_minutes>3.0</length_minutes>\n        <next_moment id=\"prompt_2b\"/>\n    </moment>\n\n    <!-- Fiction readying next choice. -->\n\n    <moment\n        type=\"spoken_text\"\n        id=\"prompt_2a\">\n        <text_to_speak>\n            All right agent, I have a real task for you now.\n        </text_to_speak>\n        <next_moment id=\"prompt_2\"/>\n    </moment>\n\n    <moment\n        type=\"spoken_text\"\n        id=\"prompt_2b\">\n        <text_to_speak>\n            How would you like a chance to redeem yourself?\n        </text_to_speak>\n        <next_moment id=\"prompt_2\"/>\n    </moment>\n\n    <!-- Reconciliation - just one choice, regardless of first choice. -->\n\n    <moment\n        type=\"spoken_text\"\n        id=\"prompt_2\">\n        <text_to_speak>\n            There’s a fork in the road ahead. We have intel suggesting that a zombie mans the split.\n            One of the paths leads to a bunker, and that bunker has a hard drive we need you to get.\n            Don’t worry if you can’t find it right away - but know that the zombie may pursue if you\n            get their attention. If you take care of them quickly, they might have something on\n            their person. Or is it just a body since they are dead? Undead? Anyway, it will tell you\n            where to go.\n        </text_to_speak>\n        <next_moment id=\"choice_2\"/>\n    </moment>\n\n    <!--Fork in the road choice.-->\n\n    <moment\n        type=\"choice\"\n        id=\"choice_2\">\n        <timeout_length_minutes>0.5</timeout_length_minutes>\n        <description>Fork in the road</description>\n        <default_choice id=\"choice_left_sneak\" />\n        <choice\n            id=\"fire\">\n            <description>Fire!!!</description>\n            <next_moment id=\"sfx_zombie_fire_2\"/>\n            <outcome\n                deplete_weapon=\"true\"\n                increment_enemies=\"false\"/>\n            <icon name=\"ic_fire_white\"/>\n        </choice>\n        <choice\n            id=\"choice_left_sneak\">\n            <description>Left - sneak</description>\n            <next_moment id=\"sfx_sneak\"/>\n            <outcome\n                deplete_weapon=\"false\"\n                increment_enemies=\"true\"/>\n            <icon name=\"ic_sneak_white\"/>\n        </choice>\n        <choice\n            id=\"choice_right_sneak\">\n            <description>Right - sneak</description>\n            <next_moment id=\"sfx_sneak\"/>\n            <outcome\n                deplete_weapon=\"false\"\n                increment_enemies=\"false\"/>\n            <icon name=\"ic_sneak_white\"/>\n        </choice>\n    </moment>\n\n    <!--Sound effects for fork in the road.-->\n\n    <moment\n        type=\"sfx\"\n        id=\"sfx_zombie_fire_2\">\n        <uri>android.resource://com.google.fpl.gim.examplegame/raw/fire</uri>\n        <next_moment id=\"zombie_fire_2_success\"/>\n    </moment>\n\n    <moment\n        type=\"sfx\"\n        id=\"sfx_sneak\">\n        <uri>android.resource://com.google.fpl.gim.examplegame/raw/sneak</uri>\n        <!--TODO: make a sneak failure sfx-->\n        <next_moment id=\"zombie_sneak_failure\"/>\n    </moment>\n\n    <!--Fictional following fork in the road choice-->\n\n    <moment\n        type=\"spoken_text\"\n        id=\"zombie_fire_2_success\">\n        <text_to_speak>\n            Well done. And I was right, of course. The zombie had a slip of paper saying to go left.\n            Head down the path. It will be obvious when you get there.\n        </text_to_speak>\n        <next_moment id=\"timer_3_success\"/>\n    </moment>\n\n    <moment\n        type=\"spoken_text\"\n        id=\"zombie_sneak_failure\">\n        <text_to_speak>\n            You certainly have his attention now. How disappointing. And, and, what are you doing?\n            Do you really think jumping into the bramble will help you here? You're just making\n            noise. Perhaps if you're extraordinarily lucky, you can lose the zombie on your tail.\n            Sigh. Now I have to make contingency plans to recover that hard drive, all because of\n            your stupidity.\n        </text_to_speak>\n        <next_moment id=\"timer_3_failure\"/>\n    </moment>\n\n    <!--Timer moments spacing out the next moment.-->\n\n    <moment\n        type=\"timer\"\n        id=\"timer_3_success\">\n        <length_minutes>3.0</length_minutes>\n        <next_moment id=\"prompt_3a\"/>\n    </moment>\n\n    <moment\n        type=\"timer\"\n        id=\"timer_3_failure\">\n        <length_minutes>3.0</length_minutes>\n        <next_moment id=\"prompt_3b\"/>\n    </moment>\n\n\n    <!-- Arrival to bunker -->\n\n    <moment\n        type=\"spoken_text\"\n        id=\"prompt_3a\">\n        <text_to_speak>\n            Right time, right location. I like your consistency, agent. Much better than the other\n            candidates we were investigating. You are doing so well that I apologize for the\n            pedantic explanation of your next task.\n        </text_to_speak>\n        <next_moment id=\"prompt_3\"/>\n    </moment>\n\n    <moment\n        type=\"spoken_text\"\n        id=\"prompt_3b\">\n        <text_to_speak>\n            I am in shock at your luck. How did you lose that zombie? I swear they were following\n            you the entire time. And how did you find the bunker after all that? You do realize\n            that good luck does not a good agent make? But as long as you are here, you might as\n            well be useful.\n        </text_to_speak>\n        <next_moment id=\"prompt_3\"/>\n    </moment>\n\n    <moment\n        type=\"spoken_text\"\n        id=\"prompt_3\">\n        <text_to_speak>\n            Go inside, go downstairs, turn left. 3 doors down will be a room labeled Animatrix.\n            You'll need to break the window, get in, and grab the blue external hard drive next to\n            the large computer. You will lose contact in there, but I will check in again once you\n            get out.\n        </text_to_speak>\n        <next_moment id=\"timer_4\"/>\n    </moment>\n\n    <!-- Timer to space out. -->\n\n    <moment\n        type=\"timer\"\n        id=\"timer_4\">\n        <length_minutes>3.0</length_minutes>\n        <next_moment id=\"prompt_4\"/>\n    </moment>\n\n    <!-- Get out of bunker. Horde! -->\n\n    <moment\n        type=\"spoken_text\"\n        id=\"prompt_4\">\n        <text_to_speak>\n            You got out.  By the way, there is a horde of zombies chasing you.  Why aren’t you\n            running now?  Didn’t I warn you about them?  We saw them on the radar nearly 10 minutes\n            ago.  Oh well.  Better late than never I suppose.  Start running now!\n        </text_to_speak>\n        <next_moment id=\"timer_5\"/>\n    </moment>\n\n    <moment\n        type=\"timer\"\n        id=\"timer_5\">\n        <length_minutes>3.0</length_minutes>\n        <next_moment id=\"prompt_5\"/>\n    </moment>\n\n    <moment\n        type=\"spoken_text\"\n        id=\"prompt_5\">\n        <text_to_speak>\n            You are at the base now, but the horde is still chasing you.  The horde is thinner now,\n            but we can’t let you in until you defeat them.  Our own safety is much more important\n            than yours, after all.  Deal with them. Or we will deal with you.\n        </text_to_speak>\n        <next_moment id=\"final_choice\"/>\n    </moment>\n\n    <moment\n        type=\"choice\"\n        id=\"final_choice\">\n        <timeout_length_minutes>0.5</timeout_length_minutes>\n        <description>The horde is here.</description>\n        <default_choice id=\"join_them\" />\n        <choice\n            id=\"fire\">\n            <description>Fire!!!</description>\n            <next_moment id=\"sfx_zombie_fire_final\"/>\n            <outcome\n                deplete_weapon=\"true\"\n                increment_enemies=\"false\"/>\n            <icon name=\"ic_fire_white\"/>\n        </choice>\n        <choice\n            id=\"join_them\">\n            <description>Join them.</description>\n            <next_moment id=\"sfx_join_them\"/>\n            <outcome\n                deplete_weapon=\"false\"\n                increment_enemies=\"false\"/>\n            <icon name=\"ic_blend_zombie_white\"/>\n        </choice>\n        <choice\n            id=\"jetpack\">\n            <description>Jetpack!</description>\n            <next_moment id=\"sfx_jetpack\"/>\n            <outcome\n                deplete_weapon=\"false\"\n                increment_enemies=\"true\"/>\n            <icon name=\"ic_jet_pack_white\"/>\n        </choice>\n    </moment>\n\n    <moment\n        type=\"sfx\"\n        id=\"sfx_zombie_fire_final\">\n        <uri>android.resource://com.google.fpl.gim.examplegame/raw/fire</uri>\n        <next_moment id=\"zombie_fire_final_success\"/>\n    </moment>\n\n    <moment\n        type=\"sfx\"\n        id=\"stx_join_them\">\n        <uri>android.resource://com.google.fpl.gim.examplegame/raw/brains</uri>\n        <next_moment id=\"zombie_join_them_failure\"/>\n    </moment>\n\n    <moment\n        type=\"sfx\"\n        id=\"sfx_jetpack\">\n        <uri>android.resource://com.google.fpl.gim.examplegame/raw/jetpack</uri>\n        <next_moment id=\"zombie_jetpack_success\"/>\n    </moment>\n\n    <moment\n        type=\"spoken_text\"\n        id=\"zombie_fire_final_success\">\n        <text_to_speak>\n            I suppose that firing like a maniac into a horde of zombies is one way to go.\n            Shockingly, you were successful.  I guess that means we have to let you in now.\n            Darn it.  Well, you completed the mission, so you are now an agent.  I begrudgingly\n            offer my congratulations.\n        </text_to_speak>\n        <next_moment id=\"mission_end\"/>\n    </moment>\n\n    <moment\n        type=\"spoken_text\"\n        id=\"zombie_join_them_failure\">\n        <text_to_speak>\n            You have decided to join them?  How rude.  Needless to say, you did not complete the\n            mission, and your agent status has been revoked.  We might consider granting it to you\n            again, but not until you return for your next mission.  Farewell.\n        </text_to_speak>\n        <next_moment id=\"mission_end\"/>\n    </moment>\n\n    <moment\n        type=\"spoken_text\"\n        id=\"zombie_jetpack_success\">\n        <text_to_speak>\n            Where did that jetpack come from? And how inconsiderate of you to leave us behind to\n            deal with the horde.  Needless to say, you did not complete the mission, and your agent\n            status has been revoked.  We might consider granting it to you again, but not until you\n            return for your next mission.  Farewell.\n        </text_to_speak>\n        <next_moment id=\"mission_end\"/>\n    </moment>\n\n    <moment\n        type=\"spoken_text\"\n        id=\"mission_end\">\n        <text_to_speak>Mission end.</text_to_speak>\n    </moment>\n\n</mission>\n\n\n\n\n\n\n"
  },
  {
    "path": "app/src/main/assets/missions/ex_01_timer_moment.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- A 1 minute timer moment for 8/11 demo and presentation. -->\n<mission\n    start_id=\"start\"\n    name=\"Timer Example\">\n    <moment\n        type=\"timer\"\n        id=\"start\">\n        <length_minutes>0.5</length_minutes>\n        <fictional_progress>Played a mission!</fictional_progress>\n        <fictional_progress>Played a timer moment</fictional_progress>\n    </moment>\n</mission>"
  },
  {
    "path": "app/src/main/assets/missions/ex_02_spoken_text_moment.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- Spoken text moment for 8/11 demo and presentation. -->\n<mission\n    start_id=\"start\"\n    name=\"Spoken Text Example\">\n    <moment\n        type=\"spoken_text\"\n        id=\"start\">\n        <text_to_speak>\n            Hello! This is a spoken text moment that uses text to speech.\n        </text_to_speak>\n        <fictional_progress>Heard a spoken text moment</fictional_progress>\n    </moment>\n</mission>"
  },
  {
    "path": "app/src/main/assets/missions/ex_03_choice_moment.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- Choice moment for 8/11 demo and presentation.. -->\n<mission\n    start_id=\"start\"\n    name=\"Choice Example\">\n    <moment\n        type=\"choice\"\n        id=\"start\">\n        <timeout_length_minutes>0.5</timeout_length_minutes>\n        <description>What will you do?</description>\n        <default_choice id=\"choice_smoke_bomb\" />\n        <fictional_progress>Made a choice</fictional_progress>\n        <choice\n            id=\"fire\">\n            <description>Fire!!!</description>\n            <outcome\n                deplete_weapon=\"true\"\n                increment_enemies=\"false\"/>\n            <icon name=\"ic_fire_white\"/>\n        </choice>\n        <choice\n            id=\"choice_sling_shot\">\n            <description>Use a sling shot.</description>\n            <outcome\n                deplete_weapon=\"false\"\n                increment_enemies=\"false\"/>\n            <fictional_progress>Used a slingshot</fictional_progress>\n            <icon name=\"ic_sling_shot_white\"/>\n        </choice>\n        <choice\n            id=\"choice_smoke_bomb\">\n            <description>Drop a smoke bomb.</description>\n            <outcome\n                deplete_weapon=\"true\"\n                increment_enemies=\"false\"/>\n            <fictional_progress>Used a smoke bomb</fictional_progress>\n            <icon name=\"ic_smoke_bomb_white\"/>\n        </choice>\n    </moment>\n</mission>"
  },
  {
    "path": "app/src/main/assets/missions/ex_04_sfx_moment.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- Sfx moment for 8/11 demo and presentation. -->\n<mission\n    start_id=\"start\"\n    name=\"Sfx Example\">\n    <moment\n        type=\"sfx\"\n        id=\"start\">\n        <uri>android.resource://com.google.fpl.gim.examplegame/raw/brains</uri>\n        <fictional_progress>BRAINS</fictional_progress>\n        <fictional_progress>BRAINS BRAINS BRAINS</fictional_progress>\n        <fictional_progress>BRAAAAAAAAAAAAAAAINS</fictional_progress>\n    </moment>\n</mission>"
  },
  {
    "path": "app/src/main/assets/missions/ex_05_broken_timer_moment.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- A 1 minute timer moment that does not have a 'length_minutes' element.  Demonstrates\nXML parse error handling in the app. -->\n<mission\n    start_id=\"start\"\n    name=\"Timer Example - Broken\">\n    <moment\n        type=\"timer\"\n        id=\"start\">\n        <fictional_progress>Played a mission!</fictional_progress>\n        <fictional_progress>Played a timer moment</fictional_progress>\n    </moment>\n</mission>"
  },
  {
    "path": "app/src/main/assets/missions/ex_06_long_timer_mission.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- A mission example consisting of a single, very long timer moment. -->\n<mission\n    start_id=\"start\"\n    name=\"Long timer moment\">\n    <moment\n        type=\"timer\"\n        id=\"start\">\n        <length_minutes>100.0</length_minutes>\n    </moment>\n</mission>"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/Choice.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport java.util.ArrayList;\n\n/**\n * Describes an option that a user has when presented with a decision to make.\n * Choices are only meaningful when there are 2+ of them.\n */\npublic class Choice {\n    // Unique identifier for this Choice.\n    private String mChoiceId;\n    // The description of this option.\n    private String mDescription;\n    // The moment to go to next.\n    private String mNextMomentId;\n    // The set of changes to make if the player chooses this option.\n    private Outcome mOutcome;\n    // Whether or not this Choice requires a charged weapon.\n    private boolean mRequiresChargedWeapon;\n    // Fictional Progress associated with this choice.\n    private ArrayList<String> mFictionalProgress;\n    // The name of the resource icon to display for this Choice's action.\n    private String mDrawableResourceName;\n\n    public Choice(String choiceId, String text, String nextMomentId, Outcome outcome,\n                  boolean requiresChargedWeapon, ArrayList<String> fictionalProgress,\n                  String drawableResourceName) {\n        mChoiceId = choiceId;\n        mDescription = text;\n        mNextMomentId = nextMomentId;\n        mOutcome = outcome;\n        mRequiresChargedWeapon = requiresChargedWeapon;\n        mFictionalProgress = fictionalProgress;\n        mDrawableResourceName = drawableResourceName;\n    }\n\n    public String getChoiceId() {\n        return mChoiceId;\n    }\n\n    public String getDescription() {\n        return mDescription;\n    }\n\n    public String getNextMomentId() {\n        return mNextMomentId;\n    }\n\n    public Outcome getOutcome() {\n        return mOutcome;\n    }\n\n    public ArrayList<String> getFictionalProgress() {\n        return mFictionalProgress;\n    }\n\n    public boolean requiresChargedWeapon() {\n        return mRequiresChargedWeapon;\n    }\n\n    public String getDrawableResourceName() {\n        return mDrawableResourceName;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/ChoiceMoment.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport android.app.NotificationManager;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.support.v4.app.NotificationCompat;\n\nimport com.google.fpl.gim.examplegame.gui.NotificationOptions;\nimport com.google.fpl.gim.examplegame.utils.Utils;\n\nimport java.util.ArrayList;\n\n/**\n * Describes a Moment in which the user is presented with a decision to make.\n */\npublic class ChoiceMoment extends Moment {\n\n    private static final String TAG = ChoiceMoment.class.getSimpleName();\n    public static final int MAXIMUM_NUM_OF_CHOICES = 3;\n    public static final int MINIMUM_NUM_OF_CHOICES = 2;\n\n    private static final String CHOICE_NOTIFICATION_ACTION_1\n            = \"com.google.fpl.gim.examplegame.CHOICE_NOTIFICATION_ACTION_1\";\n    private static final String CHOICE_NOTIFICATION_ACTION_2\n            = \"com.google.fpl.gim.examplegame.CHOICE_NOTIFICATION_ACTION_2\";\n    private static final String CHOICE_NOTIFICATION_ACTION_3\n            = \"com.google.fpl.gim.examplegame.CHOICE_NOTIFICATION_ACTION_3\";\n    private static final String CHOICE_ID_KEY\n            = \"com.google.fpl.gim.examplegame.CHOICE_ID_KEY\";\n\n    private static final String ICON_RESOURCE_FOLDER = \"drawable\";\n    private static long[] VIBRATE_PATTERN = {0, 300, 100, 300, 100, 300};\n\n    private ChoiceMomentData mData;\n    private long mStartTimeNanos;\n    private Choice mSelectedChoice = null;\n\n    public ChoiceMoment (Mission mission, ChoiceMomentData data) {\n        super(mission);\n        this.mData = data;\n    }\n\n    public void update(long nowNanos) {\n        Utils.logDebug(TAG, \"ChoiceMoment \\\"\" + mData.getMomentId() + \"\\\" update.\");\n        if (!isDone() && hasTimeToMakeChoiceExpired(nowNanos)) {\n            // Pick default choice\n            if (noChoiceSelectedYet()) {\n                selectChoice(mData.getDefaultChoiceId());\n            }\n            setIsDone(true);\n        }\n    }\n\n    @Override\n    public void start(long nowNanos) {\n        super.start(nowNanos);\n        Utils.logDebug(TAG, \"ChoiceMoment \\\"\" + mData.getMomentId() + \"\\\" started.\");\n        setStartTimeNanos(nowNanos);\n\n        // If the user's weapon is not charged, the choice to fire their weapon should not be\n        // displayed.\n        Choice[] choices = mData.getChoices();\n        int numActions = mData.getNumChoices();\n        if (!getMission().isWeaponCharged()) {\n            numActions--;\n        }\n\n        // Create notification actions using the valid choices.\n        NotificationCompat.Action[] actions = new NotificationCompat.Action[numActions];\n        int index = 0;\n        String[] allActions = {CHOICE_NOTIFICATION_ACTION_1, CHOICE_NOTIFICATION_ACTION_2,\n                CHOICE_NOTIFICATION_ACTION_3};\n        for (Choice choice : choices) {\n            if (!choice.requiresChargedWeapon() || getMission().isWeaponCharged()) {\n                // Bounds checked in MissionParser.java, which requires each choice moment to have\n                // 2 or 3 choices associated with it.\n                Intent actionIntent = new Intent(allActions[index]);\n                actionIntent.putExtra(CHOICE_ID_KEY, choice.getChoiceId());\n\n                String resourceName = choice.getDrawableResourceName();\n                String packageName = getMission().getService().getPackageName();\n                int resource = getMission().getService().getResources()\n                        .getIdentifier(resourceName, ICON_RESOURCE_FOLDER, packageName);\n\n                // If the resource does not exist, default to using application icon.\n                if (resource == 0) {\n                    resource = getMission().getService().getApplicationInfo().icon;\n                }\n\n                actions[index] = getMission().getService()\n                        .makeNotificationAction(actionIntent, resource,\n                        choice.getDescription());\n                index++;\n            }\n        }\n\n        // Create the notification to warn the user of an approaching enemy.\n        NotificationOptions notificationOptions =\n                NotificationOptions.getDefaultNotificationOptions();\n        notificationOptions.setNotificationId(MainService.CHOICE_NOTIFICATION_ID);\n        notificationOptions.setPriorityAsMax();\n        notificationOptions.setActions(actions);\n        notificationOptions.setNotificationDefaults(0);\n        notificationOptions.setVibratePattern(VIBRATE_PATTERN);\n        getMission().getService().postActionNotification(notificationOptions);\n    }\n\n    @Override\n    public void end() {\n        Utils.logDebug(TAG, \"ChoiceMoment \\\"\" + mData.getMomentId() + \"\\\" ended.\");\n        // Remove choice notification.\n        dismissNotification();\n    }\n\n    /**\n     * The next moment is not defined for a ChoiceMoment until the user has selected a choice.\n     * @return Returns null until a choice is made, then returns the nextMomentId.\n     */\n    @Override\n    public String getNextMomentId() {\n        if (mSelectedChoice == null) {\n            return null;\n        } else {\n            return mSelectedChoice.getNextMomentId();\n        }\n    }\n\n    @Override\n    public void restart(long nowNanos) {\n        start(nowNanos);\n    }\n\n    public ChoiceMomentData getMomentData() {\n        return this.mData;\n    }\n\n    public void setStartTimeNanos(long startTimeNanos) {\n        this.mStartTimeNanos = startTimeNanos;\n    }\n\n    public boolean hasTimeToMakeChoiceExpired(long nowNanos) {\n        return (nowNanos - mStartTimeNanos) >= Utils.minutesToNanos(mData\n                .getTimeoutLengthMinutes());\n    }\n\n    public void onReceive(Context context, Intent intent) {\n        if (intent.getAction().equals(CHOICE_NOTIFICATION_ACTION_1)\n                || intent.getAction().equals(CHOICE_NOTIFICATION_ACTION_2)\n                || intent.getAction().equals(CHOICE_NOTIFICATION_ACTION_3)) {\n            String choiceId = intent.getStringExtra(CHOICE_ID_KEY);\n            selectChoice(choiceId);\n        }\n    }\n\n    public synchronized void selectChoice(String choiceId) {\n        if (!isDone()) {\n            Utils.logDebug(TAG, \"Choice with id \\\"\" + choiceId + \"\\\" selected.\");\n            mSelectedChoice = mData.getChoiceById(choiceId);\n            getMission().applyOutcome(mSelectedChoice.getOutcome());\n            setIsDone(true);\n        }\n    }\n\n    public void dismissNotification() {\n        NotificationManager notificationManager = (NotificationManager) getMission().getService()\n                .getSystemService(Context.NOTIFICATION_SERVICE);\n        notificationManager.cancel(MainService.CHOICE_NOTIFICATION_ID);\n    }\n\n    public boolean noChoiceSelectedYet() {\n        return mSelectedChoice == null;\n    }\n\n    @Override\n    public ArrayList<String> getFictionalProgress() {\n        ArrayList<String> progress = new ArrayList<>();\n        progress.addAll(mData.getFictionalProgress());\n        if (!noChoiceSelectedYet()) {\n            progress.addAll(mSelectedChoice.getFictionalProgress());\n        }\n        return progress;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/ChoiceMomentData.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\n\n/**\n * Encapsulates the data that is needed to define a unique ChoiceMoment.\n */\npublic class ChoiceMomentData extends MomentData {\n\n    // The text describing the choice the player must make.\n    private final String mDescription;\n    // All of the choices that the user can have.\n    private final HashMap<String, Choice> mChoices;\n    // Identifies the default Choice to execute in the case of a timeout.\n    private final String mDefaultChoiceId;\n    // Time in minutes until the default Choice is executed.\n    private final float mTimeoutLengthMinutes;\n\n    /**\n     * Constructor to explicitly set all fields for a ChoiceMomentData.\n     * @param momentId Identifier for the ChoiceMoment.\n     * @param fictionalProgress Fictional progress for this moment.\n     * @param description Text description for the decision to be made.\n     * @param choices HashMap of Choices available to choose.\n     * @param defaultChoiceId Default Choice in case of timeout.\n     * @param timeoutLengthMinutes Length of time until timeout.\n     */\n    public ChoiceMomentData(String momentId, ArrayList<String> fictionalProgress,\n            String description, HashMap<String, Choice> choices, String defaultChoiceId,\n            float timeoutLengthMinutes) {\n        super(momentId, null, fictionalProgress);\n        mDescription = description;\n        mChoices = choices;\n        mDefaultChoiceId = defaultChoiceId;\n        mTimeoutLengthMinutes = timeoutLengthMinutes;\n    }\n\n    /**\n     * Constructor for information from XML.\n     * @param momentId Identifier for the ChoiceMoment.\n     * @param fictionalProgress Fictional progress for this moment.\n     * @param description Text description for the decision to be made.\n     * @param defaultChoiceId Default Choice in case of timeout.\n     * @param timeoutLengthMinutes Length of time until timeout.\n     */\n    public ChoiceMomentData(String momentId, ArrayList<String> fictionalProgress,\n            String description, String defaultChoiceId, float timeoutLengthMinutes) {\n        this(momentId, fictionalProgress, description, new HashMap<String, Choice>(),\n                defaultChoiceId, timeoutLengthMinutes);\n    }\n\n    public String getText() {\n        return mDescription;\n    }\n\n    public Choice[] getChoices() {\n        return mChoices.values().toArray(new Choice[mChoices.size()]);\n    }\n\n    public Choice getChoiceById(String choiceId) {\n        return mChoices.get(choiceId);\n    }\n\n    public int getNumChoices() {\n        return mChoices.size();\n    }\n\n    public void addChoice(Choice choice) {\n        mChoices.put(choice.getChoiceId(), choice);\n    }\n\n    public String getDefaultChoiceId() {\n        return mDefaultChoiceId;\n    }\n\n    public float getTimeoutLengthMinutes() {\n        return mTimeoutLengthMinutes;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/MainActivity.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport android.app.Fragment;\nimport android.app.FragmentManager;\nimport android.content.BroadcastReceiver;\nimport android.content.ComponentName;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.IntentFilter;\nimport android.content.ServiceConnection;\nimport android.os.Bundle;\nimport android.os.IBinder;\nimport android.support.v4.app.NotificationCompat;\nimport android.support.v7.app.ActionBarActivity;\nimport android.view.Menu;\nimport android.view.MenuItem;\nimport android.view.View;\n\nimport com.google.fpl.gim.examplegame.gui.FitnessDataDisplayFragment;\nimport com.google.fpl.gim.examplegame.gui.GameViews;\nimport com.google.fpl.gim.examplegame.gui.NotificationOptions;\nimport com.google.fpl.gim.examplegame.google.GoogleApiClientWrapper;\nimport com.google.fpl.gim.examplegame.utils.Utils;\n\nimport java.util.ArrayList;\n\n/**\n * MainActivity class on the UI thread. It has a game handler for the game loop to execute on.\n */\npublic class MainActivity extends ActionBarActivity {\n\n    private static final String TAG = MainActivity.class.getSimpleName();\n    // Defines the action the BroadcastReceiver will receive.\n    public static final String ENABLE_BACK\n            = \"com.google.fpl.gim.examplegame.ENABLE_BACK\";\n    public static final String MISSION_START\n            = \"com.google.fpl.gim.examplegame.MISSION_START\";\n    public static final String MISSION_END\n            = \"com.google.fpl.gim.examplegame.MISSION_END\";\n    private static final String UPDATE_FITNESS_STATS\n            = \"com.google.fpl.gim.examplegame.UPDATE_FITNESS_STATS\";\n\n    private MainService mMainService; // Service that runs the game logic.\n    private GameViews mGameViews; // Container for all UI fragments.\n\n    // Defines behavior when binding and unbinding mMainService.\n    private ServiceConnection mConnection = new ServiceConnection() {\n        public void onServiceConnected(ComponentName className,\n                                       IBinder binder) {\n            if (binder == null) {\n                throw new IllegalArgumentException(\"IBinder passed to onServiceConnected was null\");\n            }\n            mMainService = ((MainService.MainBinder) binder).getService();\n            mMainService.ConnectGoogleFitApiClient(MainActivity.this);\n\n            // Register Intent receivers after the service is bound; this ensures that the Activity\n            // is listening to intents sent from the service.\n            // Register the mReceiver with an intent filter for rendering requests.\n            IntentFilter filter = new IntentFilter();\n            filter.addAction(ENABLE_BACK);\n            filter.addAction(MISSION_START);\n            filter.addAction(MISSION_END);\n            registerReceiver(mReceiver, filter);\n\n            // Render the mReceiver with an intent filter for displaying an updated num steps\n            filter = new IntentFilter();\n            filter.addAction(UPDATE_FITNESS_STATS);\n            registerReceiver(mReceiver, filter);\n        }\n\n        public void onServiceDisconnected(ComponentName className) {\n            mMainService = null;\n        }\n    };\n\n    private BroadcastReceiver mReceiver = new BroadcastReceiver() {\n        @Override\n        public void onReceive(Context context, Intent intent) {\n            // Update the step display fragment to show the current number of steps that the user\n            // has taken.\n            if (intent.getAction().equals(UPDATE_FITNESS_STATS)) {\n                if (mMainService != null) {\n                    FitnessDataDisplayFragment fitnessDataDisplayFragment\n                                = mGameViews.getFitnessDataDisplayFragment();\n                    if (fitnessDataDisplayFragment.isVisible()) {\n                        fitnessDataDisplayFragment.setFitnessStats(\n                                mMainService.getCurrentMission());\n                    }\n                }\n            }\n\n            // Receives an intent that requests back button to be enabled.\n            if (intent.getAction().equals(ENABLE_BACK)) {\n                getFragmentManager().popBackStack();\n            }\n\n            // Receives an intent that requests end summary screen to display due to a mission end.\n            if (intent.getAction().equals(MISSION_START)) {\n                displayFitnessStats();\n            }\n\n            // Receives an intent that requests end summary screen to display due to a mission end.\n            if (intent.getAction().equals(MISSION_END)) {\n                checkDisplayEndScreen();\n            }\n        }\n    };\n\n    @Override\n    public void onDestroy() {\n        Utils.logDebug(TAG, \"onDestroy\");\n        super.onDestroy();\n        if (isFinishing()) {\n            // Stop the service from running in the background if the app exits.\n            Intent intent = new Intent(this, MainService.class);\n            intent.setPackage(getPackageName());\n            stopService(intent);\n        }\n    }\n\n    @Override\n    public boolean onCreateOptionsMenu(Menu menu) {\n        // Inflate the menu; this adds items to the action bar if it is present.\n        getMenuInflater().inflate(R.menu.main, menu);\n        return true;\n    }\n\n    @Override\n    public boolean onOptionsItemSelected(MenuItem item) {\n        // Handle action bar item clicks here. The action bar will\n        // automatically handle clicks on the Home/Up button, so long\n        // as you specify a parent activity in AndroidManifest.xml.\n        int id = item.getItemId();\n\n        if (id == android.R.id.home) {\n            getFragmentManager().popBackStack();\n        }\n\n        return super.onOptionsItemSelected(item);\n    }\n\n    @Override\n    public void onActivityResult(int requestCode, int resultCode, Intent data) {\n        if (requestCode == GoogleApiClientWrapper.REQUEST_CODE_OAUTH) {\n            if (resultCode == RESULT_OK) {\n                // If the user authenticated, try to connect again\n                mMainService.userAuthenticated();\n                mMainService.reconnectGoogleApi();\n            } else {\n                // Ideally there's a fail case here, handled by our own UX flow.\n                // Keeping it empty for the sample.\n            }\n        }\n    }\n\n    /**\n     * Responsible for transitioning from the start menu UI to the mission selection menu UI\n     * @param view The view that is invoking this method.\n     */\n    public void onStartButtonPressed(View view) {\n        mGameViews.getStartMenuFragment().onStartButtonPressed();\n    }\n\n    public void onEnterPressed(View view) {\n        mGameViews.getRunSpecificationsFragment().onEnterPressed();\n    }\n\n    public void onStartMissionPressed(View view) {\n        // Get user selected run and mission information.\n        String missionName = getGameViews().getListOfMissionsFragment().getSelectedMissionName();\n        String assetPath = getGameViews().getListOfMissionsFragment().getSelectedAssetPath();\n        float missionLengthMinutes =\n                getGameViews().getRunSpecificationsFragment().getSelectedMissionLengthMinutes();\n        float intervalLengthMinutes =\n                getGameViews().getRunSpecificationsFragment().getSelectedIntervalLengthMinutes();\n        float challengePaceMinutesPerMile =\n                getGameViews().getRunSpecificationsFragment().getSelectedChallengePaceMinutesPerMile();\n\n        loadAndStartMission(assetPath, missionName, missionLengthMinutes, intervalLengthMinutes,\n                challengePaceMinutesPerMile);\n\n        // Disable the button and show that we are registering sensors.\n        getGameViews().getMusicSelectionFragment().disableReadyButton();\n    }\n\n    private void displayFitnessStats() {\n        String missionName = getGameViews().getListOfMissionsFragment().getSelectedMissionName();\n        Fragment stepDisplayFragment = getGameViews().getFitnessDataDisplayFragment();\n        ((FitnessDataDisplayFragment)stepDisplayFragment).setMissionName(missionName);\n        Fragment musicSelectionFragment = getGameViews().getMusicSelectionFragment();\n        getFragmentManager().beginTransaction()\n                .setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_left)\n                .remove(musicSelectionFragment)\n                .add(R.id.container, stepDisplayFragment, GameViews.FITNESS_DATA_DISPLAY_TAG)\n                .addToBackStack(null)\n                .commit();\n\n        getFragmentManager().executePendingTransactions();\n\n        // Disable home/back button on action bar.\n        displayHomeUp(false);\n    }\n\n    public GameViews getGameViews() {\n        return this.mGameViews;\n    }\n\n    public void loadAndStartMission(String missionFilePath, String missionName, float missionLength,\n                                    float intervalLength, float challengePaceMinutesPerMile) {\n        if (mMainService != null) {\n            mMainService.loadAndStartMission(missionFilePath, missionName, missionLength,\n                    intervalLength, challengePaceMinutesPerMile);\n        }\n    }\n\n    public void displayHomeUp(boolean display) {\n        getSupportActionBar().setDisplayHomeAsUpEnabled(display);\n        getSupportActionBar().setHomeButtonEnabled(display);\n    }\n\n    /**\n     * Updates UI as Google Fit's connection status changes.\n     */\n    public void onFitStatusUpdated(boolean connected) {\n        // Hint to the fragments that might need to update their displays.\n        mGameViews.getStartMenuFragment().onFitStatusUpdated(connected);\n        mGameViews.getEndSummaryFragment().onFitStatusUpdated(connected);\n\n        // End a mission or pop user back to start menu if we are disconnected.\n        if (!connected) {\n            if (mMainService != null && mMainService.isMissionRunning()) {\n                // If a mission is running, end it. No different than a mission ending on its own.\n                mMainService.endMission();\n            } else {\n                // Jump back to the start screen.\n                getFragmentManager().popBackStack(GameViews.START_MENU_TAG, 0);\n            }\n\n            if (mMainService != null) {\n                // Post a notification.\n                NotificationOptions notificationOptions =\n                        NotificationOptions.getDefaultNotificationOptions();\n                notificationOptions.setTitle(getResources().getString(\n                        R.string.disconnection_notification_title));\n                notificationOptions.setContent(getResources().getString(\n                        R.string.disconnection_notification_content));\n                notificationOptions.setNotificationId(MainService.FITNESS_DISCONNECT_NOTIFICATION_ID);\n                notificationOptions.setPriorityAsHigh();\n                notificationOptions.setNotificationDefaults(NotificationCompat.DEFAULT_LIGHTS);\n                mMainService.postActionNotification(notificationOptions);\n            }\n        }\n    }\n\n    @Override\n    public void onBackPressed() {\n        if (mMainService != null) {\n            if (!mMainService.isMissionRunning() && canPressBackButton()) {\n                // If not in a mission and not at the start, function like the in-app up button.\n                getFragmentManager().popBackStack();\n            } else if (mMainService.isMissionRunning()) {\n                // If a mission is running, end it. No different than a mission ending on its own.\n                mMainService.endMission();\n            } else {\n                // Will call finish() and end MainActivity.\n                super.onBackPressed();\n            }\n        }\n    }\n\n    public void setActionBarTitle(int string_res_id) {\n        getSupportActionBar().setTitle(string_res_id);\n    }\n\n    public void setActionBarTitle(String title) {\n        getSupportActionBar().setTitle(title);\n    }\n\n    @Override\n    protected void onStart() {\n        Utils.logDebug(TAG, \"onStart\");\n        super.onStart();\n    }\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        Utils.logDebug(TAG, \"onCreate\");\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        // Start service so it can run in bound and unbound state.\n        Intent intent = new Intent(this, MainService.class);\n        intent.setPackage(getPackageName());\n        startService(intent);\n\n        // create new fragments and initialize data\n        if (savedInstanceState == null) {\n            mGameViews = new GameViews();\n            mGameViews.initializeFragments(this);\n        } else {\n            // restore old fragments and data\n            mGameViews.restoreFragments(this);\n        }\n\n        displayHomeUp(canPressBackButton());\n\n        getFragmentManager().addOnBackStackChangedListener(\n                new FragmentManager.OnBackStackChangedListener() {\n                    @Override\n                    public void onBackStackChanged() {\n                        displayHomeUp(canPressBackButton());\n                    }\n                });\n\n    }\n\n    @Override\n    protected void onPause() {\n        Utils.logDebug(TAG, \"onPause\");\n        super.onPause();\n        // Unregister all broadcasts before unbinding service. These will be registered again once\n        // the onServiceConnected callback is called. This cannot be unregistered in the\n        // onServiceConnected callback as MainActivity might be paused at that point, and it will\n        // result in a crash.\n        try {\n            unregisterReceiver(mReceiver);\n        } catch (IllegalArgumentException e) {\n            Utils.logDebug(TAG, \"Unable to unregister the Broadcast Receiver.\");\n        }\n        // Unbind to allow service to run in the background.\n        unbindService(mConnection);\n    }\n\n    @Override\n    protected void onResume() {\n        Utils.logDebug(TAG, \"onResume\");\n        super.onResume();\n        // Bind to the already running MainService so we can communicate with it.\n        Intent intent = new Intent(this, MainService.class);\n        intent.setPackage(getPackageName());\n        bindService(intent, mConnection, Context.BIND_WAIVE_PRIORITY);\n        // Handles screen being asleep during run. Will display end screen if the run is over.\n        checkDisplayEndScreen();\n    }\n\n    @Override\n    protected void onStop() {\n        Utils.logDebug(TAG, \"onStop\");\n        super.onStop();\n    }\n\n    /**\n     * The back button should be active as long as there are fragment transactions in the back\n     * stack. We always want the first fragment to be around so the back stack count needs to be\n     * > 1.\n     * @return Whether the back button should be active.\n     */\n    private boolean canPressBackButton() {\n        return getFragmentManager().getBackStackEntryCount() > 1;\n    }\n\n    private void checkDisplayEndScreen() {\n        if (mMainService != null) {\n            if (mMainService.shouldDisplayEndScreen()) {\n                displayEndScreen();\n            }\n        }\n    }\n\n    /**\n     * Displays end run summary, with fictional and fitness results.\n     */\n    private void displayEndScreen() {\n        getFragmentManager().popBackStack(GameViews.START_MENU_TAG, 0);\n        getFragmentManager().beginTransaction()\n                .replace(R.id.container, mGameViews.getEndSummaryFragment(),\n                        GameViews.END_SUMMARY_TAG)\n                .addToBackStack(null)\n                .commit();\n        getFragmentManager().executePendingTransactions();\n\n        // Get results.\n        ArrayList<String> fictionalProgress = new ArrayList<>();\n        ArrayList<String> fitnessResults = new ArrayList<>();\n        if (mMainService != null) {\n            fictionalProgress.addAll(mMainService.getOverallFictionalProgress());\n            fitnessResults.addAll(mMainService.getFitnessStatistics());\n        }\n\n        // Display results.\n        mGameViews.getEndSummaryFragment().displayStats(fictionalProgress, fitnessResults);\n\n        // Unlock first mission achievement\n        if(mMainService.unlockAchievement(getString(R.string.ach_id_first_mission))) {\n            Utils.logDebug(TAG, \"Achievement Unlocked: First Mission\");\n        } else {\n            Utils.logDebug(TAG, \"Warning: could not unlock achievement, not connected\");\n        }\n\n        if (mMainService != null) {\n            mMainService.reset();\n        }\n\n        displayHomeUp(true);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/MainService.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport android.app.Activity;\nimport android.app.PendingIntent;\nimport android.app.Service;\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.IntentFilter;\nimport android.media.AudioManager;\nimport android.media.MediaPlayer;\nimport android.net.Uri;\nimport android.os.Binder;\nimport android.os.Handler;\nimport android.os.IBinder;\nimport android.speech.tts.TextToSpeech;\nimport android.support.v4.app.NotificationCompat;\nimport android.support.v4.app.NotificationManagerCompat;\nimport android.widget.Toast;\n\nimport com.google.android.gms.games.Games;\nimport com.google.fpl.gim.examplegame.gui.GameViews;\nimport com.google.fpl.gim.examplegame.gui.NotificationOptions;\nimport com.google.fpl.gim.examplegame.google.GoogleApiClientWrapper;\nimport com.google.fpl.gim.examplegame.utils.MissionParseException;\nimport com.google.fpl.gim.examplegame.utils.Utils;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.ArrayList;\nimport java.util.LinkedList;\nimport java.util.Locale;\nimport java.util.Queue;\n\n/**\n * This is a Runnable for executing on the UI thread, and will add itself back\n * to the UI thread handler at the end of the run() function.\n *\n * While it will block the UI thread while running, it shouldn't block for that long.\n * We could always make a game thread if needed.\n */\npublic class MainService extends Service implements Runnable, MediaPlayer.OnCompletionListener {\n\n    private final IBinder mBinder = new MainBinder();\n    private static final String TAG = MainService.class.getSimpleName();\n\n    private static final String CHOICE_NOTIFICATION_ACTION_1\n            = \"com.google.fpl.gim.examplegame.CHOICE_NOTIFICATION_ACTION_1\";\n    private static final String CHOICE_NOTIFICATION_ACTION_2\n            = \"com.google.fpl.gim.examplegame.CHOICE_NOTIFICATION_ACTION_2\";\n    private static final String CHOICE_NOTIFICATION_ACTION_3\n            = \"com.google.fpl.gim.examplegame.CHOICE_NOTIFICATION_ACTION_3\";\n\n    // Ids for notifications.\n    public static final int CHOICE_NOTIFICATION_ID = 1;\n    public static final int FITNESS_STATS_NOTIFICATION_ID = 2;\n    public static final int FITNESS_DISCONNECT_NOTIFICATION_ID = 3;\n\n    private static final Locale DEFAULT_TEXT_TO_SPEECH_LOCALE = Locale.UK;\n\n    private Mission mMission; // The mission being played. Has reference to current game state.\n\n    private static final long DELAY_MILLIS = 1000; // Time between updates, used as Handler delay.\n    private Handler mUpdateHandler = new Handler();\n\n    // Audio related modules.\n    private TextToSpeech mTextToSpeech;\n    private boolean mIsTextToSpeechReady = false;\n    private AudioManager mAudioManager;\n    private AudioManager.OnAudioFocusChangeListener mAudioFocusChangeListener;\n    private MediaPlayer mMediaPlayer;\n\n    // A queue of Audio Uris to be played.\n    private class AudioQueueItem{\n        Uri mUri;\n        MediaPlayer.OnCompletionListener mListener;\n\n        AudioQueueItem(Uri uri, MediaPlayer.OnCompletionListener listener) {\n            mUri = uri;\n            mListener = listener;\n        }\n\n        @Override\n        public boolean equals(Object o) {\n            if (getClass() != o.getClass())\n                return false;\n            AudioQueueItem audioQueueItem = (AudioQueueItem) o;\n            return (mUri.equals(audioQueueItem.mUri));\n        }\n    }\n    private Queue<AudioQueueItem> mAudioQueue = new LinkedList<>();\n\n    private enum State {\n        UNINITIALIZED,\n        MISSION_LOADED,\n        MISSION_RUNNING,\n        END_SCREEN\n    }\n    private State mState = State.UNINITIALIZED;\n\n    private GoogleApiClientWrapper mGoogleApiClientWrapper =\n            new GoogleApiClientWrapper(); // Container for the GoogleApiClient\n\n    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {\n        @Override\n        public void onReceive(Context context, Intent intent) {\n            if (mMission != null && mMission.getMissionData().getCurrentMoment() != null) {\n                // Choice moment handles choice selection.\n                ((ChoiceMoment) mMission.getMissionData().getCurrentMoment())\n                        .onReceive(context, intent);\n            }\n        }\n    };\n\n    /**\n     * This is the main game loop. Whenever it is done, it adds itself back to the handler.\n     */\n    @Override\n    public void run() {\n        if (mState == State.MISSION_LOADED || mState == State.MISSION_RUNNING) {\n            // This is where we can call the game state and the game logic.\n            update();\n        }\n        mUpdateHandler.postDelayed(this, DELAY_MILLIS);\n    }\n\n    public void userAuthenticated() {\n        mGoogleApiClientWrapper.userAuthenticated();\n    }\n\n    public void reconnectGoogleApi() {\n        Utils.logDebug(TAG, \"Reconnecting to Google API.\");\n        mGoogleApiClientWrapper.connect();\n    }\n\n    public void ConnectGoogleFitApiClient(Activity activity) {\n        mGoogleApiClientWrapper.buildGoogleApiClient(activity);\n        mGoogleApiClientWrapper.connect();\n    }\n\n    /**\n     * Unlock a Play Games achievement.\n     *\n     * @param achievementId the ID of the achievement from the Google Play Developer Console,\n     * @return true if Achievement unlocked, false otherwise.\n     */\n    public boolean unlockAchievement(String achievementId) {\n        if (mGoogleApiClientWrapper.isSignedIn()) {\n            Games.Achievements.unlock(mGoogleApiClientWrapper.getGoogleApiClient(), achievementId);\n            return true;\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * Loads and begins a mission.\n     */\n    public void loadAndStartMission(String missionFilePath, String missionName,\n                                    float missionLengthMinutes, float intervalLengthMinutes,\n                                    float challengePaceMinutesPerMile) {\n        if (!canEnterState(State.MISSION_LOADED)) {\n            return;\n        }\n        MissionData data = new MissionData(missionName, missionFilePath, missionLengthMinutes,\n                intervalLengthMinutes, challengePaceMinutesPerMile);\n        mMission = new Mission(data);\n        mMission.setService(this);\n\n        // Open an InputStream from the given missionFileName.\n        InputStream missionStream;\n        try {\n            missionStream = getAssets().open(missionFilePath);\n        } catch (IOException e) {\n            e.printStackTrace();\n            requestReselection();\n            return;\n        }\n\n        // Load the Moments.\n        try {\n            mMission.readMoments(missionStream);\n        } catch (MissionParseException e) {\n            e.printStackTrace();\n            requestReselection();\n            return;\n        }\n\n        try {\n            missionStream.close();\n        } catch (IOException e) {\n            e.printStackTrace();\n        }\n        startMission();\n    }\n\n    /**\n     * Starts a mission.\n     */\n    private void startMission() {\n        setAndInitNextState(State.MISSION_LOADED);\n    }\n\n    /**\n     * Ends a mission by halting updates.\n     */\n    public void endMission() {\n        setAndInitNextState(State.END_SCREEN);\n    }\n\n    @Override\n    public void onCreate() {\n        // The service is being created.\n        Utils.logDebug(TAG, \"onCreate\");\n        IntentFilter intentFilter = new IntentFilter();\n        intentFilter.addAction(CHOICE_NOTIFICATION_ACTION_1);\n        intentFilter.addAction(CHOICE_NOTIFICATION_ACTION_2);\n        intentFilter.addAction(CHOICE_NOTIFICATION_ACTION_3);\n        registerReceiver(mReceiver, intentFilter);\n\n        mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);\n\n        // Determines the behavior for handling Audio Focus surrender.\n        mAudioFocusChangeListener = new AudioManager.OnAudioFocusChangeListener() {\n            @Override\n            public void onAudioFocusChange(int focusChange) {\n                if (focusChange == AudioManager.AUDIOFOCUS_LOSS_TRANSIENT\n                        || focusChange == AudioManager.AUDIOFOCUS_LOSS) {\n\n                    if (mTextToSpeech.isSpeaking()) {\n                        mTextToSpeech.setOnUtteranceProgressListener(null);\n                        mTextToSpeech.stop();\n                    }\n\n                    if (mMediaPlayer.isPlaying()) {\n                        mMediaPlayer.stop();\n                    }\n\n                    // Abandon Audio Focus, if it's requested elsewhere.\n                    mAudioManager.abandonAudioFocus(mAudioFocusChangeListener);\n\n                    // Restart the current moment if AudioFocus was lost. Since AudioFocus is only\n                    // requested away from this application if this application was using it,\n                    // only Moments that play sound will restart in this way.\n                    if (mMission != null) {\n                        mMission.restartMoment();\n                    }\n                }\n            }\n        };\n\n        // Asynchronously prepares the TextToSpeech.\n        mTextToSpeech = new TextToSpeech(this, new TextToSpeech.OnInitListener() {\n            @Override\n            public void onInit(int status) {\n                if (status == TextToSpeech.SUCCESS) {\n                    // Check if language is available.\n                    switch (mTextToSpeech.isLanguageAvailable(DEFAULT_TEXT_TO_SPEECH_LOCALE)) {\n                        case TextToSpeech.LANG_AVAILABLE:\n                        case TextToSpeech.LANG_COUNTRY_AVAILABLE:\n                        case TextToSpeech.LANG_COUNTRY_VAR_AVAILABLE:\n                            Utils.logDebug(TAG, \"TTS locale supported.\");\n                            mTextToSpeech.setLanguage(DEFAULT_TEXT_TO_SPEECH_LOCALE);\n                            mIsTextToSpeechReady = true;\n                            break;\n                        case TextToSpeech.LANG_MISSING_DATA:\n                            Utils.logDebug(TAG, \"TTS missing data, ask for install.\");\n                            Intent installIntent = new Intent();\n                            installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);\n                            startActivity(installIntent);\n                            break;\n                        default:\n                            Utils.logDebug(TAG, \"TTS local not supported.\");\n                            break;\n                    }\n                }\n            }\n        });\n\n        mMediaPlayer = new MediaPlayer();\n    }\n\n    @Override\n    public int onStartCommand(Intent intent, int flags, int startId) {\n        // The service is starting, due to a call to startService()\n        Utils.logDebug(TAG, \"onStartCommand\");\n        return Service.START_STICKY;\n    }\n\n    @Override\n    public IBinder onBind(Intent intent) {\n        // A client is binding to the service with bindService()\n        Utils.logDebug(TAG, \"onBind\");\n\n        return mBinder;\n    }\n\n    @Override\n    public boolean onUnbind(Intent intent) {\n        // All clients have unbound with unbindService()\n        Utils.logDebug(TAG, \"onUnbind\");\n        return true;\n    }\n\n    @Override\n    public void onRebind(Intent intent) {\n        // A client is binding to the service with bindService(),\n        // after onUnbind() has already been called\n        Utils.logDebug(TAG, \"onRebind\");\n\n        if (mMission != null) {\n            mMission.onRebind();\n        }\n    }\n\n    @Override\n    public void onDestroy() {\n        // The service is no longer used and is being destroyed.\n        Utils.logDebug(TAG, \"onDestroy\");\n        mGoogleApiClientWrapper.disconnect();\n        if (mIsTextToSpeechReady) {\n            mTextToSpeech.shutdown();\n        }\n        if (mMediaPlayer != null) {\n            mMediaPlayer.reset();\n        }\n        mUpdateHandler.removeCallbacks(this);\n        unregisterReceiver(mReceiver);\n        if (mMission != null) {\n            mMission.cleanup();\n        }\n    }\n\n    /**\n     * Callback listener for MediaPlayer.\n     * @param player MediaPlayer instance.\n     */\n    @Override\n    public void onCompletion(MediaPlayer player) {\n        endPlayback();\n    }\n\n    /**\n     * A Binder for the connection between MainService and MainActivity that allows MainActivity\n     * to get the running instance of MainService.\n     */\n    public class MainBinder extends Binder {\n        MainService getService() {\n            return MainService.this;\n        }\n    }\n\n    /**\n     * Create a notification action that upon selection triggers the provided action.\n     * @param intent Intent to carry out when the notification action is selected.\n     * @param actionIconResourceId Resource Id of icon for this action.\n     * @param actionDescription Name of this action.\n     * @return A notification action that can be selected.\n     */\n    public NotificationCompat.Action makeNotificationAction(Intent intent,\n            int actionIconResourceId, String actionDescription) {\n        PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent,\n                PendingIntent.FLAG_UPDATE_CURRENT);\n        return new NotificationCompat.Action(actionIconResourceId,\n                actionDescription, pendingIntent);\n    }\n\n    /**\n     * Builds and posts a notification from a set of options.\n     * @param options The options to build the notification.\n     */\n    public void postActionNotification(NotificationOptions options) {\n        NotificationCompat.Builder builder = new NotificationCompat.Builder(this);\n        builder.setSmallIcon(options.getSmallIconResourceId());\n        builder.setContentTitle(options.getTitle());\n        builder.setContentText(options.getContent());\n        builder.setDefaults(options.getNotificationDefaults());\n        builder.setPriority(options.getNotificationPriority());\n        builder.setVibrate(options.getVibratePattern());\n        if (options.getActions() != null) {\n            for (NotificationCompat.Action action : options.getActions()) {\n                builder.addAction(action);\n            }\n        }\n        NotificationManagerCompat notificationManager =\n                NotificationManagerCompat.from(this);\n        notificationManager.notify(options.getNotificationId(), builder.build());\n    }\n\n    public boolean isMissionRunning() {\n        return mState == State.MISSION_RUNNING;\n    }\n\n    public boolean shouldDisplayEndScreen() {\n        return mState == State.END_SCREEN;\n    }\n\n    public void reset() {\n        setAndInitNextState(State.UNINITIALIZED);\n    }\n\n    public ArrayList<String> getOverallFictionalProgress() {\n        return mMission.getOverallFictionalProgress();\n    }\n\n    /**\n     * Gets fitness statistics for the last played game.\n     * @return An array list of fitness statistics to display.\n     */\n    public ArrayList<String> getFitnessStatistics() {\n        return getCurrentMission().getFitnessStatistics();\n    }\n\n    public Mission getCurrentMission() {\n        return this.mMission;\n    }\n\n    /**\n     * Queue a sound into the audio queue.\n     * @param uri The Uri of the sound.\n     * @param listener The listener to the sound. This is usually MainService but can be overridden.\n     */\n    public void queueSound(Uri uri, MediaPlayer.OnCompletionListener listener) {\n        mAudioQueue.offer(new AudioQueueItem(uri, listener));\n    }\n\n    /**\n     * Removes the first instance of a sound from the audio queue.\n     * @param uri Uri of the item to be removed.\n     */\n    public void dequeueSound(Uri uri) {\n        mAudioQueue.remove(new AudioQueueItem(uri, null));\n    }\n\n    /**\n     * Obtain audio focus for the application. This also checks if we are currently playing any\n     * other audio clips, so it checks for \"audio focus\" within the app.\n     * @return True if audio focus is obtained. False otherwise.\n     */\n    public boolean obtainAudioFocus() {\n        if (mMediaPlayer.isPlaying() || mTextToSpeech.isSpeaking()) {\n            return false;\n        }\n\n        int result = mAudioManager.requestAudioFocus(\n                mAudioFocusChangeListener, AudioManager.STREAM_MUSIC,\n                AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);\n        return (result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED);\n    }\n\n    /**\n     * End audio playback, and abandon audio focus.\n     */\n    public void endPlayback() {\n        mMediaPlayer.reset();\n        mAudioManager.abandonAudioFocus(mAudioFocusChangeListener);\n    }\n\n    protected TextToSpeech getTextToSpeech() { return mIsTextToSpeechReady? mTextToSpeech : null; }\n\n    /**\n     * Checks if the state transition is valid.\n     * @param state State to transition to.\n     * @return True if the transition is valid, false if not.\n     */\n    private boolean canEnterState(State state) {\n        if (mState == state) {\n            return false;\n        }\n\n        boolean canEnterState = true;\n        switch (state) {\n            case UNINITIALIZED:\n                break;\n            case MISSION_LOADED:\n                if (mState == State.MISSION_RUNNING) {\n                    canEnterState = false;\n                    Utils.logDebug(TAG,\n                            \"Can not enter MISSION_LOADED state from MISSION_RUNNING state.\");\n                }\n                break;\n            case MISSION_RUNNING:\n                if (mState != State.MISSION_LOADED) {\n                    canEnterState = false;\n                    Utils.logDebug(TAG,\n                            \"Can only enter MISSION_RUNNING state from MISSION_LOADED state.\");\n                }\n                break;\n            case END_SCREEN:\n                if (mState != State.MISSION_RUNNING) {\n                    canEnterState = false;\n                    Utils.logDebug(TAG,\n                            \"Can only enter END_SCREEN state from MISSION_RUNNING state.\");\n                }\n                break;\n        }\n        return canEnterState;\n    }\n\n    /**\n     * Sets the next state if possible.\n     * @param state State to transition to.\n     */\n    private void setAndInitNextState(State state) {\n        if (!canEnterState(state)) {\n            return;\n        }\n        mState = state;\n        switch (mState) {\n            case UNINITIALIZED:\n                break;\n            case MISSION_LOADED:\n                mMission.prepare(mGoogleApiClientWrapper);\n                mUpdateHandler.post(this);\n                break;\n            case MISSION_RUNNING:\n                mMission.start();\n                broadcastStart();\n                break;\n            case END_SCREEN:\n                mUpdateHandler.removeCallbacks(this);\n                mMission.cleanup();\n                broadcastEnd();\n                break;\n        }\n    }\n\n    private void update() {\n        if (mState == State.MISSION_LOADED && isReady()) {\n            setAndInitNextState(State.MISSION_RUNNING);\n        }\n        if (mState == State.MISSION_RUNNING) {\n            mMission.update();\n\n            if (mMission.isDone()) {\n                endMission();\n            }\n        }\n\n        // Consume the audio queue if it's not empty and if we are able to obtain audio focus.\n        if (!mAudioQueue.isEmpty() && obtainAudioFocus()) {\n            playFirstInQueue();\n        }\n    }\n\n    /**\n     * Play the first item in the audio queue.\n     */\n    private void playFirstInQueue() {\n        AudioQueueItem queueItem = mAudioQueue.poll();\n        try {\n            mMediaPlayer.setDataSource(this, queueItem.mUri);\n        } catch (IOException e) {\n            e.printStackTrace();\n            // Data source does not exist. Skip playback.\n            endPlayback();\n            return;\n        }\n        mMediaPlayer.setOnCompletionListener(queueItem.mListener);\n        try {\n            mMediaPlayer.prepare();\n        } catch (IOException e) {\n            e.printStackTrace();\n            // Error in reading the data source. Skip playback.\n            endPlayback();\n            return;\n        }\n        mMediaPlayer.start();\n    }\n\n    /**\n     * @return True if asynchronous preparations are all done, so that a mission can be started.\n     */\n    private boolean isReady() {\n        return mIsTextToSpeechReady && mGoogleApiClientWrapper.isClientReady();\n    }\n\n    /**\n     * Broadcast to MainActivity to enable back navigation.\n     */\n    private void enableBackNavigation() {\n        sendBroadcast(new Intent(MainActivity.ENABLE_BACK));\n    }\n\n    /**\n     * Display a Toast that requests user to reselect their mission.\n     */\n    private void requestReselection() {\n        Toast.makeText(this, \"Mission load failure. Select again.\", Toast.LENGTH_SHORT).show();\n        enableBackNavigation();\n    }\n\n    /**\n     * Broadcast to MainActivity that mission has started.\n     */\n    private void broadcastStart() {\n        sendBroadcast(new Intent(MainActivity.MISSION_START));\n    }\n\n    /**\n     * Broadcast to MainActivity that mission has ended.\n     */\n    private void broadcastEnd() {\n        sendBroadcast(new Intent(MainActivity.MISSION_END));\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/Mission.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport android.app.NotificationManager;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.net.Uri;\nimport android.support.v4.app.NotificationCompat;\n\nimport com.google.android.gms.fitness.data.DataPoint;\nimport com.google.android.gms.fitness.data.DataType;\nimport com.google.android.gms.fitness.data.Field;\nimport com.google.android.gms.fitness.data.Value;\nimport com.google.android.gms.fitness.request.OnDataPointListener;\nimport com.google.android.gms.fitness.request.SensorRequest;\nimport com.google.fpl.gim.examplegame.gui.NotificationOptions;\nimport com.google.fpl.gim.examplegame.google.FitDataTypeSetting;\nimport com.google.fpl.gim.examplegame.google.GoogleApiClientWrapper;\nimport com.google.fpl.gim.examplegame.utils.MissionParseException;\nimport com.google.fpl.gim.examplegame.utils.MissionParser;\nimport com.google.fpl.gim.examplegame.utils.Utils;\n\nimport java.io.InputStream;\nimport java.util.ArrayList;\n\n/**\n * A mission is a complete gameplay during which the exercising user will be challenged to defeat\n * fictional pursuers.  The user will have a weapon that can only be charged by running faster.\n */\npublic class Mission implements OnDataPointListener {\n\n    private static final String TAG = Mission.class.getSimpleName();\n\n    private static final FitDataTypeSetting[] TRACKED_DATA_TYPES = {\n        new FitDataTypeSetting(\n                true /* isRequired */, DataType.TYPE_STEP_COUNT_DELTA, 1 /* samplingRateSeconds */,\n                SensorRequest.ACCURACY_MODE_DEFAULT),\n        new FitDataTypeSetting(\n                false /* isRequired */, DataType.TYPE_SPEED, 1 /* samplingRateSeconds */,\n                SensorRequest.ACCURACY_MODE_HIGH),\n    };\n\n    private static final String UPDATE_FITNESS_STATS\n            = \"com.google.fpl.gim.examplegame.UPDATE_FITNESS_STATS\";\n\n    // ID that signifies the moment whose next is this is an ending moment.\n    private static final String DEFAULT_END_ID = null;\n    private MissionData mData;\n\n    // Access to MainService to obtain and use Android Context.\n    private MainService mService;\n    private boolean mIsDone = false;\n    private boolean mIsStarted = false;\n\n    // Access to GoogleFitApiClient for fit data\n    private GoogleApiClientWrapper mGoogleApiClientWrapper;\n\n    // Fitness stats for the mission as a whole.\n    private int mTotalNumStepsTaken = 0;\n    private int mTotalNumIntervalsCompleted = 0;\n    private long mMissionStartTimeNanos;\n\n    // Fitness stats for a small portion of the mission.\n    private int mNumStepsSinceBeginningOfSample = 0;\n    private long mSampleStartTimeNanos;\n    private float mCurrentAverageMinutesPerMile = 0f;\n    private static final float AVERAGE_SPEED_SAMPLE_RATE_SECONDS = 10.0f;\n    private static final float LENGTH_OF_RUNNING_STRIDE_FEET = 5.5f;\n    private static final float MAXIMUM_MINUTES_PER_MILE = 1000f;\n\n    private boolean mIsAtChallengePace = false;\n    private long mTimestampStartOfChallengePaceNanos;\n\n    private static final String AT_CHALLENGE_PACE_RESOURCE\n            = \"android.resource://com.google.fpl.gim.examplegame/raw/atchallengepace\";\n    private static final String NO_LONGER_AT_CHALLENGE_PACE_RESOURCE\n            = \"android.resource://com.google.fpl.gim.examplegame/raw/nolongeratchallengepace\";\n    private static final String WEAPON_CHARGED_RESOURCE\n            = \"android.resource://com.google.fpl.gim.examplegame/raw/weaponcharged\";\n    private final Uri AT_CHALLENGE_PACE_URI = Uri.parse(AT_CHALLENGE_PACE_RESOURCE);\n    private final Uri NO_LONGER_AT_CHALLENGE_PACE_URI =\n            Uri.parse(NO_LONGER_AT_CHALLENGE_PACE_RESOURCE);\n    private final Uri WEAPON_CHARGED_URI = Uri.parse(WEAPON_CHARGED_RESOURCE);\n\n    // The current time represented in nanoseconds.\n    private long mNowNanos;\n\n    private boolean mIsWeaponCharged = false;\n    private float mLastWeaponCharge;\n    private int mNumEnemiesDefeated = 0;\n\n    private ArrayList<String> mOverallFictionalProgress = new ArrayList<>();\n\n    public Mission(MissionData data) {\n        this.mData = data;\n    }\n\n    /**\n     * Makes the moment referred to by nextMomentId the current Moment. Checks if the game should\n     * end by checking the nextMomentId.\n     * @param nextMomentId The ID of the moment to make the current moment.\n     */\n    public void changeCurrentMoment(String nextMomentId, long now) {\n        if (nextMomentId == DEFAULT_END_ID || nextMomentId.equals(DEFAULT_END_ID)) {\n            mIsDone = true;\n            return;\n        }\n\n        mData.setCurrentMomentId(nextMomentId);\n        mData.getCurrentMoment().start(now);\n    }\n\n    /**\n     * Loads the moments read from an xml file that define a mission into the mission data.\n     * @param missionStream An input stream for an xml file.\n     * @throws com.google.fpl.gim.examplegame.utils.MissionParseException Thrown when file parsing failed due to parser configuration,\n     * input exceptions, or incorrectly structured file.\n     */\n    public void readMoments(InputStream missionStream) throws MissionParseException {\n        // Exceptions may be thrown from MissionParser.parseMission\n        MissionParser.parseMission(missionStream, this);\n    }\n\n    public void start() {\n        mNowNanos = System.nanoTime();\n        mMissionStartTimeNanos = mNowNanos;\n        changeCurrentMoment(mData.getFirstMomentId(), mNowNanos);\n        mIsStarted = true;\n        mSampleStartTimeNanos = mNowNanos;\n        mLastWeaponCharge = 0f;\n        // Create the notification to notify the user of their current fitness statistics.\n        postFitnessNotification(getFitnessNotificationTitle());\n    }\n\n    public void cleanup() {\n        Utils.logDebug(TAG, mOverallFictionalProgress.toString());\n\n        // Clean up the current moment.\n        if (mData.getCurrentMoment() != null) {\n            mData.getCurrentMoment().end();\n        }\n\n        NotificationManager notificationManager = (NotificationManager) getService()\n                .getSystemService(Context.NOTIFICATION_SERVICE);\n        notificationManager.cancel(MainService.CHOICE_NOTIFICATION_ID);\n        notificationManager.cancel(MainService.FITNESS_STATS_NOTIFICATION_ID);\n\n        if (mGoogleApiClientWrapper != null) {\n            mGoogleApiClientWrapper.endFitDataSession(TRACKED_DATA_TYPES, this);\n            mGoogleApiClientWrapper = null;\n        }\n    }\n\n    public void addMoment(String id, Moment moment) {\n        this.mData.addMoment(id, moment);\n    }\n\n    public void setFirstMomentId(String firstMomentId) {\n        this.mData.setFirstMomentId(firstMomentId);\n    }\n\n    public void update() {\n        mNowNanos = System.nanoTime();\n\n        // Calculate average speed at a consistent time interval.\n        float timePassedSeconds = Utils.nanosToSeconds(mNowNanos - mSampleStartTimeNanos);\n        if (timePassedSeconds >= AVERAGE_SPEED_SAMPLE_RATE_SECONDS) {\n            calculateAverageMinutesPerMile();\n        }\n\n        Moment currentMoment = mData.getCurrentMoment();\n        currentMoment.update(mNowNanos);\n        if (currentMoment.isDone()) {\n            mOverallFictionalProgress.addAll(currentMoment.getFictionalProgress());\n            currentMoment.end();\n            changeCurrentMoment(currentMoment.getNextMomentId(), mNowNanos);\n        }\n\n        if (mLastWeaponCharge != getWeaponChargedPercentage()) {\n            mLastWeaponCharge = getWeaponChargedPercentage();\n            // Create the notification to notify the user of their current fitness statistics.\n            postFitnessNotification(getFitnessNotificationTitle());\n        }\n\n        Intent updateFitnessStatsIntent = new Intent();\n        updateFitnessStatsIntent.setAction(UPDATE_FITNESS_STATS);\n        getService().sendBroadcast(updateFitnessStatsIntent);\n    }\n\n    public void postFitnessNotification(String title) {\n        NotificationOptions notificationOptions =\n                NotificationOptions.getDefaultNotificationOptions();\n        notificationOptions.setTitle(title);\n        notificationOptions.setContent(getService()\n                .getString(R.string.weapon_status_notification_text));\n        notificationOptions.setNotificationId(MainService.FITNESS_STATS_NOTIFICATION_ID);\n        notificationOptions.setPriorityAsHigh();\n        notificationOptions.setNotificationDefaults(NotificationCompat.DEFAULT_LIGHTS);\n        getService().postActionNotification(notificationOptions);\n    }\n\n    public void setService(MainService service) {\n        this.mService = service;\n    }\n\n    public MainService getService() {\n        return this.mService;\n    }\n\n    public boolean isDone() {\n        return mIsDone;\n    }\n\n    public void prepare(GoogleApiClientWrapper googleApiClientWrapper) {\n        Utils.logDebug(TAG, \"Mission prepared.\");\n\n        // Start collecting Google Fit data\n        mGoogleApiClientWrapper = googleApiClientWrapper;\n        mGoogleApiClientWrapper.startFitDataSession(\n                TRACKED_DATA_TYPES, getMissionData().getMissionName(), this);\n    }\n\n    public boolean isWeaponCharged() {\n        return mIsWeaponCharged;\n    }\n\n    public MissionData getMissionData() {\n        return this.mData;\n    }\n\n    /**\n     * Restarts the current moment with a time delay.\n     */\n    public void restartMoment() {\n        if (mData.getCurrentMoment() != null) {\n            mData.getCurrentMoment().restartWithDelay(mNowNanos, 0f);\n        }\n    }\n\n    public void applyOutcome(Outcome outcome) {\n        if (outcome.numEnemiesDefeatedIncremented()) {\n            mNumEnemiesDefeated++;\n        }\n        if (outcome.weaponChargeDepleted()) {\n            mIsWeaponCharged = false;\n        }\n    }\n\n    public ArrayList<String> getOverallFictionalProgress() {\n        return mOverallFictionalProgress;\n    }\n\n    @Override\n    public void onDataPoint(DataPoint dataPoint) {\n        // If we get data before the mission has started, discard them.\n        if (!mIsStarted) {\n            return;\n        }\n        DataType dataType = dataPoint.getDataType();\n        for (Field field : dataType.getFields()) {\n            Value val = dataPoint.getValue(field);\n            if (dataType.equals(DataType.TYPE_STEP_COUNT_DELTA)) {\n                onStepTaken(val.asInt());\n            } else if (dataType.equals(DataType.TYPE_SPEED)) {\n                // Data comes in as meters per second, have to convert to minutes per mile.\n                float speedMetersPerSeconds = val.asFloat();\n                updateChallengePace(Utils.metersPerSecondToMinutesPerMile(speedMetersPerSeconds));\n            }\n        }\n    }\n\n    public void onStepTaken(int steps) {\n        mNumStepsSinceBeginningOfSample += steps;\n        mTotalNumStepsTaken += steps;\n        Utils.logDebug(TAG,\n                \"Fit data update. You have now taken \" + mTotalNumStepsTaken + \" steps.\");\n\n        // Update UI whenever a step is taken\n        Intent updateFitnessStatsIntent = new Intent();\n        updateFitnessStatsIntent.setAction(UPDATE_FITNESS_STATS);\n        getService().sendBroadcast(updateFitnessStatsIntent);\n    }\n\n    public int getNumSteps() {\n        return this.mTotalNumStepsTaken;\n    }\n\n    public float getMinutesPerMile() {\n        return this.mCurrentAverageMinutesPerMile;\n    }\n\n    public int getNumMinutesExercised() {\n        long timePassedNanos = mNowNanos - mMissionStartTimeNanos;\n        int timePassedSeconds = (int) Utils.nanosToSeconds(timePassedNanos);\n        int timePassedMinutes = timePassedSeconds / Utils.MINUTES_TO_SECONDS_SCALE;\n        return timePassedMinutes;\n    }\n\n    public int getNumSecondsExercised() {\n        long timePassedNanos = mNowNanos - mMissionStartTimeNanos;\n        int timePassedSeconds = (int) Utils.nanosToSeconds(timePassedNanos);\n        return timePassedSeconds % Utils.MINUTES_TO_SECONDS_SCALE;\n    }\n\n    public int getWeaponChargedPercentage() {\n        if (mIsWeaponCharged) {\n            return 100;\n        }\n        if (!mIsAtChallengePace) {\n            return 0;\n        }\n        long timeAtChallengePaceNanos = mNowNanos - mTimestampStartOfChallengePaceNanos;\n        float timeAtChallengePaceMinutes = Utils.nanosToMinutes(timeAtChallengePaceNanos);\n        float weaponChargedPercentage = timeAtChallengePaceMinutes\n                / mData.getLengthOfIntervalMinutes() * 100;\n        return (int) weaponChargedPercentage;\n    }\n\n    public float getChallengePace() {\n        return mData.getChallengePaceMinutesPerMile();\n    }\n\n    public void onRebind() {\n        // Update UI after app wakes up (after the Activity is rebound to the Service)\n        Intent updateFitnessStatsIntent = new Intent();\n        updateFitnessStatsIntent.setAction(UPDATE_FITNESS_STATS);\n        getService().sendBroadcast(updateFitnessStatsIntent);\n    }\n\n    public static float getMaximumMinutesPerMile() {\n        return MAXIMUM_MINUTES_PER_MILE;\n    }\n\n    public ArrayList<String> getFitnessStatistics() {\n        ArrayList<String> fitnessStats = new ArrayList<>();\n\n        String numStepsTaken = String.format(getService()\n                .getString(R.string.fitness_stat_num_steps), mTotalNumStepsTaken);\n        fitnessStats.add(numStepsTaken);\n\n        String numIntervalsCompleted = String.format(getService()\n                .getString(R.string.fitness_stat_num_intervals), mTotalNumIntervalsCompleted);\n        fitnessStats.add(numIntervalsCompleted);\n\n        return fitnessStats;\n    }\n\n    private void calculateAverageMinutesPerMile() {\n        float timePassedSeconds = Utils.nanosToSeconds(mNowNanos - mSampleStartTimeNanos);\n        float timePassedMinutes = Utils.secondsToMinutes(timePassedSeconds);\n        float distanceTraveledFeet = mNumStepsSinceBeginningOfSample\n                * LENGTH_OF_RUNNING_STRIDE_FEET;\n        float distanceTraveledMiles = Utils.feetToMiles(distanceTraveledFeet);\n\n        if (distanceTraveledMiles > 0) {\n            updateChallengePace(timePassedMinutes / distanceTraveledMiles);\n        } else {\n            updateChallengePace(0.0f);\n        }\n    }\n\n    private void updateChallengePace(float averageMinutesPerMile) {\n        String updateText;\n        if (averageMinutesPerMile > 0) {\n            mCurrentAverageMinutesPerMile = averageMinutesPerMile;\n            updateText = (int)(mCurrentAverageMinutesPerMile)\n                    + getService().getString(R.string.log_message_minutes_per_mile);\n        } else {\n            mCurrentAverageMinutesPerMile = MAXIMUM_MINUTES_PER_MILE;\n            updateText = getService().getString(R.string.log_message_you_are_not_moving);\n        }\n\n        Utils.logDebug(TAG, updateText);\n\n        evaluateChallengePace();\n\n        // Reset start time and number of steps for next average speed sample.\n        mSampleStartTimeNanos = mNowNanos;\n        mNumStepsSinceBeginningOfSample = 0;\n    }\n\n    private void evaluateChallengePace() {\n        // Player is currently at challenge pace.\n        if (mCurrentAverageMinutesPerMile <= mData.getChallengePaceMinutesPerMile()) {\n            // At last check, player was not at challenge pace.\n            if (!mIsAtChallengePace) {\n                mService.queueSound(AT_CHALLENGE_PACE_URI, mService);\n\n                mTimestampStartOfChallengePaceNanos = mNowNanos;\n            }\n            // Player has been running at challenge pace for enough time to charge their weapon.\n            else if (!mIsWeaponCharged &&\n                    Utils.nanosToMinutes(mNowNanos - mTimestampStartOfChallengePaceNanos)\n                            >= mData.getLengthOfIntervalMinutes()) {\n                mService.queueSound(WEAPON_CHARGED_URI, mService);\n\n                mIsWeaponCharged = true;\n                mTotalNumIntervalsCompleted++;\n            }\n            mIsAtChallengePace = true;\n        }\n        // Player is not currently at challenge pace.\n        else {\n            // At last check, player was at challenge pace.\n            if (mIsAtChallengePace) {\n                mService.queueSound(NO_LONGER_AT_CHALLENGE_PACE_URI, mService);\n            }\n            mIsAtChallengePace = false;\n        }\n    }\n\n    private String getFitnessNotificationTitle() {\n        return getWeaponChargedPercentage()\n                + getService().getString(R.string.weapon_status_notification_title);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/MissionData.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport java.util.HashMap;\n\n/**\n * Encapsulates all of the game data that is necessary to represent a mission.\n */\npublic class MissionData {\n\n    private String mMissionName; // User-facing name of mission.\n    // ID must be unique to each mission\n    private String mMissionId;\n    private float mLengthOfMissionMinutes;\n    private float mLengthOfIntervalMinutes;\n    private float mChallengePaceMinutesPerMile;\n    private HashMap<String, Moment> mAllMoments;\n    private String mFirstMomentId;\n    private String mCurrentMomentId;\n\n    /**\n     * Most general constructor. Used when wanting to construct most pieces of MissionData\n     * explicitly.\n     * @param missionId String identifying the Mission.\n     * @param lengthOfGameMinutes Total length of game.\n     * @param lengthOfIntervalMinutes Length of a running interval.\n     * @param allMoments HashMap containing all Moments that define this Mission.\n     * @param firstMomentId The first Moment to be executed during the Mission.\n     * @param currentMomentId The current Moment of the Mission.\n     */\n    public MissionData(String missionName, String missionId, float lengthOfGameMinutes,\n            float lengthOfIntervalMinutes, float challengePaceMinutesPerMile,\n            HashMap<String, Moment> allMoments, String firstMomentId, String currentMomentId) {\n        this.mMissionName = missionName;\n        this.mMissionId = missionId;\n        this.mLengthOfMissionMinutes = lengthOfGameMinutes;\n        this.mLengthOfIntervalMinutes = lengthOfIntervalMinutes;\n        this.mChallengePaceMinutesPerMile = challengePaceMinutesPerMile;\n        this.mAllMoments = allMoments;\n        this.mFirstMomentId = firstMomentId;\n        this.mCurrentMomentId = currentMomentId;\n    }\n\n    /**\n     * Constructor used when populating MissionData with information from menu screens.\n     * @param missionId String identifying the Mission.\n     * @param lengthOfGameMinutes Total length of game.\n     * @param lengthOfIntervalMinutes Length of a running interval.\n     */\n    public MissionData(String missionName, String missionId, float lengthOfGameMinutes,\n            float lengthOfIntervalMinutes, float challengePaceMinutesPerMile) {\n        this(missionName, missionId, lengthOfGameMinutes, lengthOfIntervalMinutes,\n                challengePaceMinutesPerMile, new HashMap<String, Moment>(), null, null);\n    }\n\n    public String getMissionName() {\n        return this.mMissionName;\n    }\n\n    public String getMissionId() {\n        return this.mMissionId;\n    }\n\n    public float getLengthOfMissionMinutes() {\n        return this.mLengthOfMissionMinutes;\n    }\n\n    public float getLengthOfIntervalMinutes() {\n        return this.mLengthOfIntervalMinutes;\n    }\n\n    public float getChallengePaceMinutesPerMile() {\n        return this.mChallengePaceMinutesPerMile;\n    }\n\n    public Moment getMomentFromId(String momentId) {\n        return mAllMoments.get(momentId);\n    }\n\n    public String getCurrentMomentId() {\n        return this.mCurrentMomentId;\n    }\n\n    public String getFirstMomentId() {\n        return this.mFirstMomentId;\n    }\n\n    public void setCurrentMomentId(String currentMomentId) {\n        this.mCurrentMomentId = currentMomentId;\n    }\n\n    public void addMoment(String momentId, Moment moment) {\n        this.mAllMoments.put(momentId, moment);\n    }\n\n    public void setFirstMomentId(String firstMomentId) {\n        this.mFirstMomentId = firstMomentId;\n    }\n\n    public Moment getCurrentMoment() {\n        return mAllMoments.get(mCurrentMomentId);\n    }\n\n    public int getNumMoments() {\n        return mAllMoments.size();\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/Moment.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport com.google.fpl.gim.examplegame.utils.Utils;\n\nimport java.util.ArrayList;\n\n/**\n * A Moment is a discrete event within a Mission. Moments know when they are finished ('isDone()'),\n * and they are never reused.\n */\npublic abstract class Moment {\n    // The mission to which this moment belongs.\n    private Mission mMission;\n\n    public boolean mIsDone;\n    private boolean mShouldRestart;\n    private long mTimeWhenRestartRequestedNanos;\n    private long mRestartDelayLengthNanos;\n\n    /**\n     * @param mission The Mission to which this moment belongs. Cannot be changed after\n     *                instantiation - each Moment is irrevocably associated with a Mission.\n     */\n    protected Moment(Mission mission) {\n        this.mMission = mission;\n    }\n\n    public Mission getMission() {\n        return mMission;\n    }\n\n    /**\n     * Called on the current moment to determine if it is appropriate to move on.\n     * @return true if this moment no longer should be active as the current moment.\n     */\n    public boolean isDone() {\n        return mIsDone;\n    }\n\n    public void setIsDone(boolean isDone) {\n        this.mIsDone = isDone;\n    }\n\n    /**\n     * Update the moment information for the current time. Default behavior checks if the Moment\n     * should restart, and does.\n     * @param nowNanos The current time, represented in nanoseconds.\n     */\n    public void update(long nowNanos) {\n        if (mShouldRestart\n                && nowNanos > mTimeWhenRestartRequestedNanos + mRestartDelayLengthNanos) {\n            restart(nowNanos);\n        }\n    }\n\n    /**\n     * Read the id of the next Moment associated with this Moment.\n     * @return String identifying the next Moment associated with this Moment.\n     */\n\n    public abstract String getNextMomentId();\n\n    /**\n     * Make this moment active. Runs when the moment begins.\n     * @param nowNanos The current time, represented in nanoseconds.\n     */\n    public void start(long nowNanos) {\n        this.mIsDone = false;\n        this.mShouldRestart = false;\n    }\n\n    /**\n     * Ends the current moment.\n     */\n    public abstract void end();\n\n    /**\n     * Restarts a moment.\n     */\n    public abstract void restart(long nowNanos);\n\n    public void restartWithDelay(long nowNanos, float secondsDelayRestart) {\n        mShouldRestart = true;\n        mTimeWhenRestartRequestedNanos = nowNanos;\n        mRestartDelayLengthNanos = Utils.secondsToNanos(secondsDelayRestart);\n    }\n\n    public abstract ArrayList<String> getFictionalProgress();\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/MomentData.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport java.util.ArrayList;\n\n/**\n * Encapsulates the data that is needed to define a unique Moment.\n */\npublic abstract class MomentData {\n\n    // The id of this moment. Must be unique across the moments in the mission.\n    private final String mMomentId;\n    // The moment to go to next.\n    private final String mNextMomentId;\n\n    private ArrayList<String> mFictionalProgress;\n\n    /**\n     * Constructor to explicitly set all fields for a ChoiceMomentData.\n     * @param momentId Identifier for the ChoiceMoment.\n     * @param nextMomentId The moment following this one. Null if is the last moment in a mission.\n     * @param fictionalProgress Fictional progress for this moment.\n     */\n    public MomentData(String momentId, String nextMomentId, ArrayList<String> fictionalProgress) {\n        mMomentId = momentId;\n        mNextMomentId = nextMomentId;\n        mFictionalProgress = fictionalProgress;\n    }\n\n    public String getMomentId() {\n        return mMomentId;\n    }\n\n    public String getNextMomentId() {\n        return mNextMomentId;\n    }\n\n    public ArrayList<String> getFictionalProgress() {\n        return mFictionalProgress;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/Outcome.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\n/**\n * Encapsulates the game data changes that should occur as a result of a certain Choice\n */\npublic class Outcome {\n    private boolean mDepleteWeaponCharge;\n    private boolean mIncrementNumEnemiesDefeated;\n\n    public Outcome(boolean depleteWeaponCharge, boolean incrementNumEnemiesDefeated) {\n        this.mDepleteWeaponCharge = depleteWeaponCharge;\n        this.mIncrementNumEnemiesDefeated = incrementNumEnemiesDefeated;\n    }\n\n    public boolean weaponChargeDepleted() {\n        return this.mDepleteWeaponCharge;\n    }\n\n    public boolean numEnemiesDefeatedIncremented() {\n        return this.mIncrementNumEnemiesDefeated;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/SfxMoment.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport android.media.MediaPlayer;\n\nimport java.io.IOException;\nimport java.util.ArrayList;\n\n/**\n * Describes a Moment in which the user listens to a pre-recorded sound effect as part of the\n * gameplay.\n */\npublic class SfxMoment extends Moment implements MediaPlayer.OnCompletionListener {\n\n    private SfxMomentData mData;\n\n    public SfxMoment(Mission mission, SfxMomentData data) {\n        super(mission);\n        this.mData = data;\n    }\n\n    @Override\n    public void start(long nowNanos) {\n        super.start(nowNanos);\n        getMission().getService().queueSound(mData.getUriAsset(), this);\n    }\n\n    @Override\n    public void end() {\n    }\n\n    @Override\n    public String getNextMomentId() {\n        return mData.getNextMomentId();\n    }\n\n    /**\n     * We need to know when our specific sfx is done playing. Then we fallback to the default\n     * onCompletionListener to finish cleaning up.\n     */\n    @Override\n    public void onCompletion(MediaPlayer mp) {\n        setIsDone(true);\n        getMission().getService().onCompletion(mp);\n    }\n\n    @Override\n    public void restart(long nowNanos) {\n        getMission().getService().dequeueSound(mData.getUriAsset());\n        // Try to start again.\n        start(nowNanos);\n    }\n\n    public SfxMomentData getMomentData() {\n        return this.mData;\n    }\n\n    @Override\n    public ArrayList<String> getFictionalProgress() {\n        return mData.getFictionalProgress();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/SfxMomentData.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport android.net.Uri;\n\nimport java.util.ArrayList;\n\n/**\n * Encapsulates the data that is needed to define a unique NotificationAudioMoment.\n */\npublic class SfxMomentData extends MomentData {\n\n    // The name of the sound file to play\n    private final Uri mUriAsset;\n\n    /**\n     * Constructor to explicitly set all fields for a ChoiceMomentData.\n     * @param momentId Identifier for the ChoiceMoment.\n     * @param nextMomentId The moment following this one. Null if is the last moment in a mission.\n     * @param fictionalProgress Fictional progress for this moment.\n     * @param uriAsset Uri of the sound to play with this moment.\n     */\n    public SfxMomentData(String momentId, String nextMomentId,\n                         ArrayList<String> fictionalProgress, Uri uriAsset) {\n        super(momentId, nextMomentId, fictionalProgress);\n        mUriAsset = uriAsset;\n    }\n\n    public Uri getUriAsset() {\n        return mUriAsset;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/SpokenTextMoment.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport android.speech.tts.TextToSpeech;\nimport android.speech.tts.UtteranceProgressListener;\n\nimport com.google.fpl.gim.examplegame.utils.Utils;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\n\n/**\n * Describes a Moment in which the user listens to a piece of fiction as part of the gameplay.\n * The fiction will be read aloud using Android's text-to-speech capabilities.\n */\npublic class SpokenTextMoment extends Moment {\n\n    private static final String TAG = SpokenTextMoment.class.getSimpleName();\n\n    private SpokenTextMomentData mData;\n\n    private static final float RETRY_WAIT_TIME_SECONDS = 2.5f;\n    // Buffer time before speaking with TextToSpeech.\n    private static final long SILENCE_LENGTH_MILLIS = 500;\n\n    // Determines behavior to execute during TextToSpeech speaking.\n    private UtteranceProgressListener mUtteranceProgressListener = new UtteranceProgressListener() {\n        @Override\n        public void onStart(String utteranceId) {\n        }\n\n        @Override\n        /**\n         * Determines behavior when TextToSpeech has completed speaking, or stopped.\n         */\n        public void onDone(String utteranceId) {\n            setIsDone(true);\n            getMission().getService().endPlayback();\n        }\n\n        @Override\n        public void onError(String utteranceId) {\n        }\n    };\n\n    public SpokenTextMoment(Mission mission, SpokenTextMomentData data) {\n        super(mission);\n        this.mData = data;\n    }\n\n    @Override\n    public void start(long nowNanos) {\n        super.start(nowNanos);\n        Utils.logDebug(TAG, \"SpokenTextMoment \\\"\" + mData.getMomentId() + \"\\\" started.\");\n\n        if (getMission().getService().obtainAudioFocus()) {\n            speak();\n        } else {\n            // Try again at a future time.\n            restartWithDelay(nowNanos, RETRY_WAIT_TIME_SECONDS);\n        }\n    }\n\n    @Override\n    public void end() {\n        Utils.logDebug(TAG, \"SpokenTextMoment \\\"\" + mData.getMomentId() + \"\\\" ended.\");\n        getMission().getService().getTextToSpeech().setOnUtteranceProgressListener(null);\n        getMission().getService().getTextToSpeech().stop();\n    }\n\n    public String getNextMomentId() {\n        return mData.getNextMomentId();\n    }\n\n    /**\n     * Use TextToSpeech to say the words associated with this Moment.\n     */\n    private void speak() {\n        TextToSpeech textToSpeech = getMission().getService().getTextToSpeech();\n        textToSpeech.setOnUtteranceProgressListener(mUtteranceProgressListener);\n        textToSpeech.playSilence(SILENCE_LENGTH_MILLIS, TextToSpeech.QUEUE_ADD, null);\n        HashMap<String, String> map = new HashMap<>();\n        map.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, mData.getMomentId());\n        textToSpeech.speak(mData.getTextToSpeak(), TextToSpeech.QUEUE_ADD, map);\n    }\n\n    @Override\n    public void restart(long nowNanos) {\n        // Stop anything in progress.\n        end();\n        start(nowNanos);\n    }\n\n    public SpokenTextMomentData getMomentData() {\n        return this.mData;\n    }\n\n    @Override\n    public ArrayList<String> getFictionalProgress() {\n        return mData.getFictionalProgress();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/SpokenTextMomentData.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport java.util.ArrayList;\n\n/**\n * Encapsulates the data that is needed to define a unique FictionAudioMoment.\n */\npublic class SpokenTextMomentData extends MomentData {\n    // The text to be read aloud using text-to-speech\n    private final String mTextToSpeak;\n\n    /**\n     * Constructor to explicitly set all fields for a ChoiceMomentData.\n     * @param momentId Identifier for the ChoiceMoment.\n     * @param nextMomentId The moment following this one. Null if is the last moment in a mission.\n     * @param fictionalProgress Fictional progress for this moment.\n     * @param textToSpeak Words associated with this moment.\n     */\n    public SpokenTextMomentData(String momentId, String nextMomentId,\n        ArrayList<String> fictionalProgress, String textToSpeak) {\n        super(momentId, nextMomentId, fictionalProgress);\n        mTextToSpeak = textToSpeak;\n    }\n\n    public String getTextToSpeak() {\n        return mTextToSpeak;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/TimerMoment.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport com.google.fpl.gim.examplegame.utils.Utils;\n\nimport java.util.ArrayList;\n\n/**\n * Describes a Moment in which there is a gap in gameplay for a given amount of time.\n */\npublic class TimerMoment extends Moment {\n    private static final String TAG = TimerMoment.class.getSimpleName();\n    private TimerMomentData mData;\n\n    private long mStartTimeNanos;\n\n    public TimerMoment(Mission mission, TimerMomentData data) {\n        super(mission);\n        this.mData = data;\n    }\n\n    @Override\n    public void update(long nowNanos) {\n        setIsDone(hasMomentTimeElapsed(nowNanos));\n    }\n\n    @Override\n    public void start(long nowNanos) {\n        super.start(nowNanos);\n        Utils.logDebug(TAG, \"TimerMoment \\\"\" + mData.getMomentId() + \"\\\" started.\");\n        setStartTimeNanos(nowNanos);\n    }\n\n    @Override\n    public void end() {\n        Utils.logDebug(TAG, \"TimerMoment \\\"\" + mData.getMomentId() + \"\\\" ended.\");\n    }\n\n    /**\n     * Determines if the TimerMoment has elapsed.\n     * @param nowNanos The current time.\n     * @return True if the time since the TimerMoment started is greater than or equal to the length\n     *         of the timer moment.\n     */\n    public boolean hasMomentTimeElapsed(long nowNanos) {\n        return (nowNanos - mStartTimeNanos) >= Utils.minutesToNanos(mData.getLengthMinutes());\n    }\n\n    public void setStartTimeNanos(long startTimeNanos) {\n        this.mStartTimeNanos = startTimeNanos;\n    }\n\n    @Override\n    public String getNextMomentId() {\n        return mData.getNextMomentId();\n    }\n\n    @Override\n    public void restart(long nowNanos) {\n        // No additional tear down or resetting necessary.\n        start(nowNanos);\n    }\n\n    public TimerMomentData getMomentData() {\n        return this.mData;\n    }\n\n    @Override\n    public ArrayList<String> getFictionalProgress() {\n        return mData.getFictionalProgress();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/TimerMomentData.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame;\n\nimport java.util.ArrayList;\n\n/**\n * Encapsulates the data that is needed to define a unique TimerMoment.\n */\npublic class TimerMomentData extends MomentData {\n\n    // The length of the timer in minutes\n    private float mLengthMinutes;\n\n    /**\n     * Constructor to explicitly set all fields for a ChoiceMomentData.\n     * @param momentId Identifier for the ChoiceMoment.\n     * @param nextMomentId The moment following this one. Null if is the last moment in a mission.\n     * @param fictionalProgress Fictional progress for this moment.\n     * @param lengthMinutes Length of this moment.\n     */\n    public TimerMomentData(String momentId, String nextMomentId,\n        ArrayList<String> fictionalProgress, float lengthMinutes) {\n        super(momentId, nextMomentId, fictionalProgress);\n        mLengthMinutes = lengthMinutes;\n    }\n\n    public float getLengthMinutes() {\n        return mLengthMinutes;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/google/FitDataTypeSetting.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.google;\n\nimport com.google.android.gms.fitness.data.DataType;\n\n/**\n * This keeps track of the sensor data types and their registration settings.\n */\npublic class FitDataTypeSetting {\n    private boolean mRequired; // Is this data type required for the game to start?\n    private DataType mDataType;\n    private long mSamplingRateSeconds;\n    private int mAccuracyMode;\n\n    public FitDataTypeSetting(\n            boolean required, DataType dataType, long samplingRateSeconds, int accuracyMode) {\n        mRequired = required;\n        mDataType = dataType;\n        mSamplingRateSeconds = samplingRateSeconds;\n        mAccuracyMode = accuracyMode;\n    }\n\n    public boolean isRequired() {\n        return mRequired;\n    }\n\n    public DataType getDataType() {\n        return mDataType;\n    }\n\n    public long getSamplingRateSeconds() {\n        return mSamplingRateSeconds;\n    }\n\n    public int getAccuracyMode() {\n        return mAccuracyMode;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/google/FitResultCallback.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.google;\n\nimport android.util.Log;\n\nimport com.google.android.gms.common.api.Result;\nimport com.google.android.gms.common.api.Status;\nimport com.google.android.gms.fitness.FitnessStatusCodes;\nimport com.google.android.gms.fitness.data.DataType;\nimport com.google.fpl.gim.examplegame.utils.Utils;\n\n/**\n * Implements ResultCallback<Result> while allowing to record more state so we can change game flow\n * accordingly.\n */\npublic class FitResultCallback <R extends Result>\n        implements com.google.android.gms.common.api.ResultCallback<R> {\n    private static final String TAG = \"GoogleFitResultCallback\";\n\n    // Enum type for keeping track of which API generated this callback.\n    public enum RegisterType {\n        SENSORS,\n        RECORDING,\n        SESSION,\n    }\n\n    GoogleApiClientWrapper mGoogleApiClient;\n    RegisterType mRegisterType;\n    DataType mDataType;\n    boolean mSubscribe;  // True if subscribe, false if unsubscribe.\n\n    /**\n     * Default constructor.\n     * @param googleApiClient The GoogleApiClientWrapper to pass data back to.\n     * @param registerType The type of call that resulted in this callback.\n     * @param dataType The data type we are trying to process.\n     * @param subscribe If true, this is a subscribe or a register call.\n     */\n    public FitResultCallback(\n            GoogleApiClientWrapper googleApiClient, RegisterType registerType, DataType dataType,\n            boolean subscribe) {\n        mGoogleApiClient = googleApiClient;\n        mRegisterType = registerType;\n        mDataType = dataType;\n        mSubscribe = subscribe;\n    }\n\n    @Override\n    public void onResult(R result) {\n        switch (mRegisterType) {\n            case SENSORS:\n                onSensorResult(result.getStatus());\n                break;\n            case RECORDING:\n                onRecordingResult(result.getStatus());\n                break;\n            case SESSION:\n                onSessionResult(result.getStatus());\n                break;\n            default:\n                Log.e(TAG, \"Unknown enum type.\");\n        }\n    }\n\n    private void onSensorResult(Status status) {\n        if (status.isSuccess()) {\n            // There is a lapse between this callback to actually getting data from the listener,\n            // depending on the data type. It is a known issue, by design. You can account for that\n            // delay with display text or other mechanisms.\n            mGoogleApiClient.sensorRegistered(mDataType);\n            Utils.logDebug(TAG, \"Successfully registered sensor for \" + mDataType.toString());\n        } else {\n            Utils.logDebug(TAG, \"There was a problem registering .\" + mDataType + \"\\n\" +\n                    status.getStatusMessage());\n        }\n\n    }\n\n    private void onRecordingResult(Status status) {\n        if (mSubscribe) {\n            onRecordingSubscription(status);\n        } else {\n            onRecordingUnsubscription(status);\n        }\n    }\n\n    private void onRecordingSubscription(Status status) {\n        if (status.isSuccess()) {\n            if (status.getStatusCode()\n                    == FitnessStatusCodes.SUCCESS_ALREADY_SUBSCRIBED) {\n                Utils.logDebug(TAG, \"Existing subscription for activity detected.\");\n            } else {\n                Utils.logDebug(TAG, \"Started recording data for \" + mDataType);\n            }\n        } else {\n            // For a better user experience, you can add visual error text indicating the session\n            // will not be recorded to the cloud.\n            Utils.logDebug(TAG, \"Unable to start recording data for \" + mDataType);\n        }\n    }\n\n    private void onRecordingUnsubscription(Status status) {\n        if (status.isSuccess()) {\n            Utils.logDebug(TAG, \"Stopped recording data for \" + mDataType);\n        } else {\n            Utils.logDebug(TAG, \"Unable to stop recording data for \" + mDataType);\n        }\n    }\n\n    private void onSessionResult(Status status) {\n        if (mSubscribe) {\n            onSessionSubscription(status);\n        } else {\n            onSessionUnsubscription(status);\n        }\n    }\n\n    private void onSessionSubscription(Status status) {\n        if (status.isSuccess()) {\n            Utils.logDebug(TAG, \"Started data session.\");\n        } else {\n            // For a better user experience, you can add visual error text indicating the session\n            // will not be identified in the cloud.\n            Utils.logDebug(TAG, \"Unable to start data session.\");\n        }\n    }\n\n    private void onSessionUnsubscription(Status status) {\n        if (status.isSuccess()) {\n            Utils.logDebug(TAG, \"Ended data session.\");\n        } else {\n            Utils.logDebug(TAG, \"Unable to end data session.\");\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/google/GoogleApiClientWrapper.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.google;\n\nimport android.app.Activity;\nimport android.content.IntentSender;\nimport android.os.Bundle;\nimport android.util.Log;\n\nimport com.google.android.gms.common.ConnectionResult;\nimport com.google.android.gms.common.GooglePlayServicesUtil;\nimport com.google.android.gms.common.api.GoogleApiClient;\nimport com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;\nimport com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;\nimport com.google.android.gms.common.api.PendingResult;\nimport com.google.android.gms.common.api.Status;\nimport com.google.android.gms.fitness.Fitness;\nimport com.google.android.gms.fitness.FitnessActivities;\nimport com.google.android.gms.fitness.FitnessStatusCodes;\nimport com.google.android.gms.fitness.data.DataType;\nimport com.google.android.gms.fitness.data.Session;\nimport com.google.android.gms.fitness.request.OnDataPointListener;\nimport com.google.android.gms.fitness.request.SensorRequest;\nimport com.google.android.gms.fitness.result.SessionStopResult;\nimport com.google.android.gms.games.Games;\nimport com.google.fpl.gim.examplegame.MainActivity;\nimport com.google.fpl.gim.examplegame.utils.Utils;\n\nimport java.util.HashSet;\nimport java.util.Set;\nimport java.util.concurrent.TimeUnit;\n\n/**\n * Container class to hold a static instance of GoogleApiClient.  This allows the MainActivity\n * class to implement the GoogleApiClient.OnConnectionFailedListener interface (which\n * requires an Activity to request authentications from the user) and the MainService class to\n * implement the GoogleApiClient.ConnectionCallbacks interface.  This also allows the Google\n * API client to be subsequently accessed by either class.\n */\npublic class GoogleApiClientWrapper implements ConnectionCallbacks, OnConnectionFailedListener {\n    private static final String TAG = GoogleApiClientWrapper.class.getSimpleName();\n    private static final String SESSION_NAME = \"Games-in-Motion Mission\";\n    public static final int REQUEST_CODE_OAUTH = 1;\n\n    private boolean mAuthInProgress = false;\n\n    private Activity mActivity; // Activity for GoogleApiClient to launch visual elements on.\n    private GoogleApiClient mGoogleApiClient;\n\n    private Set<FitDataTypeSetting> sensorsAwaitingRegistration = new HashSet<>();\n\n    /**\n     * Builds a GoogleApiClient that connects to the Fitness Api.\n     * @param activity The activity through which authorization UI will be launched.\n     */\n    public void buildGoogleApiClient(Activity activity) {\n        if (mGoogleApiClient != null) {\n            return;\n        }\n        Utils.logDebug(TAG, \"Building the Google Api Client.\");\n\n        mActivity = activity;\n\n        // Create the Google API Client.\n        mGoogleApiClient = new GoogleApiClient.Builder(activity, this, this)\n                .addApi(Fitness.API)                    // Fitness API\n                .addScope(Fitness.SCOPE_ACTIVITY_READ)  // Fitness Scopes\n                .addScope(Fitness.SCOPE_LOCATION_READ)\n                .addApi(Games.API)                      // Games API\n                .addScope(Games.SCOPE_GAMES)            // Games Scope\n                .build();\n    }\n\n    public void connect() {\n        // Make sure the app is not already connected or attempting to connect\n        if (!mGoogleApiClient.isConnecting() && !mGoogleApiClient.isConnected()) {\n            mGoogleApiClient.connect();\n        }\n    }\n\n    public void disconnect() {\n        if (mGoogleApiClient.isConnected()) {\n            mGoogleApiClient.disconnect();\n        }\n    }\n\n    @Override\n    public void onConnected(Bundle connectionHint) {\n        Utils.logDebug(TAG, \"Connected!\");\n\n        // Send the hint to Activity for UI updates\n        ((MainActivity) mActivity).onFitStatusUpdated(true);\n    }\n\n    @Override\n    public void onConnectionSuspended(int i) {\n        // If your connection gets lost at some point,\n        // you'll be able to determine the reason and react to it here.\n        if (i == ConnectionCallbacks.CAUSE_NETWORK_LOST) {\n            Utils.logDebug(TAG, \"Connection lost.  Cause: Network Lost.\");\n        } else if (i == ConnectionCallbacks.CAUSE_SERVICE_DISCONNECTED) {\n            Utils.logDebug(TAG, \"Connection lost.  Reason: Service Disconnected\");\n        }\n        // Send the hint to Activity for UI updates\n        ((MainActivity) mActivity).onFitStatusUpdated(false);\n        // Attempt to reconnect\n        connect();\n    }\n\n    @Override\n    public void onConnectionFailed(ConnectionResult result) {\n        Log.e(TAG, \"Connection failed. Cause: \" + result.toString());\n        if (!result.hasResolution()) {\n            // Show the localized error dialog\n            GooglePlayServicesUtil.getErrorDialog(result.getErrorCode(), mActivity, 0).show();\n            return;\n        }\n        // The failure has a resolution. Resolve it.\n        // Called typically when the app is not yet authorized, and an\n        // authorization dialog is displayed to the user.\n        if (!mAuthInProgress && (result.getErrorCode() == ConnectionResult.SIGN_IN_REQUIRED\n                || result.getErrorCode() == FitnessStatusCodes.NEEDS_OAUTH_PERMISSIONS)) {\n            try {\n                Utils.logDebug(TAG, \"Attempting to resolve failed connection\");\n                mAuthInProgress = true;\n                result.startResolutionForResult(mActivity, REQUEST_CODE_OAUTH);\n            } catch (IntentSender.SendIntentException e) {\n                mAuthInProgress = false;\n                Log.e(TAG, \"Exception while starting resolution activity\", e);\n            }\n        }\n    }\n    /**\n     * Starts a new session for Fit data. This will take care of registering all the sensors,\n     * recording the sensor data, and registering the data set as a session to Google Fit.\n     * @param dataTypeSettings Types of data to listen to, in an array.\n     * @param sessionDescription The description of the session.\n     * @param listener The OnDataPointListener to receive sensor events.\n     */\n    public void startFitDataSession(FitDataTypeSetting[] dataTypeSettings,\n                                    String sessionDescription, OnDataPointListener listener) {\n        for (FitDataTypeSetting dataTypeSetting : dataTypeSettings) {\n            registerFitDataListener(dataTypeSetting, listener);\n            startRecordingFitData(dataTypeSetting);\n        }\n\n        Session session = new Session.Builder()\n                .setName(SESSION_NAME)\n                .setDescription(sessionDescription)\n                .setActivity(FitnessActivities.RUNNING_JOGGING)\n                .setStartTime(System.currentTimeMillis(), TimeUnit.MILLISECONDS)\n                .build();\n\n        PendingResult<Status> pendingResult =\n                Fitness.SessionsApi.startSession(mGoogleApiClient, session);\n        pendingResult.setResultCallback(new FitResultCallback<Status>(\n                this, FitResultCallback.RegisterType.SESSION, null /* dataType */,\n                true /* subscribe */));\n    }\n\n    /**\n     * Ends the session for Fit data. This will take care of un-registering all the sensors,\n     * stop recording the sensor data, and stop recording the data set as a session to Google Fit.\n     * @param dataTypeSettings Types of data to listen to, in an array.\n     * @param listener The OnDataPointListener to receive sensor events.\n     */\n    public void endFitDataSession(\n            FitDataTypeSetting[] dataTypeSettings, OnDataPointListener listener) {\n        if (mGoogleApiClient.isConnected()) {\n            PendingResult<SessionStopResult> pendingResult =\n                    Fitness.SessionsApi.stopSession(mGoogleApiClient, null);\n            pendingResult.setResultCallback(new FitResultCallback<SessionStopResult>(\n                    this, FitResultCallback.RegisterType.SESSION, null /* dataType */,\n                    false /* subscribe */));\n\n            for (FitDataTypeSetting dataTypeSetting : dataTypeSettings) {\n                stopRecordingFitData(dataTypeSetting);\n                unregisterFitDataListener(listener);\n            }\n        }\n    }\n\n    public boolean isSignedIn() {\n        return (mGoogleApiClient != null && mGoogleApiClient.isConnected());\n    }\n\n    public void userAuthenticated() {\n        mAuthInProgress = false;\n    }\n\n    public boolean isClientReady() {\n        // Make sure all the required sensors are registered.\n        boolean hasUnregisteredSensor = false;\n        for (FitDataTypeSetting fitDataTypeSetting : sensorsAwaitingRegistration) {\n            if (fitDataTypeSetting.isRequired()) {\n                hasUnregisteredSensor = true;\n                break;\n            }\n        }\n\n        return (mGoogleApiClient.isConnected() && !hasUnregisteredSensor);\n    }\n\n    public GoogleApiClient getGoogleApiClient() {\n        return mGoogleApiClient;\n    }\n\n    protected void sensorRegistered(DataType dataType) {\n        for (FitDataTypeSetting fitDataTypeSetting : sensorsAwaitingRegistration) {\n            if (fitDataTypeSetting.getDataType().equals(dataType)) {\n                sensorsAwaitingRegistration.remove(fitDataTypeSetting);\n                break;\n            }\n\n        }\n    }\n\n    /**\n     * Add RecordingApi listener for recording to GoogleFit backend. Can be called repeatedly on\n     * multiple data types.\n     * @param dataTypeSetting Type of data to listen to.\n     */\n    private void startRecordingFitData(FitDataTypeSetting dataTypeSetting) {\n        Fitness.RecordingApi.subscribe(mGoogleApiClient, dataTypeSetting.getDataType())\n                .setResultCallback(new FitResultCallback<Status>(\n                        this, FitResultCallback.RegisterType.RECORDING,\n                        dataTypeSetting.getDataType(), true));\n    }\n\n    private void stopRecordingFitData(FitDataTypeSetting dataTypeSetting) {\n        Fitness.RecordingApi.unsubscribe(mGoogleApiClient, dataTypeSetting.getDataType())\n                .setResultCallback(new FitResultCallback<Status>(\n                        this, FitResultCallback.RegisterType.RECORDING,\n                        dataTypeSetting.getDataType(), false));\n    }\n\n    /**\n     * Add SensorsApi listener for real-time display of sensor data. Can be called repeatedly on\n     * multiple data types.\n     * @param dataTypeSetting Type of data to listen to.\n     * @param listener Listener for callbacks from SensorsApi.\n     */\n    private void registerFitDataListener(\n            FitDataTypeSetting dataTypeSetting, OnDataPointListener listener) {\n        sensorsAwaitingRegistration.add(dataTypeSetting);\n        Fitness.SensorsApi.add(\n                mGoogleApiClient,\n                new SensorRequest.Builder()\n                        .setDataType(dataTypeSetting.getDataType())\n                        .setSamplingRate(dataTypeSetting.getSamplingRateSeconds(), TimeUnit.SECONDS)\n                        .setAccuracyMode(dataTypeSetting.getAccuracyMode())\n                        .build(),\n                listener)\n                .setResultCallback(new FitResultCallback<Status>(\n                        this, FitResultCallback.RegisterType.SENSORS, dataTypeSetting.getDataType(),\n                        true));\n    }\n\n    private void unregisterFitDataListener(OnDataPointListener listener) {\n        Fitness.SensorsApi.remove(mGoogleApiClient, listener);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/gui/EndSummaryFragment.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.gui;\n\nimport android.app.Fragment;\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ArrayAdapter;\nimport android.widget.ListView;\n\nimport com.google.fpl.gim.examplegame.MainActivity;\nimport com.google.fpl.gim.examplegame.R;\n\nimport java.util.ArrayList;\n\n/**\n * Displays post-run summary.\n */\npublic class EndSummaryFragment extends Fragment {\n    private ListView mFictionalProgressList;\n    private ListView mFitnessStatisticsList;\n    private boolean mGoogleFitConnected = false;\n\n    @Override\n    public View onCreateView(LayoutInflater inflater, ViewGroup container,\n                             Bundle savedInstanceState) {\n        View rootView = inflater.inflate(R.layout.end_screen, container, false);\n        mFictionalProgressList = (ListView) rootView.findViewById(R.id.fictionalProgressList);\n        mFitnessStatisticsList = (ListView) rootView.findViewById(R.id.fitnessStatisticsList);\n        return rootView;\n    }\n\n    @Override public void onResume() {\n        super.onResume();\n        if (mGoogleFitConnected) {\n            ((MainActivity) getActivity()).setActionBarTitle(R.string.run_finish_text);\n        } else {\n            ((MainActivity) getActivity()).setActionBarTitle(R.string.fit_disconnected_text);\n        }\n    }\n\n    public void displayStats(ArrayList<String> fictionalProgress,\n            ArrayList<String> fitnessStatistics) {\n        mFictionalProgressList.setAdapter(new ArrayAdapter<>(getActivity(),\n                R.layout.menu_list_item, R.id.list_item_text, fictionalProgress));\n        mFitnessStatisticsList.setAdapter(new ArrayAdapter<>(getActivity(),\n                R.layout.menu_list_item, R.id.list_item_text, fitnessStatistics));\n    }\n\n    public void onFitStatusUpdated(boolean connected) {\n        mGoogleFitConnected = connected;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/gui/FitnessDataDisplayFragment.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.gui;\n\nimport android.app.Fragment;\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ProgressBar;\nimport android.widget.TextView;\n\nimport com.google.fpl.gim.examplegame.MainActivity;\nimport com.google.fpl.gim.examplegame.Mission;\nimport com.google.fpl.gim.examplegame.R;\n\n/**\n * Display fitness data during a run.\n */\npublic class FitnessDataDisplayFragment extends Fragment {\n\n    private TextView mNumSteps;\n    private TextView mMinutesPerMile;\n    private TextView mTimeExercised;\n    private TextView mWeaponChargedPercentage;\n    private ProgressBar mProgressBar;\n    private String mMissionName = \"Mission\";\n\n    @Override\n    public View onCreateView(LayoutInflater inflater, ViewGroup container,\n                             Bundle savedInstanceState) {\n        View rootView = inflater.inflate(R.layout.step_display, container, false);\n        mNumSteps = (TextView) rootView.findViewById(R.id.num_steps_taken);\n        mMinutesPerMile = (TextView) rootView.findViewById(R.id.minutes_per_mile);\n        mTimeExercised = (TextView) rootView.findViewById(R.id.time_exercised);\n        mWeaponChargedPercentage = (TextView) rootView.findViewById(R.id.percent_weapon_charged);\n\n        mProgressBar = (ProgressBar) rootView.findViewById(R.id.circular_progress_bar);\n        mProgressBar.setMax(100);\n        mProgressBar.setProgress(0);\n\n        return rootView;\n    }\n\n    @Override public void onResume() {\n        super.onResume();\n        ((MainActivity)getActivity()).setActionBarTitle(mMissionName);\n    }\n\n    public void setNumSteps(int numSteps) {\n        mNumSteps.setText(String.format(\"%d steps\", numSteps));\n    }\n\n    public void setMinutesPerMile(float minutesPerMile, float challengePace) {\n        if (minutesPerMile >= Mission.getMaximumMinutesPerMile()) {\n            mMinutesPerMile.setText(getActivity().getString(R.string.not_moving_speed));\n\n        } else {\n            String minutesPerMileText = String.format(\"%.2f\\nmins/mile\", minutesPerMile);\n            mMinutesPerMile.setText(minutesPerMileText);\n            if (minutesPerMile <= challengePace) {\n                mMinutesPerMile.setTextColor(getResources().getColor(R.color.green));\n            } else {\n                mMinutesPerMile.setTextColor(getResources().getColor(R.color.red));\n            }\n        }\n    }\n\n    public void setTimeExercised(int numMinutes, int numSeconds) {\n        mTimeExercised.setText(String.format(\"%d:%02d\", numMinutes, numSeconds));\n    }\n\n    public void setWeaponChargedPercentage(int weaponChargedPercentage) {\n        mWeaponChargedPercentage.setText(String.format(\"%d%%\", weaponChargedPercentage));\n        mProgressBar.setProgress(weaponChargedPercentage);\n    }\n\n    public void setFitnessStats(Mission mission) {\n        setNumSteps(mission.getNumSteps());\n        setMinutesPerMile(mission.getMinutesPerMile(), mission.getChallengePace());\n        setTimeExercised(mission.getNumMinutesExercised(), mission.getNumSecondsExercised());\n        setWeaponChargedPercentage(mission.getWeaponChargedPercentage());\n    }\n\n    public void setMissionName(String missionName) {\n        mMissionName = missionName;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/gui/GameViews.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.gui;\n\nimport android.app.Activity;\n\nimport com.google.fpl.gim.examplegame.R;\nimport com.google.fpl.gim.examplegame.gui.EndSummaryFragment;\nimport com.google.fpl.gim.examplegame.gui.FitnessDataDisplayFragment;\nimport com.google.fpl.gim.examplegame.gui.MissionSelectionFragment;\nimport com.google.fpl.gim.examplegame.gui.MusicSelectionFragment;\nimport com.google.fpl.gim.examplegame.gui.RunSpecificationSelectionFragment;\nimport com.google.fpl.gim.examplegame.gui.StartMenuFragment;\n\n/**\n * Container for the game's UI Fragments. This class is implemented as a singleton to ensure that\n * only one instance of the GameViews class ever exists.\n */\npublic class GameViews {\n\n    // Tags used to save/restore Fragments.\n    public static final String START_MENU_TAG =\n            \"com.google.fpl.gim.examplegame.fragment.StartMenuFragment\";\n    public static final String LIST_OF_MISSIONS_TAG =\n            \"com.google.fpl.gim.examplegame.ListOfMissionsFragment\";\n    public static final String RUN_SPECIFICATIONS_TAG =\n            \"com.google.fpl.gim.examplegame.RunSpecificationsFragment\";\n    public static final String MUSIC_SELECTION_TAG =\n            \"com.google.fpl.gim.examplegame.fragment.MusicSelectionFragment\";\n    public static final String END_SUMMARY_TAG =\n            \"com.google.fpl.gim.examplegame.fragment.EndSummaryFragment\";\n    public static final String FITNESS_DATA_DISPLAY_TAG =\n            \"com.google.fpl.gim.examplegame.fragment.FitnessDataDisplayFragment\";\n\n    // UI Fragments.\n    private StartMenuFragment mStartMenuFragment;\n    private MissionSelectionFragment mMissionSelectionFragment;\n    private RunSpecificationSelectionFragment mRunSpecificationsFragment;\n    private MusicSelectionFragment mMusicSelectionFragment;\n    private EndSummaryFragment mEndSummaryFragment;\n    private FitnessDataDisplayFragment mFitnessDataDisplayFragment;\n\n    public GameViews() {\n    }\n\n    /**\n     * Called the first time upon starting the game by the 'initializeFragments' method in the Game\n     * class. Creates fragments and attaches them to the Activity.\n     */\n    public void initializeFragments(Activity activity) {\n        mStartMenuFragment = new StartMenuFragment();\n        activity.getFragmentManager().beginTransaction()\n                .add(R.id.container, mStartMenuFragment, START_MENU_TAG)\n                .addToBackStack(START_MENU_TAG)\n                .commit();\n        mStartMenuFragment.setRetainInstance(true);\n\n        mMissionSelectionFragment = new MissionSelectionFragment();\n        mMissionSelectionFragment.setRetainInstance(true);\n\n        mRunSpecificationsFragment = new RunSpecificationSelectionFragment();\n        mRunSpecificationsFragment.setRetainInstance(true);\n\n        mMusicSelectionFragment = new MusicSelectionFragment();\n        mMusicSelectionFragment.setRetainInstance(true);\n\n        mEndSummaryFragment = new EndSummaryFragment();\n        mEndSummaryFragment.setRetainInstance(true);\n\n        mFitnessDataDisplayFragment = new FitnessDataDisplayFragment();\n        mFitnessDataDisplayFragment.setRetainInstance(true);\n    }\n\n    /**\n     * Restores information and fragments from the Bundle upon lifecycle restart. Called\n     * by the 'restoreFragments' method in the Game class.\n     */\n    public void restoreFragments(Activity activity) {\n        StartMenuFragment foundStartMenuFragment = (StartMenuFragment) activity.getFragmentManager()\n                .findFragmentByTag(START_MENU_TAG);\n        if (foundStartMenuFragment != null) {\n            mStartMenuFragment = foundStartMenuFragment;\n        } else {\n            mStartMenuFragment = new StartMenuFragment();\n        }\n\n        MissionSelectionFragment foundMissionSelectionFragment =\n                (MissionSelectionFragment) activity.getFragmentManager()\n                .findFragmentByTag(LIST_OF_MISSIONS_TAG);\n        if (foundMissionSelectionFragment != null) {\n            mMissionSelectionFragment = foundMissionSelectionFragment;\n        } else {\n            mMissionSelectionFragment = new MissionSelectionFragment();\n        }\n\n        RunSpecificationSelectionFragment foundRunSpecificationSelectionFragment =\n                (RunSpecificationSelectionFragment) activity.getFragmentManager()\n                .findFragmentByTag(RUN_SPECIFICATIONS_TAG);\n        if (foundRunSpecificationSelectionFragment != null) {\n            mRunSpecificationsFragment = foundRunSpecificationSelectionFragment;\n        } else {\n            mRunSpecificationsFragment = new RunSpecificationSelectionFragment();\n        }\n\n        MusicSelectionFragment foundMusicSelectionFragment =\n                (MusicSelectionFragment) activity.getFragmentManager()\n                .findFragmentByTag(MUSIC_SELECTION_TAG);\n        if (foundMissionSelectionFragment != null) {\n            mMusicSelectionFragment = foundMusicSelectionFragment;\n        } else {\n            mMusicSelectionFragment = new MusicSelectionFragment();\n        }\n\n        EndSummaryFragment foundEndSummaryFragment =\n                (EndSummaryFragment) activity.getFragmentManager()\n                        .findFragmentByTag(END_SUMMARY_TAG);\n        if (foundEndSummaryFragment != null) {\n            mEndSummaryFragment = foundEndSummaryFragment;\n        } else {\n            mEndSummaryFragment = new EndSummaryFragment();\n        }\n\n        FitnessDataDisplayFragment foundFitnessDataDisplayFragment =\n                (FitnessDataDisplayFragment) activity.getFragmentManager()\n                        .findFragmentByTag(FITNESS_DATA_DISPLAY_TAG);\n        if (foundFitnessDataDisplayFragment != null) {\n            mFitnessDataDisplayFragment = foundFitnessDataDisplayFragment;\n        } else {\n            mFitnessDataDisplayFragment = new FitnessDataDisplayFragment();\n        }\n    }\n\n    public StartMenuFragment getStartMenuFragment() {\n        return this.mStartMenuFragment;\n    }\n\n    public MissionSelectionFragment getListOfMissionsFragment() {\n        return mMissionSelectionFragment;\n    }\n\n    public RunSpecificationSelectionFragment getRunSpecificationsFragment() {\n        return mRunSpecificationsFragment;\n    }\n\n    public MusicSelectionFragment getMusicSelectionFragment() {\n        return mMusicSelectionFragment;\n    }\n\n    public EndSummaryFragment getEndSummaryFragment() {\n        return mEndSummaryFragment;\n    }\n\n    public FitnessDataDisplayFragment getFitnessDataDisplayFragment() {\n        return mFitnessDataDisplayFragment;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/gui/MissionSelectionFragment.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.gui;\n\nimport android.app.Fragment;\nimport android.app.ListFragment;\nimport android.content.res.AssetManager;\nimport android.os.Bundle;\nimport android.support.annotation.NonNull;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ArrayAdapter;\nimport android.widget.ListView;\n\nimport com.google.fpl.gim.examplegame.MainActivity;\nimport com.google.fpl.gim.examplegame.utils.MissionParseException;\nimport com.google.fpl.gim.examplegame.utils.MissionParser;\nimport com.google.fpl.gim.examplegame.R;\nimport com.google.fpl.gim.examplegame.utils.Utils;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.ArrayList;\n\n/**\n * A UI fragment that represents the game's mission selection screen. No data is stored in this\n * fragment.\n */\npublic class MissionSelectionFragment extends ListFragment {\n\n    private static final String TAG = MissionSelectionFragment.class.getSimpleName();\n\n    private ArrayList<String> mAssetNames = new ArrayList<>();\n    private ArrayList<String> mMissionNames = new ArrayList<>();\n\n    private String mSelectedMissionName;\n    private String mSelectedAssetPath;\n\n    private static final String MISSION_ASSET_FOLDER_NAME = \"missions\";\n\n    @Override\n    public void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        if (mMissionNames.size() == 0) {\n            // Needs access to a Context in order to access the assets folder.\n            AssetManager assetManager = getActivity().getAssets();\n            String[] missionFileNames = new String[0];\n            try {\n                // Obtain the files in assets/missions.\n                missionFileNames = assetManager.list(MISSION_ASSET_FOLDER_NAME);\n            } catch (IOException e) {\n                e.printStackTrace();\n            }\n\n            // Open the missions to obtain plain text names.\n            for (String missionFileName : missionFileNames) {\n                // Open a stream for the mission.\n                InputStream stream;\n                try {\n                    // All missions should be in the assets/missions folder.\n                    ArrayList<String> subDirectories = new ArrayList<>();\n                    subDirectories.add(missionFileName);\n                    stream = assetManager\n                            .open(Utils.makeFilePath(MISSION_ASSET_FOLDER_NAME, subDirectories));\n                } catch (IOException e) {\n                    e.printStackTrace();\n                    continue;\n                }\n\n                // Find the mission name.\n                String missionName;\n                try {\n                    missionName = MissionParser.getMissionName(stream);\n                } catch (MissionParseException e) {\n                    e.printStackTrace();\n                    missionName = \"Description failed.\";\n                }\n\n                // Close the stream.\n                try {\n                    stream.close();\n                } catch (IOException e) {\n                    e.printStackTrace();\n                }\n\n                mMissionNames.add(missionName);\n                mAssetNames.add(missionFileName);\n            }\n        }\n        setListAdapter(new ArrayAdapter<>(getActivity(), R.layout.menu_list_item,\n                R.id.list_item_text, mMissionNames));\n    }\n\n    @Override\n    public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n                             Bundle savedInstanceState) {\n        return inflater.inflate(R.layout.menu_mission_list, container, false);\n    }\n\n    @Override\n    public void onViewCreated(View view, Bundle savedInstanceState) {\n        super.onViewCreated(view, savedInstanceState);\n        getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);\n    }\n\n    @Override\n    public void onListItemClick(ListView l, View v, int position, long id) {\n        onMissionSelected(position);\n    }\n\n    @Override public void onResume() {\n        super.onResume();\n        ((MainActivity)getActivity()).setActionBarTitle(R.string.select_mission_title);\n    }\n\n    public void onMissionSelected(int position) {\n        Utils.logDebug(TAG, \"onMissionSelected - Mission #\" + (position + 1) +\n                \" has been selected!\");\n\n        mSelectedMissionName = mMissionNames.get(position);\n\n        ArrayList<String> subDirectories = new ArrayList<>();\n        subDirectories.add(mAssetNames.get(position));\n        mSelectedAssetPath = Utils.makeFilePath(MISSION_ASSET_FOLDER_NAME, subDirectories);\n\n        // Display RunSpecificationSelectionFragment.\n        Fragment runSpecificationsFragment =\n                ((MainActivity) getActivity()).getGameViews().getRunSpecificationsFragment();\n        getActivity().getFragmentManager().beginTransaction()\n                .setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_left)\n                .remove(this)\n                .add(R.id.container, runSpecificationsFragment, GameViews.RUN_SPECIFICATIONS_TAG)\n                .addToBackStack(null)\n                .commit();\n    }\n\n    public String getSelectedMissionName() {\n        return mSelectedMissionName;\n    }\n\n    public String getSelectedAssetPath() {\n        return mSelectedAssetPath;\n    }\n}"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/gui/MusicSelectionFragment.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.gui;\n\nimport android.app.Fragment;\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.Button;\n\nimport com.google.fpl.gim.examplegame.MainActivity;\nimport com.google.fpl.gim.examplegame.R;\n\n/**\n * A fragment notifying the user to go select music to listen to during their run.\n */\npublic class MusicSelectionFragment extends Fragment {\n    private static final String TAG = MusicSelectionFragment.class.getSimpleName();\n\n    private Button mReadyButton;\n\n    @Override\n    public View onCreateView(LayoutInflater inflater, ViewGroup container,\n                             Bundle savedInstanceState) {\n        View rootView = inflater.inflate(R.layout.menu_music_selection, container, false);\n        mReadyButton = (Button) rootView.findViewById(R.id.start_mission_button);\n        mReadyButton.setEnabled(true);\n        mReadyButton.setText(R.string.start_mission_button);\n        return rootView;\n    }\n\n    @Override public void onResume() {\n        super.onResume();\n        ((MainActivity)getActivity()).setActionBarTitle(R.string.select_music_title);\n    }\n\n    public void disableReadyButton() {\n        mReadyButton.setEnabled(false);\n        mReadyButton.setText(R.string.start_mission_pressed);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/gui/NotificationOptions.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.gui;\n\nimport android.support.v4.app.NotificationCompat;\n\nimport com.google.fpl.gim.examplegame.R;\n\n/**\n * Options to build a notification from. Subset of all options that an Android notification may\n * have.\n */\npublic class NotificationOptions {\n    private int mNotificationId;\n    private int mSmallIconResourceId;\n    private String mTitle;\n    private String mContent;\n    private NotificationCompat.Action[] mActions = null;\n    private int mNotificationDefaults;\n    private int mNotificationPriority;\n    private long[] mVibratePattern;\n\n    private static final int DEFAULT_ID = 1234;\n    private static final int DEFAULT_SMALL_ICON_RESOURCE_ID = R.drawable.ic_notification;\n    private static final String DEFAULT_TITLE = \"Enemy!\";\n    private static final String DEFAULT_CONTENT = \"An enemy appeared, what will you do?\";\n    // Phone notification settings for vibration, sound, and lights.\n    private static final int APP_NOTIFICATION_DEFAULTS = NotificationCompat.DEFAULT_ALL;\n    // Maximum priority, so it will be the first notification on the wearable device.\n    private static final int DEFAULT_PRIORITY = NotificationCompat.PRIORITY_DEFAULT;\n\n    /**\n     * Default constructor.\n     */\n    public NotificationOptions() {\n    }\n\n    /**\n     * Constructor to set all build options at creation.\n     */\n    public NotificationOptions(int notificationId, int smallIconResourceId, String title,\n                               String content, NotificationCompat.Action[] actions,\n                               int notificationDefaults, int notificationPriority,\n                               long[] vibratePattern) {\n        this.mNotificationId = notificationId;\n        this.mSmallIconResourceId = smallIconResourceId;\n        this.mTitle = title;\n        this.mContent = content;\n        this.mActions = actions;\n        this.mNotificationDefaults = notificationDefaults;\n        this.mNotificationPriority = notificationPriority;\n        this.mVibratePattern = vibratePattern;\n    }\n\n    /**\n     * Statically create default build options.\n     *\n     * @return Default build options for a notification.\n     */\n    public static NotificationOptions getDefaultNotificationOptions() {\n        NotificationOptions options = new NotificationOptions();\n        options.mNotificationId = DEFAULT_ID;\n        options.mSmallIconResourceId = DEFAULT_SMALL_ICON_RESOURCE_ID;\n        options.mTitle = DEFAULT_TITLE;\n        options.mContent = DEFAULT_CONTENT;\n        options.mNotificationDefaults = APP_NOTIFICATION_DEFAULTS;\n        options.mNotificationPriority = DEFAULT_PRIORITY;\n        return options;\n    }\n\n    /**\n     * Small icon, title, and text must be set for all notifications.\n     *\n     * @param smallIconResourceId The resource Id of a picture to use as the small icon.\n     * @param title     A string to use as the notification title.\n     * @param content   A string to use as the notification content.\n     */\n    public void setRequiredOptions(int smallIconResourceId, String title,\n                                   String content) {\n        this.mSmallIconResourceId = smallIconResourceId;\n        this.mTitle = title;\n        this.mContent = content;\n    }\n\n    /**\n     * Set actions for this notification.\n     *\n     * @param actions Actions associated with the notification.\n     */\n    public void setActions(NotificationCompat.Action[] actions) {\n        this.mActions = actions;\n    }\n\n    /**\n     * Notification defaults are ringtones, vibration patterns, and LED colors for the notification.\n     *\n     * @param notificationDefaults Defaults to use for this notification.\n     */\n    public void setNotificationDefaults(int notificationDefaults) {\n        this.mNotificationDefaults = notificationDefaults;\n    }\n\n    /**\n     * Priority determines the notification's position in the notification list.\\\n     * @param notificationPriority Priority to use for this notification.\n     */\n    public void setNotificationPriority(int notificationPriority) {\n        this.mNotificationPriority = notificationPriority;\n    }\n\n    public void setNotificationId(int id) {\n        this.mNotificationId = id;\n    }\n\n    public void setPriorityAsDefault() {\n        mNotificationPriority = NotificationCompat.PRIORITY_DEFAULT;\n    }\n\n    public void setPriorityAsHigh() {\n        mNotificationPriority = NotificationCompat.PRIORITY_HIGH;\n    }\n\n    public void setPriorityAsMax() {\n        mNotificationPriority = NotificationCompat.PRIORITY_MAX;\n    }\n\n    public void setContent(String content) {\n        this.mContent = content;\n    }\n\n    public void setTitle(String title) {\n        this.mTitle = title;\n    }\n\n    public void setVibratePattern(long[] vibratePattern) { this.mVibratePattern = vibratePattern; }\n\n    public int getNotificationPriority() {\n        return mNotificationPriority;\n    }\n\n    public int getNotificationId() {\n        return mNotificationId;\n    }\n\n    public int getSmallIconResourceId() {\n        return mSmallIconResourceId;\n    }\n\n    public String getTitle() {\n        return mTitle;\n    }\n\n    public String getContent() {\n        return mContent;\n    }\n\n    public NotificationCompat.Action[] getActions() {\n        return mActions;\n    }\n\n    public int getNotificationDefaults() {\n        return mNotificationDefaults;\n    }\n\n    public long[] getVibratePattern() { return mVibratePattern; }\n}"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/gui/RunSpecificationSelectionFragment.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.gui;\n\nimport android.app.Fragment;\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.SeekBar;\nimport android.widget.TextView;\n\nimport com.google.fpl.gim.examplegame.MainActivity;\nimport com.google.fpl.gim.examplegame.R;\n\n/**\n * A UI Fragment that represents the game's run specification selection screen.\n */\npublic class RunSpecificationSelectionFragment extends Fragment {\n\n    private static final String TAG = RunSpecificationSelectionFragment.class.getSimpleName();\n\n    // The minimum allowed challenge pace.\n    private static final float CHALLENGE_PACE_MIN_MINUTES_PER_MILE = 8f;\n    // The maximum allowed challenge pace.\n    private static final float CHALLENGE_PACE_MAX_MINUTES_PER_MILE = 30f;\n    // The range of the challenge pace.\n    private static final float CHALLENGE_PACE_RANGE_MINUTES_PER_MILE =\n            CHALLENGE_PACE_MAX_MINUTES_PER_MILE - CHALLENGE_PACE_MIN_MINUTES_PER_MILE;\n    // The default challenge pace.\n    private static final float CHALLENGE_PACE_DEFAULT_MINUTES_PER_MILE = 20f;\n\n    private static final int CHALLENGE_PACE_INCREMENTS_PER_MINUTE = 4;\n\n    // The maximum value of the challenge pace seek bar.\n    private static final int CHALLENGE_PACE_SEEK_BAR_MAX = (int)\n            CHALLENGE_PACE_RANGE_MINUTES_PER_MILE * CHALLENGE_PACE_INCREMENTS_PER_MINUTE;\n\n    // The default value for the progress bar.(int)(\n    private static final int CHALLENGE_PACE_PROGRESS_BAR_DEFAULT = (int) (\n            (1.0f -\n            (CHALLENGE_PACE_DEFAULT_MINUTES_PER_MILE - CHALLENGE_PACE_MIN_MINUTES_PER_MILE)\n            / CHALLENGE_PACE_RANGE_MINUTES_PER_MILE) * CHALLENGE_PACE_SEEK_BAR_MAX);\n\n    private static final float MISSION_LENGTH_MINUTES = 30.0f;\n    private static final float INTERVAL_LENGTH_MINUTES = 1.5f;\n\n    // SeekBar for selecting a challenge pace.\n    SeekBar mChallengePaceSeekBar;\n    // Text display of the current selected challenge pace.\n    TextView mChallengePaceText;\n\n    private float mSelectedMissionLengthMinutes;\n    private float mSelectedIntervalLengthMinutes;\n    private float mSelectedChallengePaceMinutesPerMile;\n\n    @Override\n    public View onCreateView(LayoutInflater inflater, ViewGroup container,\n                             Bundle savedInstanceState) {\n        View rootView = inflater.inflate(R.layout.menu_run_specifications, container, false);\n\n        mChallengePaceSeekBar = (SeekBar) rootView.findViewById(R.id.challenge_speed_field);\n        mChallengePaceSeekBar.setMax(CHALLENGE_PACE_SEEK_BAR_MAX);\n        mChallengePaceSeekBar.setProgress(CHALLENGE_PACE_PROGRESS_BAR_DEFAULT);\n        mChallengePaceSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n            @Override\n            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n                updateChallengePaceText(progress);\n            }\n\n            @Override\n            public void onStartTrackingTouch(SeekBar seekBar) {\n            }\n\n            @Override\n            public void onStopTrackingTouch(SeekBar seekBar) {\n            }\n        });\n\n        mChallengePaceText = (TextView) rootView.findViewById(R.id.challenge_speed_text);\n        updateChallengePaceText(CHALLENGE_PACE_PROGRESS_BAR_DEFAULT);\n\n        return rootView;\n    }\n\n    @Override public void onResume() {\n        super.onResume();\n        ((MainActivity)getActivity()).setActionBarTitle(R.string.run_specification_title);\n    }\n\n    public void onEnterPressed() {\n        // Currently does not query the user for a run length. Assume each mission is 30 minutes.\n        mSelectedMissionLengthMinutes = MISSION_LENGTH_MINUTES;\n        // Currently does not query the user for an interval length. Assume each interval is 1.5\n        // minutes.\n        mSelectedIntervalLengthMinutes = INTERVAL_LENGTH_MINUTES;\n        mSelectedChallengePaceMinutesPerMile =\n                calculateChallengePaceFromProgress(mChallengePaceSeekBar.getProgress());\n\n        // Display MusicSelectionFragment.\n        Fragment musicSelectionFragment =\n                ((MainActivity) getActivity()).getGameViews().getMusicSelectionFragment();\n        getActivity().getFragmentManager().beginTransaction()\n                .setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_left)\n                .remove(this)\n                .add(R.id.container, musicSelectionFragment, GameViews.MUSIC_SELECTION_TAG)\n                .addToBackStack(null)\n                .commit();\n    }\n\n\n    /**\n     * Displays the currently selected Challenge Pace based on SeekBar progress.\n     * @param progress Int representing progress from 0 to CHALLENGE_PACE_SEEK_BAR_MAX.\n     */\n    private void updateChallengePaceText(int progress) {\n        float minutesPerMile = calculateChallengePaceFromProgress(progress);\n        String formattedText = String.format(getActivity()\n                .getString(R.string.challenge_speed_display), minutesPerMile);\n        mChallengePaceText.setText(formattedText);\n    }\n\n    /**\n     * Calculates Challenge Pace based on SeekBar progress.\n     * @param progress Int representing progress from 0 to CHALLENGE_PACE_SEEK_BAR_MAX.\n     * @return A challenge pace in minutes per mile.\n     */\n    private float calculateChallengePaceFromProgress(int progress) {\n        return CHALLENGE_PACE_MIN_MINUTES_PER_MILE\n                + ((1.0f - ((float) progress) / CHALLENGE_PACE_SEEK_BAR_MAX)\n                * CHALLENGE_PACE_RANGE_MINUTES_PER_MILE);\n    }\n\n    public float getSelectedMissionLengthMinutes() {\n        return mSelectedMissionLengthMinutes;\n    }\n\n    public float getSelectedIntervalLengthMinutes() {\n        return mSelectedIntervalLengthMinutes;\n    }\n\n    public float getSelectedChallengePaceMinutesPerMile() {\n        return mSelectedChallengePaceMinutesPerMile;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/gui/StartMenuFragment.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.gui;\n\nimport android.app.Fragment;\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.Button;\n\nimport com.google.fpl.gim.examplegame.MainActivity;\nimport com.google.fpl.gim.examplegame.R;\nimport com.google.fpl.gim.examplegame.utils.Utils;\n\n/**\n * A UI fragment that represents the game's start screen.  No data is stored in this fragment.\n */\npublic class StartMenuFragment extends Fragment {\n    private static final String TAG = StartMenuFragment.class.getSimpleName();\n\n    private Button mStartButton;\n    private boolean isGoogleFitConnected;\n\n    @Override\n    public View onCreateView(LayoutInflater inflater, ViewGroup container,\n                             Bundle savedInstanceState) {\n        View rootView = inflater.inflate(R.layout.menu_start, container, false);\n        mStartButton = (Button) rootView.findViewById(R.id.start_button);\n        updateStartButton();\n        return rootView;\n    }\n\n    @Override public void onResume() {\n        super.onResume();\n        ((MainActivity)getActivity()).setActionBarTitle(R.string.app_name);\n    }\n\n    public void onStartButtonPressed() {\n        Utils.logDebug(TAG, \"onStartButtonPressed\");\n\n        // Display MissionSelectionFragment\n        MissionSelectionFragment missionSelectionFragment =\n                ((MainActivity) getActivity()).getGameViews().getListOfMissionsFragment();\n        getActivity().getFragmentManager().beginTransaction()\n                .setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_left)\n                .remove(this)\n                .add(R.id.container, missionSelectionFragment, GameViews.LIST_OF_MISSIONS_TAG)\n                .addToBackStack(null)\n                .commit();\n    }\n\n    public void onFitStatusUpdated(boolean connected) {\n        isGoogleFitConnected = connected;\n        updateStartButton();\n    }\n\n    private void updateStartButton() {\n        if (isGoogleFitConnected) {\n            mStartButton.setEnabled(true);\n            mStartButton.setText(R.string.start_button_ready);\n        } else {\n            mStartButton.setEnabled(false);\n            mStartButton.setText(R.string.start_button_not_connected);\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/utils/MissionParseException.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.utils;\n\n/**\n * An exception for problems during the parsing of a mission.\n */\npublic class MissionParseException extends Exception {\n    private static final String MOMENT_TYPE_EXCEPTION = \"Mission could not be parsed.\";\n\n    public MissionParseException() {\n        super(MOMENT_TYPE_EXCEPTION);\n    }\n\n    public MissionParseException(String s) {\n        super(s);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/utils/MissionParser.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.utils;\n\nimport android.net.Uri;\n\nimport com.google.fpl.gim.examplegame.Choice;\nimport com.google.fpl.gim.examplegame.ChoiceMoment;\nimport com.google.fpl.gim.examplegame.ChoiceMomentData;\nimport com.google.fpl.gim.examplegame.Mission;\nimport com.google.fpl.gim.examplegame.Moment;\nimport com.google.fpl.gim.examplegame.Outcome;\nimport com.google.fpl.gim.examplegame.SfxMoment;\nimport com.google.fpl.gim.examplegame.SfxMomentData;\nimport com.google.fpl.gim.examplegame.SpokenTextMoment;\nimport com.google.fpl.gim.examplegame.SpokenTextMomentData;\nimport com.google.fpl.gim.examplegame.TimerMoment;\nimport com.google.fpl.gim.examplegame.TimerMomentData;\n\nimport org.w3c.dom.Document;\nimport org.w3c.dom.Element;\nimport org.w3c.dom.Node;\nimport org.w3c.dom.NodeList;\nimport org.xml.sax.SAXException;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.ArrayList;\n\nimport javax.xml.parsers.DocumentBuilder;\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport javax.xml.parsers.ParserConfigurationException;\n\n/**\n * A class for parsing a mission in a file.\n */\npublic class MissionParser {\n    private static final String TAG = MissionParser.class.getSimpleName();\n\n    private static final String ELEMENT_MISSION = \"mission\";\n    private static final String MISSION_ATTRIBUTE_START_ID = \"start_id\";\n    private static final String MISSION_ATTRIBUTE_NAME = \"name\";\n\n    private static final String ELEMENT_MOMENT = \"moment\";\n\n    // Types of moments.\n    private static final String MOMENT_TYPE_TIMER = \"timer\";\n    private static final String MOMENT_TYPE_SFX = \"sfx\";\n    private static final String MOMENT_TYPE_SPOKEN_TEXT = \"spoken_text\";\n    private static final String MOMENT_TYPE_CHOICE = \"choice\";\n\n    // Attributes for all moments.\n    private static final String MOMENT_ATTRIBUTE_TYPE = \"type\";\n    private static final String MOMENT_ATTRIBUTE_ID = \"id\";\n\n    // Attributes for specific types of moments.\n    private static final String ELEMENT_CHOICE = \"choice\";\n    private static final String ELEMENT_DESCRIPTION = \"description\";\n    private static final String ELEMENT_NEXT_MOMENT = \"next_moment\";\n    private static final String NEXT_MOMENT_ATTRIBUTE_ID = \"id\";\n    private static final String ELEMENT_LENGTH_MINUTES = \"length_minutes\";\n    private static final String ELEMENT_TIMEOUT_LENGTH_MINUTES = \"timeout_length_minutes\";\n    private static final String ELEMENT_DEFAULT_CHOICE = \"default_choice\";\n    private static final String ELEMENT_URI = \"uri\";\n    private static final String DEFAULT_CHOICE_ATTRIBUTE_ID  = \"id\";\n    private static final String ELEMENT_OUTCOME = \"outcome\";\n    private static final String CHOICE_ATTRIBUTE_ID = \"id\";\n    private static final String ELEMENT_TEXT_TO_SPEAK = \"text_to_speak\";\n    private static final String ELEMENT_FICTIONAL_PROGRESS = \"fictional_progress\";\n    private static final String ELEMENT_ICON = \"icon\";\n    private static final String ICON_ATTRIBUTE_NAME = \"name\";\n\n    // Attributes for outcomes.\n    private static final String OUTCOME_ATTRIBUTE_DEPLETE_WEAPON = \"deplete_weapon\";\n    private static final String OUTCOME_ATTRIBUTE_INCREMENT_ENEMIES = \"increment_enemies\";\n\n    // ID that signifies the moment whose next is this is an ending moment.\n    private static final String DEFAULT_END_ID = null;\n\n    // ID that signifies that this Choice should only be displayed when the user's weapon is\n    // charged.\n    public static final String FIRE_WEAPON_CHOICE_ID = \"fire\";\n\n    /**\n     * Adds the Moments that define a Mission to that Mission by reading from input. Assumes\n     * XML file.\n     * @param missionStream The InputStream to read from.\n     * @param mission The Mission object to add Moments to.\n     * @throws MissionParseException\n     */\n    public static void parseMission(InputStream missionStream, Mission mission) throws\n            MissionParseException {\n\n        Document doc = getDocumentFromInputStream(missionStream);\n\n        doc.getDocumentElement().normalize();\n\n        // Find the Mission's starting Moment.\n        NodeList missionNodes = doc.getElementsByTagName(ELEMENT_MISSION);\n        String startId = null;\n        for (int i = 0; i < missionNodes.getLength(); i++) {\n            Node missionNode = missionNodes.item(i);\n            if (isElementNode(missionNode)) {\n                startId = ((Element) missionNode).getAttribute(MISSION_ATTRIBUTE_START_ID);\n                Utils.logDebug(TAG, \"Start id is \\\"\" + startId + \"\\\".\");\n                break;\n            }\n        }\n\n        mission.setFirstMomentId(startId);\n\n        // Each Moment is represented as an Element\n        NodeList momentsList = doc.getElementsByTagName(ELEMENT_MOMENT);\n\n        for (int i = 0; i < momentsList.getLength(); i++) {\n            Node momentNode = momentsList.item(i);\n            // We check to make sure that we have Elements, though getElementsByTagName should\n            // provide only Elements.\n            if (isElementNode(momentNode)) {\n                Moment moment;\n                Element momentElement = (Element) momentNode;\n                // Data for all Moments\n                String id = momentElement.getAttribute(MOMENT_ATTRIBUTE_ID);\n                String momentType = momentElement.getAttribute(MOMENT_ATTRIBUTE_TYPE);\n\n                // Ideally would use Java 7 to switch on the strings themselves, but\n                // project is not configured to use Java 7.\n                if (momentType.equals(MOMENT_TYPE_CHOICE)) {\n                    Utils.logDebug(TAG, \"Choice moment created.\");\n                    ChoiceMomentData momentData = parseChoiceMomentElement(id, momentElement);\n                    moment = new ChoiceMoment(mission, momentData);\n                } else if (momentType.equals(MOMENT_TYPE_SFX)) {\n                    Utils.logDebug(TAG, \"Sfx moment created.\");\n                    SfxMomentData momentData = parseSfxMoment(id, momentElement);\n                    moment = new SfxMoment(mission, momentData);\n                } else if (momentType.equals(MOMENT_TYPE_TIMER)) {\n                    Utils.logDebug(TAG, \"Timer moment created.\");\n                    TimerMomentData momentData = parseTimerMoment(id, momentElement);\n                    moment = new TimerMoment(mission, momentData);\n                } else if (momentType.equals(MOMENT_TYPE_SPOKEN_TEXT)) {\n                    Utils.logDebug(TAG, \"Spoken text moment created.\");\n                    SpokenTextMomentData momentData = parseSpokenTextMoment(id, momentElement);\n                    moment = new SpokenTextMoment(mission, momentData);\n                } else {\n                    throw new MissionParseException(\"Moment type invalid.\");\n                }\n\n                mission.addMoment(id, moment);\n            }\n        }\n    }\n\n    /**\n     * Everything in an XML document is represented as a Document Object Model Node. Elements are\n     * defined between opening and closing tags, for example \"<element></element>\".\n     * @param node a DOM Node from a Document\n     * @return true if the DOM Node is an Element.\n     */\n    private static boolean isElementNode(Node node) {\n        return node.getNodeType() == Node.ELEMENT_NODE;\n    }\n\n    /**\n     * Parses an Element representing an SfxMoment to create SfxMomentData.\n     * @param momentId Already parsed data about the Moment.\n     * @param momentElement the DOM Element to be parsed.\n     * @return data to construct an SfxMoment\n     */\n    private static SfxMomentData parseSfxMoment(String momentId, Element momentElement)\n            throws MissionParseException {\n        Uri uri = parseUriElement(findSingleChildElementByTag(momentElement, ELEMENT_URI));\n        String nextMomentId = getNextMomentId(momentElement);\n\n        ArrayList<String> fictionalProgress = parseMomentFictionalProgress(momentElement);\n\n        return new SfxMomentData(momentId, nextMomentId, fictionalProgress, uri);\n    }\n\n    /**\n     * Parses an Element representing a TimerMoment to create TimerMomentData.\n     * @param momentId Already parsed data about the Moment.\n     * @param momentElement the DOM Element to be parsed.\n     * @return data to construct a TimerMoment\n     */\n    private static TimerMomentData parseTimerMoment(String momentId, Element momentElement)\n            throws MissionParseException {\n        float momentLengthMinutes = parseLengthMinutesElement(\n                findSingleChildElementByTag(momentElement, ELEMENT_LENGTH_MINUTES));\n\n        String nextMomentId = getNextMomentId(momentElement);\n\n        ArrayList<String> fictionalProgress = parseMomentFictionalProgress(momentElement);\n\n        return new TimerMomentData(momentId, nextMomentId, fictionalProgress, momentLengthMinutes);\n    }\n\n    /**\n     * Parses an Element representing a SpokenTextMoment to create SpokenTextMomentData.\n     * @param momentId Already parsed data about the Moment.\n     * @param momentElement the DOM Element to be parsed.\n     * @return data to construct an SpokenTextMoment\n     */\n    private static SpokenTextMomentData parseSpokenTextMoment(String momentId,\n            Element momentElement) throws MissionParseException {\n        String textToSpeak = parseTextToSpeakElement(\n                findSingleChildElementByTag(momentElement, ELEMENT_TEXT_TO_SPEAK));\n\n        String nextMomentId = getNextMomentId(momentElement);\n\n        ArrayList<String> fictionalProgress = parseMomentFictionalProgress(momentElement);\n\n        return new SpokenTextMomentData(momentId, nextMomentId, fictionalProgress, textToSpeak);\n    }\n\n    /**\n     * Parses an Element representing a ChoiceMoment to create ChoiceMomentData.\n     * @param momentId Already parsed data about the Moment.\n     * @param momentElement the DOM Element to be parsed.\n     * @return data to construct an ChoiceMoment\n     */\n    private static ChoiceMomentData parseChoiceMomentElement(String momentId,\n            Element momentElement) throws MissionParseException {\n        String description = getDescription(momentElement);\n\n        float timeoutLengthMinutes = parseTimeoutLengthMinutesElement(\n                findSingleChildElementByTag(momentElement, ELEMENT_TIMEOUT_LENGTH_MINUTES));\n\n        String defaultChoiceId = parseDefaultChoiceElement(\n                findSingleChildElementByTag(momentElement, ELEMENT_DEFAULT_CHOICE));\n\n        ArrayList<String> fictionalProgress = parseMomentFictionalProgress(momentElement);\n\n        ChoiceMomentData data = new ChoiceMomentData(momentId, fictionalProgress, description,\n                defaultChoiceId, timeoutLengthMinutes);\n\n        NodeList choiceNodes = momentElement.getElementsByTagName(ELEMENT_CHOICE);\n        if (choiceNodes.getLength() > ChoiceMoment.MAXIMUM_NUM_OF_CHOICES) {\n            throw new MissionParseException(\"ChoiceMoments can have no more than \"\n                    + ChoiceMoment.MAXIMUM_NUM_OF_CHOICES + \" Choices.\");\n        }\n        if (choiceNodes.getLength() < ChoiceMoment.MINIMUM_NUM_OF_CHOICES) {\n            throw new MissionParseException(\"ChoiceMoments can have no fewer than \"\n                    + ChoiceMoment.MINIMUM_NUM_OF_CHOICES + \" Choices.\");\n        }\n        boolean defaultChoiceIsExistingChoice = false;\n        for (int i = 0; i < choiceNodes.getLength(); i++) {\n            Node choiceNode = choiceNodes.item(i);\n            if (isElementNode(choiceNode)) {\n                Choice choice = parseChoiceElement((Element) choiceNode);\n                if (choice.getChoiceId() == defaultChoiceId ||\n                        choice.getChoiceId().equals(defaultChoiceId)) {\n                    defaultChoiceIsExistingChoice = true;\n                }\n                data.addChoice(choice);\n            }\n        }\n        if (!defaultChoiceIsExistingChoice) {\n            throw new MissionParseException(\"Default choice ID is not a valid Choice.\");\n        }\n\n        return data;\n    }\n\n    /**\n     * Creates a Choice from a DOM Element representing a Choice.\n     * @param choiceElement The DOM element representing a Choice.\n     * @return a Choice as defined in the DOM Element.\n     */\n    private static Choice parseChoiceElement(Element choiceElement) throws MissionParseException {\n        String id = choiceElement.getAttribute(CHOICE_ATTRIBUTE_ID);\n\n        String description = getDescription(choiceElement);\n\n        String nextMomentId = getNextMomentId(choiceElement);\n\n        Outcome outcome =\n                parseOutcomeElement(findSingleChildElementByTag(choiceElement, ELEMENT_OUTCOME));\n\n        boolean requiresChargedWeapon = false;\n        if (id.equals(MissionParser.FIRE_WEAPON_CHOICE_ID)) {\n            requiresChargedWeapon = true;\n        }\n\n        ArrayList<String> fictionalProgress = parseNestedFictionalProgress(choiceElement);\n\n        String iconName =\n                parseIconElement(findSingleChildElementByTag(choiceElement, ELEMENT_ICON));\n        return new Choice(id, description, nextMomentId, outcome, requiresChargedWeapon,\n                fictionalProgress, iconName);\n    }\n\n    /**\n     * Creates an Outcome from a DOM Element representing an Outcome.\n     * @param outcomeElement The DOM element representing an Outcome.\n     * @return an Outcome as defined in the DOM Element.\n     */\n    private static Outcome parseOutcomeElement(Element outcomeElement) {\n        boolean depleteWeapon =\n                Boolean.valueOf(outcomeElement.getAttribute(OUTCOME_ATTRIBUTE_DEPLETE_WEAPON));\n        boolean incrementEnemies =\n                Boolean.valueOf(outcomeElement.getAttribute(OUTCOME_ATTRIBUTE_INCREMENT_ENEMIES));\n        return new Outcome(depleteWeapon, incrementEnemies);\n    }\n\n    /**\n     * Given an XML element that has a nested next_moment element, finds the next moment ID.\n     * @param element An XML element.\n     * @return The next moment ID for the element.\n     */\n    private static String getNextMomentId(Element element) throws MissionParseException {\n        Element nextMomentElement = findSingleChildElementByTag(element, ELEMENT_NEXT_MOMENT);\n        // If the element does not have a next moment, then set to the default end signifier.\n        if (nextMomentElement == null) {\n            return DEFAULT_END_ID;\n        }\n        return parseNextMomentElement(nextMomentElement);\n    }\n\n    /**\n     * Given an XML element that has a nested description element, finds the description.\n     * @param element An XML element.\n     * @return The description for the element.\n     */\n    private static String getDescription(Element element) throws MissionParseException {\n        return parseDescriptionElement(findSingleChildElementByTag(element, ELEMENT_DESCRIPTION));\n    }\n\n    /**\n     * Finds the first occurrence of a child Element of a given tag within a parent's tree.\n     * @param parent An Element with child Elements\n     * @param tag The Element to find\n     * @return The first occurrence of an Element of type tag within the parent's child tree.\n     */\n    private static Element findSingleChildElementByTag(Element parent, String tag)\n            throws MissionParseException {\n        Node node = null;\n        NodeList nodes = parent.getElementsByTagName(tag);\n        for (int i = 0; i < nodes.getLength(); i++) {\n            node = nodes.item(i);\n            if (isElementNode(node)) {\n                break;\n            }\n            node = null;\n        }\n        // All attributes are required except the 'next_moment' attribute.  The lack of a\n        // 'next_moment' attribute signifies that the moment is the last moment in the mission.\n        if (!tag.equals(ELEMENT_NEXT_MOMENT) && node == null) {\n            throw new MissionParseException(tag + \" could not be found.\");\n        }\n        return (Element) node;\n    }\n\n    private static String parseNextMomentElement(Element nextMomentElement) {\n        String nextMomentId = nextMomentElement.getAttribute(NEXT_MOMENT_ATTRIBUTE_ID);\n        if (nextMomentId == null || nextMomentId.equals(\"\")) {\n            return DEFAULT_END_ID;\n        }\n        return nextMomentId;\n    }\n\n    private static float parseLengthMinutesElement(Element lengthMinutesElement)\n            throws MissionParseException {\n        Node node = lengthMinutesElement.getFirstChild();\n        if (node == null) {\n            throw new MissionParseException(\"Length minutes element could not be found.\");\n        }\n        return Float.parseFloat(node.getTextContent());\n    }\n\n    private static Uri parseUriElement(Element uriElement) throws MissionParseException {\n        Node node = uriElement.getFirstChild();\n        if (node == null) {\n            throw new MissionParseException(\"URI element could not be found.\");\n        }\n        return Uri.parse(node.getTextContent());\n    }\n\n    private static String parseTextToSpeakElement(Element textToSpeakElement)\n            throws MissionParseException {\n        Node node = textToSpeakElement.getFirstChild();\n        if (node == null) {\n            throw new MissionParseException(\"Text to speak element could not be found.\");\n        }\n        return node.getTextContent();\n    }\n\n    private static String parseDescriptionElement(Element descriptionElement)\n            throws MissionParseException {\n        Node node = descriptionElement.getFirstChild();\n        if (node == null) {\n            throw new MissionParseException(\"Description element could not be found.\");\n        }\n        return descriptionElement.getTextContent();\n    }\n\n    private static float parseTimeoutLengthMinutesElement(Element timeoutLengthMinutesElement)\n            throws MissionParseException {\n        Node node = timeoutLengthMinutesElement.getFirstChild();\n        if (node == null) {\n            throw new MissionParseException(\"Timeout length minutes element could not be found.\");\n        }\n        return Float.parseFloat(timeoutLengthMinutesElement.getFirstChild().getTextContent());\n    }\n\n    private static String parseDefaultChoiceElement(Element defaultChoiceElement)\n            throws MissionParseException {\n        String defaultChoice = defaultChoiceElement.getAttribute(DEFAULT_CHOICE_ATTRIBUTE_ID);\n        if (defaultChoice == null) {\n            throw new MissionParseException(\"Default choice element could not be found.\");\n        }\n        if (defaultChoice.equals(FIRE_WEAPON_CHOICE_ID)) {\n            throw new MissionParseException(\"Default choice cannot be 'fire'.\");\n        }\n        return defaultChoice;\n    }\n\n    /**\n     * Determines the name of a mission.\n     * @param missionStream InputStream to read from.\n     * @return A string of the name of the mission. Empty string if a name is not specified.\n     * @throws MissionParseException\n     */\n    public static String getMissionName(InputStream missionStream) throws  MissionParseException {\n\n        Document doc = getDocumentFromInputStream(missionStream);\n        doc.getDocumentElement().normalize();\n\n        NodeList missionNodes = doc.getElementsByTagName(ELEMENT_MISSION);\n        String missionName;\n        for (int i = 0; i < missionNodes.getLength(); i++) {\n            Node missionNode = missionNodes.item(i);\n            if (isElementNode(missionNode)) {\n                // Gives an empty string if the attribute is missing.\n                missionName = ((Element) missionNode).getAttribute(MISSION_ATTRIBUTE_NAME);\n                if (missionName.equals(\"\")) {\n                    throw new MissionParseException(\"Mission name missing.\");\n                }\n                Utils.logDebug(TAG, \"Mission name is \" + missionName);\n                return missionName;\n            }\n        }\n\n        // No Element Node for Mission.\n        throw new MissionParseException(\"Mission element could not be found.\");\n    }\n\n    /**\n     * Creates a Document given an InputStream.\n     * @param missionStream The stream to open a document from.\n     * @return The document, successfully parsed from xml.\n     * @throws MissionParseException\n     */\n    private static Document getDocumentFromInputStream(InputStream missionStream) throws\n            MissionParseException {\n        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\n        DocumentBuilder builder;\n        try {\n            builder = factory.newDocumentBuilder();\n        } catch (ParserConfigurationException e) {\n            e.printStackTrace();\n            throw new MissionParseException(\"ParserConfigurationException while reading mission.\");\n        }\n\n        Document doc;\n        try {\n            doc = builder.parse(missionStream);\n        } catch (SAXException e) {\n            e.printStackTrace();\n            throw new MissionParseException(\"SAXException while reading mission.\");\n        } catch (IOException e) {\n            e.printStackTrace();\n            throw new MissionParseException(\"IOException  while reading mission.\");\n        }\n\n        return doc;\n    }\n\n    /**\n     * Determines the Fictional Progress strings associated with a moment.\n     * @param momentElement The moment to parse.\n     * @return A list of Fictional Progress strings.\n     */\n    private static ArrayList<String> parseMomentFictionalProgress(Element momentElement)\n            throws MissionParseException {\n        ArrayList<String> progress = new ArrayList<>();\n        NodeList fictionalProgressNodes =\n                momentElement.getElementsByTagName(ELEMENT_FICTIONAL_PROGRESS);\n        for (int i = 0; i < fictionalProgressNodes.getLength(); i++) {\n            Node node = fictionalProgressNodes.item(i);\n            Element parent = (Element) node.getParentNode();\n            if (isElementNode(node) && parent.getTagName().equals(ELEMENT_MOMENT)) {\n                String progressString = parseFictionalProgressElement((Element) node);\n                progress.add(progressString);\n            }\n        }\n        return progress;\n    }\n\n    private static String parseFictionalProgressElement(Element element)\n            throws MissionParseException {\n        Node node = element.getFirstChild();\n        if (node == null) {\n            throw new MissionParseException(\"Fictional Progress Element not found\");\n        }\n        String progressString = element.getFirstChild().getTextContent();\n        if (progressString.equals(\"\")) {\n            throw new MissionParseException(\"Fictional Progress empty.\");\n        }\n        return progressString;\n    }\n\n    private static ArrayList<String> parseNestedFictionalProgress(Element parent)\n            throws MissionParseException {\n        ArrayList<String> progressStrings = new ArrayList<>();\n        NodeList nodeList = parent.getElementsByTagName(ELEMENT_FICTIONAL_PROGRESS);\n        for (int i = 0; i < nodeList.getLength(); i++) {\n            Node node = nodeList.item(i);\n            if (isElementNode(node)) {\n                String progressString = parseFictionalProgressElement((Element) node);\n                progressStrings.add(progressString);\n            }\n        }\n        return progressStrings;\n    }\n\n    private static String parseIconElement(Element iconElement) throws MissionParseException {\n        String iconResourceName = iconElement.getAttribute(ICON_ATTRIBUTE_NAME);\n        if (iconResourceName == null || iconResourceName.equals(\"\")) {\n            throw new MissionParseException(\"Icon element has no name attribute.\");\n        }\n        return iconResourceName;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/google/fpl/gim/examplegame/utils/Utils.java",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.fpl.gim.examplegame.utils;\n\nimport android.util.Log;\n\nimport com.google.fpl.gim.examplegame.BuildConfig;\n\nimport java.io.File;\nimport java.util.ArrayList;\n\n/**\n * A few utility functions and classes used by the prototype.\n */\npublic class Utils {\n\n    public static final float SECONDS_TO_NANOS_SCALE = (float) Math.pow(10, 9);\n    public static final float NANOS_TO_SECONDS_SCALE = (float) Math.pow(10, -9);\n    public static final int MINUTES_TO_SECONDS_SCALE = 60;\n    public static final float SECONDS_TO_MINUTES_SCALE = 1.0f / 60;\n    public static final float MILES_TO_FEET_SCALE = 5280f;\n    public static final float SECONDS_PER_METER_TO_MINUTES_PER_MILE_SCALE = 26.8224f;\n\n    // user control for displaying log messages\n    private static final boolean DEBUG_LOG = true;\n\n    public static float nanosToSeconds(long nanos) {\n        return nanos / SECONDS_TO_NANOS_SCALE;\n    }\n\n    public static long secondsToNanos(float seconds) {\n        return (long) (seconds * SECONDS_TO_NANOS_SCALE);\n    }\n\n    public static long minutesToNanos(float min) {\n        return (long) (min * MINUTES_TO_SECONDS_SCALE * SECONDS_TO_NANOS_SCALE);\n    }\n\n    public static float nanosToMinutes(long nanos) {\n        return (nanos / SECONDS_TO_NANOS_SCALE / MINUTES_TO_SECONDS_SCALE);\n    }\n\n    public static float feetToMiles(float feet) {\n        return feet / MILES_TO_FEET_SCALE;\n    }\n\n    public static float secondsToMinutes(float seconds) {\n        return seconds / MINUTES_TO_SECONDS_SCALE;\n    }\n\n    public static float metersPerSecondToMinutesPerMile(float metersPerSecond) {\n        if (metersPerSecond == 0.0f) {\n            return 0.0f;\n        }\n        float secondsPerMeter = 1 / metersPerSecond;  // seconds per meter\n        return secondsPerMeter * SECONDS_PER_METER_TO_MINUTES_PER_MILE_SCALE;\n    }\n\n    /**\n     * Prints debugging messages to the console.\n     *\n     * Disabled for non-debug builds.\n     *\n     * @param message - The message to print to the console.\n     */\n    public static void logDebug(String tag, String message) {\n        if (BuildConfig.DEBUG || DEBUG_LOG) {\n            Log.d(tag, message);\n        }\n    }\n\n    /**\n     * Builds a file path.\n     * @param rootDirectory Highest directory or file name, if not nested.\n     * @param subDirectories Sub-Directories, or the file name.\n     * @return A string of the file path.\n     */\n    public static String makeFilePath(String rootDirectory, ArrayList<String> subDirectories) {\n        File file = new File(rootDirectory);\n        for (String subDirectory : subDirectories) {\n            file = new File(file, subDirectory);\n        }\n        return file.toString();\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/anim/slide_in_right.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<set>\n    <objectAnimator xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:propertyName=\"x\"\n        android:valueType=\"floatType\"\n        android:valueFrom=\"1280\"\n        android:valueTo=\"0\"\n        android:duration=\"500\"/>\n</set>"
  },
  {
    "path": "app/src/main/res/anim/slide_out_left.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<set>\n    <objectAnimator xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:propertyName=\"x\"\n        android:valueType=\"floatType\"\n        android:valueFrom=\"0\"\n        android:valueTo=\"-1280\"\n        android:duration=\"500\"/>\n</set>"
  },
  {
    "path": "app/src/main/res/drawable/weapon_charge_progress.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<layer-list\n    xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n\n    <item android:id=\"@android:id/background\">\n\n        <shape\n            android:innerRadiusRatio=\"3\"\n            android:shape=\"ring\"\n            android:useLevel=\"false\"\n            android:thicknessRatio=\"10.0\" >\n\n            <solid android:color=\"@color/gray\" />\n\n        </shape>\n\n    </item>\n\n    <item android:id=\"@android:id/progress\">\n\n        <shape\n            android:innerRadiusRatio=\"3\"\n            android:shape=\"ring\"\n            android:thicknessRatio=\"10.0\" >\n\n            <solid android:color=\"@color/background_floating_material_dark\" />\n\n        </shape>\n\n    </item>\n\n</layer-list>"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/container\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    tools:context=\"com.google.fpl.gim.examplegame.MainActivity\"\n    tools:ignore=\"MergeRootFrame\" />\n"
  },
  {
    "path": "app/src/main/res/layout/end_screen.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\" android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <TextView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:textAppearance=\"?android:attr/textAppearanceLarge\"\n        android:text=\"@string/fictional_progress_text\"\n        android:id=\"@+id/fictionalProgressText\"\n        android:paddingLeft=\"@dimen/medium_horizontal_margin\"\n        android:paddingRight=\"@dimen/medium_horizontal_margin\"\n        android:paddingTop=\"@dimen/medium_horizontal_margin\"/>\n\n    <ListView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"@dimen/end_list_height\"\n        android:id=\"@+id/fictionalProgressList\" />\n\n    <TextView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:textAppearance=\"?android:attr/textAppearanceLarge\"\n        android:text=\"@string/fitness_statistics_text\"\n        android:id=\"@+id/fitnessStatisticsText\"\n        android:paddingLeft=\"@dimen/medium_horizontal_margin\"\n        android:paddingRight=\"@dimen/medium_horizontal_margin\"\n        android:paddingTop=\"@dimen/medium_vertical_margin\"/>\n\n    <ListView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"@dimen/end_list_height\"\n        android:id=\"@+id/fitnessStatisticsList\" />\n\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/menu_list_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_height=\"wrap_content\"\n    android:layout_width=\"match_parent\"\n    android:clickable=\"false\" >\n\n    <TextView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"@dimen/list_item_height\"\n        android:text=\"asdf\"\n        android:gravity=\"center_vertical\"\n        android:paddingLeft=\"@dimen/medium_horizontal_margin\"\n        android:paddingRight=\"@dimen/medium_horizontal_margin\"\n        android:paddingTop=\"@dimen/medium_vertical_margin\"\n        android:paddingBottom=\"@dimen/medium_vertical_margin\"\n        android:id=\"@+id/list_item_text\"\n        android:clickable=\"false\"\n        android:textAppearance=\"?android:attr/textAppearanceListItem\"\n        android:textSize=\"@dimen/small_text_size\" />\n\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/menu_mission_list.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    style=\"match_parent\">\n\n    <RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"150dp\"\n        android:id=\"@+id/relativeLayout\"\n        android:background=\"@color/primary_material_light\">\n\n        <FrameLayout\n            android:layout_width=\"130dp\"\n            android:layout_height=\"fill_parent\"\n            android:layout_alignParentBottom=\"false\"\n            android:clickable=\"false\"\n            android:background=\"@color/gray\"\n            android:id=\"@+id/arg\"\n            android:layout_marginLeft=\"@dimen/medium_horizontal_margin\"\n            android:layout_marginTop=\"@dimen/medium_vertical_margin\"\n            android:layout_marginRight=\"@dimen/medium_horizontal_margin\"\n            android:layout_marginBottom=\"@dimen/activity_vertical_margin\"\n            android:layout_alignWithParentIfMissing=\"false\" />\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:textAppearance=\"?android:attr/textAppearanceLarge\"\n            android:text=\"Jane Doe\"\n            android:id=\"@+id/agent_name\"\n            android:layout_alignTop=\"@+id/arg\"\n            android:layout_toRightOf=\"@+id/arg\" />\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"Beginner Agent\"\n            android:id=\"@+id/agent_level\"\n            android:layout_below=\"@+id/agent_name\"\n            android:layout_alignLeft=\"@+id/agent_name\"\n            android:layout_alignStart=\"@+id/agent_name\" />\n    </RelativeLayout>\n\n    <ListView android:id=\"@id/android:list\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"fill_parent\"\n        android:drawSelectorOnTop=\"false\"\n        android:layout_below=\"@+id/relativeLayout\"\n        android:layout_alignParentBottom=\"false\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/menu_music_selection.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\" android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:layout_marginBottom=\"@dimen/layout_margin_bottom\">\n\n    <TextView\n        style=\"@style/AppTheme.TitleText\"\n        android:text=\"@string/select_music\"\n        android:id=\"@+id/music_selection\"\n        android:gravity=\"left\" />\n\n    <TextView\n        style=\"@style/AppTheme.DetailText\"\n        android:text=\"@string/select_music_details\"\n        android:id=\"@+id/music_selection_details\"\n        android:layout_below=\"@+id/music_selection\" />\n\n    <Button\n        style=\"@style/AppTheme.BigButton\"\n        android:id=\"@+id/start_mission_button\"\n        android:text=\"@string/start_mission_button\"\n        android:onClick=\"onStartMissionPressed\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/menu_run_specifications.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\" android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:layout_marginBottom=\"@dimen/layout_margin_bottom\">\n\n    <TextView\n        style=\"@style/AppTheme.TitleText\"\n        android:gravity=\"left\"\n        android:text=\"@string/challenge_speed_select\"\n        android:id=\"@+id/challenge_speed_title\" />\n\n    <TextView\n        style=\"@style/AppTheme.DetailText\"\n        android:text=\"@string/challenge_speed_detail_text\"\n        android:id=\"@+id/challenge_speed_detail_text\"\n        android:layout_below=\"@+id/challenge_speed_title\" />\n\n    <SeekBar\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:id=\"@+id/challenge_speed_field\"\n        android:paddingTop=\"@dimen/large_vertical_margin\"\n        android:layout_below=\"@+id/challenge_speed_detail_text\"\n        android:thumbTint=\"@color/primary_dark_material_light\"\n        android:progressTint=\"@color/primary_dark_material_light\" />\n\n    <TextView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:id=\"@+id/challenge_speed_text\"\n        android:paddingLeft=\"@dimen/large_horizontal_margin\"\n        android:paddingRight=\"@dimen/large_horizontal_margin\"\n        android:textAppearance=\"?android:attr/textAppearanceLarge\"\n        android:layout_below=\"@+id/challenge_speed_field\" />\n\n    <Button\n        style=\"@style/AppTheme.BigButton\"\n        android:id=\"@+id/enter_button\"\n        android:text=\"@string/run_specification_enter_button\"\n        android:onClick=\"onEnterPressed\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/menu_start.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\" android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:orientation=\"vertical\" android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_marginBottom=\"@dimen/layout_margin_bottom\" >\n\n        <TextView\n            style=\"@style/AppTheme.TitleText\"\n            android:text=\"@string/game_name_text\"\n            android:id=\"@+id/game_name\" />\n\n        <TextView\n            style=\"@style/AppTheme.DetailText\"\n            android:text=\"@string/game_instructions_text\"\n            android:id=\"@+id/game_instructions\"\n            android:layout_below=\"@+id/game_name\" />\n\n        <Button\n            style=\"@style/AppTheme.BigButton\"\n            android:text=\"@string/start_button_not_connected\"\n            android:id=\"@+id/start_button\"\n            android:onClick=\"onStartButtonPressed\"\n            android:enabled=\"false\" />\n\n    </RelativeLayout>\n\n    <TextView\n        style=\"match_parent\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/game_credits_text\"\n        android:id=\"@+id/game_credits\"\n        android:paddingRight=\"@dimen/large_horizontal_margin\"\n        android:paddingLeft=\"@dimen/large_horizontal_margin\"\n        android:paddingTop=\"@dimen/large_vertical_margin\"\n        android:paddingBottom=\"@dimen/large_vertical_margin\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_alignParentLeft=\"true\"\n        android:layout_alignParentStart=\"false\"\n        android:textColor=\"@color/secondary_text_default_material_light\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/placeholder_fragment.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\" android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <TextView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/placeholder_text\"\n        android:id=\"@+id/runFinishText\"\n        android:layout_gravity=\"center_horizontal\" />\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/step_display.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_gravity=\"center_vertical\"\n    android:layout_height=\"match_parent\">\n\n\n    <TextView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center_horizontal\"\n        android:id=\"@+id/time_exercised\"\n        android:text=\"@string/initial_time\"\n        android:textSize=\"@dimen/large_text_size\"\n        android:layout_alignParentTop=\"true\"\n        android:layout_marginTop=\"@dimen/large_vertical_margin\"/>\n\n    <TextView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center_horizontal\"\n        android:id=\"@+id/num_steps_taken\"\n        android:text=\"@string/initial_num_steps\"\n        android:textSize=\"@dimen/large_text_size\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_marginBottom=\"@dimen/large_vertical_margin\"/>\n\n    <ProgressBar\n        style=\"?android:attr/progressBarStyleHorizontal\"\n        android:id=\"@+id/circular_progress_bar\"\n        android:layout_centerInParent=\"true\"\n        android:layout_width=\"@dimen/progress_bar_size\"\n        android:layout_height=\"@dimen/progress_bar_size\"\n        android:indeterminate=\"false\"\n        android:rotation=\"270\"\n        android:progressDrawable=\"@drawable/weapon_charge_progress\" />\n\n    <LinearLayout\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_centerVertical=\"true\"\n        android:gravity=\"center\"\n        android:orientation=\"vertical\">\n\n        <TextView\n            android:id=\"@+id/minutes_per_mile\"\n            android:text=\"@string/not_moving_speed\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center_horizontal\"\n            android:textSize=\"@dimen/large_text_size\" />\n\n        <TextView\n            android:id=\"@+id/percent_weapon_charged\"\n            android:text=\"@string/initial_percent_weapon_charge\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:textSize=\"@dimen/large_text_size\" />\n\n    </LinearLayout>\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/menu/main.xml",
    "content": "<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:context=\"com.google.fpl.gim.examplegame.MainActivity\" >\n</menu>\n"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<resources>\n    <color name=\"light_gray\">#ffebebeb</color>\n    <color name=\"gray\">#FFD0D0D0</color>\n    <color name=\"green\">#00933B</color>\n    <color name=\"red\">#ff0d4e</color>\n</resources>"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n    <dimen name=\"medium_horizontal_margin\">10dp</dimen>\n    <dimen name=\"medium_vertical_margin\">10dp</dimen>\n    <dimen name=\"large_horizontal_margin\">20dp</dimen>\n    <dimen name=\"large_vertical_margin\">20dp</dimen>\n    <dimen name=\"very_large_vertical_margin\">40dp</dimen>\n    <dimen name=\"list_item_height\">50dp</dimen>\n    <dimen name=\"button_height\">100dp</dimen>\n    <dimen name=\"end_list_height\">175dp</dimen>\n    <dimen name=\"medium_button_width\">120dp</dimen>\n    <dimen name=\"button_margin_left\">10dp</dimen>\n    <dimen name=\"button_margin_right\">10dp</dimen>\n    <dimen name=\"layout_margin_bottom\">70dp</dimen>\n    <dimen name=\"large_text_size\">40sp</dimen>\n    <dimen name=\"medium_text_size\">25sp</dimen>\n    <dimen name=\"small_text_size\">15sp</dimen>\n    <dimen name=\"button_text_size\">20sp</dimen>\n    <dimen name=\"progress_bar_size\">350dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/ids.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<resources>\n\n    <!-- Google Play Games App ID -->\n    <string name=\"app_id\">782016241500</string>\n\n    <!-- Achievement for completing one mission -->\n    <string name=\"ach_id_first_mission\">CgkI3L6znuEWEAIQAQ</string>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<resources>\n    <string name=\"app_name\">Games in Motion</string>\n    <string name=\"action_settings\">Settings</string>\n    <string name=\"example_action_clicked\">Example action clicked</string>\n    <string name=\"notification_title\">Enemy</string>\n    <string name=\"notification_content\">An enemy appeared! What will you do?</string>\n    <string name=\"default_action_name\">Action</string>\n    <string name=\"default_notification_title\">Enemy!</string>\n    <string name=\"default_notification_content\">An enemy appeared, what will you do?</string>\n    <string name=\"disconnection_notification_title\">Disconnected.</string>\n    <string name=\"disconnection_notification_content\">\n        Google client has been disconnected. Please make sure you have WiFi or cellular data\n        turned on.\n    </string>\n    <string name=\"game_name_text\">Games in Motion</string>\n    <string name=\"game_instructions_text\">\n        You are in the midst of a zombie apocalypse.  Your task is to evade as many zombies as\n        possible throughout the course of your run.\\n\\nPlease put on your headphones so you can\n        receive important instructions. A paired Android wear device is also recommended.\n    </string>\n    <string name=\"game_credits_text\">\n        Created by Kate Aplin and Veronica Wharton, Summer 2014 EP Interns\n    </string>\n    <string name=\"start_button_ready\">\n        Start!\n    </string>\n    <string name=\"start_button_not_connected\">\n        Connecting to Google Fit…\n    </string>\n    <string name=\"select_mission_title\">Select Mission</string>\n    <string name=\"select_mission_instructions_text\">\n        Select your mission\n    </string>\n    <string name=\"select_mission_length_instructions_text\">\n        How long will your mission be?\n    </string>\n    <string name=\"select_interval_length_instructions_text\">\n        How long will your intervals be?\n    </string>\n    <string name=\"challenge_speed_select\">\n        Slide to choose your challenge speed.\n    </string>\n    <string name=\"challenge_speed_detail_text\">\n        Choose carefully! Your weapon will only charge when you are running at challenge pace.\n        \\n\\nYour mission will last 0 to 60 minutes, with an interval length of 1.5 minutes.\n    </string>\n    <string name=\"run_specification_title\">Choose Speed</string>\n    <string name=\"run_specification_enter_button\">Confirm Interval Speed</string>\n    <string name=\"challenge_speed_display\">\n        %.2f minutes/mile\n    </string>\n    <string name=\"select_music_title\">Select Music</string>\n    <string name=\"select_music\">\n        Select music to play during your run.\n    </string>\n    <string name=\"select_music_details\">\n        Put on your headphones to receive play instructions when the mission starts.\\n\\nIf you would\n        like to listen to music as you run, switch to the music app of your choice and play any\n        track you would like. Return here and select \"I am ready!\" when you are ready to begin the\n        mission.\n    </string>\n    <string name=\"start_mission_button\">I am ready!</string>\n    <string name=\"start_mission_pressed\">Registering sensors...</string>\n    <string name=\"placeholder_text\">You are currently in a game. Sit tight.</string>\n    <string name=\"run_finish_text\">You finished a run!</string>\n    <string name=\"fit_disconnected_text\">Google Fit disconnected</string>\n    <string name=\"fictional_progress_text\">Your progress:</string>\n    <string name=\"fitness_statistics_text\">Your fitness:</string>\n    <string name=\"restart_button_text\">Restart</string>\n    <string name=\"not_moving_speed\">---\\nmin/mile</string>\n    <string name=\"initial_percent_weapon_charge\">0%</string>\n    <string name=\"initial_num_steps\">0 steps</string>\n    <string name=\"initial_time\">0:00</string>\n    <string name=\"label_challenge_pace_min_per_mile\">Challenge pace (min/mile): </string>\n    <string name=\"fitness_stat_num_steps\">Number of steps taken: %d</string>;\n    <string name=\"fitness_stat_num_intervals\">Number of intervals completed: %d</string>\n\n    <string name=\"weapon_status_notification_title\">% charged.</string>\n    <string name=\"weapon_status_notification_text\">\n        Keep running at interval speed to charge your weapon!\n    </string>\n\n    <string name=\"log_message_minutes_per_mile\"> minutes per mile.</string>\n    <string name=\"log_message_you_are_not_moving\">You are not moving.</string>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n    </style>\n\n    <style name=\"AppTheme.TitleText\" parent=\"@android:style/TextAppearance.Large\">\n        <item name=\"android:layout_width\">wrap_content</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_gravity\">center_horizontal</item>\n        <item name=\"android:paddingRight\">@dimen/large_horizontal_margin</item>\n        <item name=\"android:paddingLeft\">@dimen/large_horizontal_margin</item>\n        <item name=\"android:paddingTop\">@dimen/large_vertical_margin</item>\n        <item name=\"android:paddingBottom\">@dimen/large_vertical_margin</item>\n        <item name=\"android:gravity\">center</item>\n        <item name=\"android:layout_alignParentTop\">true</item>\n        <item name=\"android:layout_centerHorizontal\">true</item>\n    </style>\n\n    <style name=\"AppTheme.DetailText\" parent=\"@android:style/TextAppearance.Medium\">\n        <item name=\"android:layout_width\">wrap_content</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_gravity\">center_horizontal</item>\n        <item name=\"android:paddingRight\">@dimen/large_horizontal_margin</item>\n        <item name=\"android:paddingLeft\">@dimen/large_horizontal_margin</item>\n        <item name=\"android:paddingTop\">@dimen/large_vertical_margin</item>\n        <item name=\"android:paddingBottom\">@dimen/large_vertical_margin</item>\n        <item name=\"android:layout_alignParentLeft\">true</item>\n        <item name=\"android:layout_centerHorizontal\">true</item>\n        <item name=\"android:textColor\">@color/primary_text_default_material_light</item>\n    </style>\n\n    <style name=\"AppTheme.BigButton\">\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_height\">@dimen/button_height</item>\n        <item name=\"android:paddingRight\">@dimen/large_horizontal_margin</item>\n        <item name=\"android:paddingLeft\">@dimen/large_horizontal_margin</item>\n        <item name=\"android:paddingTop\">@dimen/large_vertical_margin</item>\n        <item name=\"android:paddingBottom\">@dimen/large_vertical_margin</item>\n        <item name=\"android:layout_gravity\">bottom</item>\n        <item name=\"android:layout_alignParentLeft\">true</item>\n        <item name=\"android:layout_marginLeft\">@dimen/button_margin_left</item>\n        <item name=\"android:layout_marginRight\">@dimen/button_margin_right</item>\n        <item name=\"android:layout_alignParentBottom\">true</item>\n        <item name=\"android:textSize\">@dimen/button_text_size</item>\n    </style>\n\n    <style name=\"AppTheme.FitnessDataDescText\" parent=\"@android:style/TextAppearance.Medium\">\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_height\">match_parent</item>\n        <item name=\"android:layout_weight\">0.55</item>\n        <item name=\"android:paddingRight\">@dimen/medium_horizontal_margin</item>\n        <item name=\"android:paddingLeft\">@dimen/medium_horizontal_margin</item>\n        <item name=\"android:gravity\">right|bottom</item>\n    </style>\n\n    <style name=\"AppTheme.FitnessDataStatTextLayout\">\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_height\">match_parent</item>\n        <item name=\"android:layout_weight\">0.45</item>\n        <item name=\"android:orientation\">horizontal</item>\n        <item name=\"android:gravity\">bottom</item>\n        <item name=\"android:layout_marginLeft\">@dimen/medium_horizontal_margin</item>\n    </style>\n\n    <style name=\"AppTheme.FitnessDataStatText\" parent=\"@android:style/TextAppearance.Large\">\n        <item name=\"android:layout_width\">match_parent</item>\n        <item name=\"android:layout_height\">match_parent</item>\n        <item name=\"android:gravity\">bottom</item>\n        <item name=\"android:textSize\">@dimen/large_text_size</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "content": "<!--\n  ~ Copyright 2015 Google Inc. All Rights Reserved.\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "build.gradle",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        mavenCentral()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:1.0.0'\n    }\n}\n\nallprojects {\n    repositories {\n        mavenCentral()\n    }\n}\n"
  },
  {
    "path": "docs/generate_docs.py",
    "content": "#!/usr/bin/python\n# Copyright 2015 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Generate html documentation from markdown and doxygen comments.\"\"\"\n\nimport os\nimport sys\n\nTHIS_DIR = os.path.realpath(os.path.dirname(__file__))\nPROJECT_DIR = os.path.realpath(os.path.join(THIS_DIR, os.pardir))\nsys.path.extend(\n    [os.path.realpath(os.path.join(PROJECT_DIR, os.pardir, os.pardir, '../libs', 'fplutil')),\n     os.path.realpath(os.path.join(PROJECT_DIR, 'dependencies', 'fplutil'))])\nimport docs  # pylint: disable=C6204\n\n\ndef main():\n  \"\"\"Generate html documentation from markdown and doxygen comments.\n\n  Returns:\n    0 if successful, 1 otherwise.\n  \"\"\"\n  sys.argv.extend(('--linklint-dir', THIS_DIR,\n                   '--source-dir', os.path.join(THIS_DIR, 'src'),\n                   '--project-dir', PROJECT_DIR))\n  return docs.generate_docs.main()\n\nif __name__ == '__main__':\n  sys.exit(main())\n"
  },
  {
    "path": "docs/src/contributing.md",
    "content": "Contributing    {#contributing}\n============\n\nWant to contribute? Great! First, read this page (including the small print at\nthe end).\n\n# Before you contribute\nBefore we can use your code, you must sign the\n[Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1)\n(CLA), which you can do online. The CLA is necessary mainly because you own the\ncopyright to your changes, even after your contribution becomes part of our\ncodebase, so we need your permission to use and distribute your code. We also\nneed to be sure of various other things—for instance that you'll tell us if you\nknow that your code infringes on other people's patents. You don't have to sign\nthe CLA until after you've submitted your code for review and a member has\napproved it, but you must do it before we can put your code into our codebase.\nBefore you start working on a larger contribution, you should get in touch with\nus first through the issue tracker with your idea so that we can help out and\npossibly guide you. Coordinating up front makes it much easier to avoid\nfrustration later on.\n\n# Code reviews\nAll submissions, including submissions by project members, require review. We\nuse Github pull requests for this purpose.\n\n# The small print\nContributions made by corporations are covered by a different agreement than\nthe one above, the Software Grant and Corporate Contributor License Agreement.\n"
  },
  {
    "path": "docs/src/doxyfile",
    "content": "# Doxyfile 1.8.5\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project.\n#\n# All text after a double hash (##) is considered a comment and is placed in\n# front of the TAG it is preceding.\n#\n# All text after a single hash (#) is considered a comment and will be ignored.\n# The format is:\n# TAG = value [value, ...]\n# For lists, items can also be appended using:\n# TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\\\" \\\").\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the config file\n# that follow. The default is UTF-8 which is also the encoding used for all text\n# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv\n# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv\n# for the list of possible encodings.\n# The default value is: UTF-8.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by\n# double-quotes, unless you are using Doxywizard) that should identify the\n# project for which the documentation is generated. This name is used in the\n# title of most generated pages and in a few other places.\n# The default value is: My Project.\n\nPROJECT_NAME           = \"Games in Motion\"\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. This\n# could be handy for archiving the generated documentation or if some version\n# control system is used.\n\nPROJECT_NUMBER         =\n\n# Using the PROJECT_BRIEF tag one can provide an optional one line description\n# for a project that appears at the top of each page and should give viewer a\n# quick idea about the purpose of the project. Keep the description short.\n\nPROJECT_BRIEF          =\n\n# With the PROJECT_LOGO tag one can specify an logo or icon that is included in\n# the documentation. The maximum height of the logo should not exceed 55 pixels\n# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo\n# to the output directory.\n\nPROJECT_LOGO           = \"../../app/src/main/res/mipmap-hdpi/ic_launcher.png\"\n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path\n# into which the generated documentation will be written. If a relative path is\n# entered, it will be relative to the location where doxygen was started. If\n# left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       = \"../\"\n\n# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-\n# directories (in 2 levels) under the output directory of each output format and\n# will distribute the generated files over these directories. Enabling this\n# option can be useful when feeding doxygen a huge amount of source files, where\n# putting all generated files in the same directory would otherwise causes\n# performance problems for the file system.\n# The default value is: NO.\n\nCREATE_SUBDIRS         = NO\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all\n# documentation generated by doxygen is written. Doxygen will use this\n# information to generate all constant output in the proper language.\n# Possible values are: Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-\n# Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Farsi,\n# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en,\n# Korean, Korean-en, Latvian, Norwegian, Macedonian, Persian, Polish,\n# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish,\n# Turkish, Ukrainian and Vietnamese.\n# The default value is: English.\n\nOUTPUT_LANGUAGE        = English\n\n# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member\n# descriptions after the members that are listed in the file and class\n# documentation (similar to Javadoc). Set to NO to disable this.\n# The default value is: YES.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief\n# description of a member or function before the detailed description\n#\n# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the\n# brief descriptions will be completely suppressed.\n# The default value is: YES.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator that is\n# used to form the text in various listings. Each string in this list, if found\n# as the leading text of the brief description, will be stripped from the text\n# and the result, after processing the whole list, is used as the annotated\n# text. Otherwise, the brief description is used as-is. If left blank, the\n# following values are used ($name is automatically replaced with the name of\n# the entity):The $name class, The $name widget, The $name file, is, provides,\n# specifies, contains, represents, a, an and the.\n\nABBREVIATE_BRIEF       = \"The $name class\" \\\n                         \"The $name widget\" \\\n                         \"The $name file\" \\\n                         is \\\n                         provides \\\n                         specifies \\\n                         contains \\\n                         represents \\\n                         a \\\n                         an \\\n                         the\n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then\n# doxygen will generate a detailed section even if there is only a brief\n# description.\n# The default value is: NO.\n\nALWAYS_DETAILED_SEC    = NO\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all\n# inherited members of a class in the documentation of that class as if those\n# members were ordinary class members. Constructors, destructors and assignment\n# operators of the base classes will not be shown.\n# The default value is: NO.\n\nINLINE_INHERITED_MEMB  = NO\n\n# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path\n# before files name in the file list and in the header files. If set to NO the\n# shortest path that makes the file name unique will be used\n# The default value is: YES.\n\nFULL_PATH_NAMES        = NO\n\n# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.\n# Stripping is only done if one of the specified strings matches the left-hand\n# part of the path. The tag can be used to show relative paths in the file list.\n# If left blank the directory from which doxygen is run is used as the path to\n# strip.\n#\n# Note that you can specify absolute paths here, but also relative paths, which\n# will be relative from the directory where doxygen is started.\n# This tag requires that the tag FULL_PATH_NAMES is set to YES.\n\nSTRIP_FROM_PATH        =\n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the\n# path mentioned in the documentation of a class, which tells the reader which\n# header file to include in order to use a class. If left blank only the name of\n# the header file containing the class definition is used. Otherwise one should\n# specify the list of include paths that are normally passed to the compiler\n# using the -I flag.\n\nSTRIP_FROM_INC_PATH    =\n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but\n# less readable) file names. This can be useful is your file systems doesn't\n# support long names like on DOS, Mac, or CD-ROM.\n# The default value is: NO.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the\n# first line (until the first dot) of a Javadoc-style comment as the brief\n# description. If set to NO, the Javadoc-style will behave just like regular Qt-\n# style comments (thus requiring an explicit @brief command for a brief\n# description.)\n# The default value is: NO.\n\nJAVADOC_AUTOBRIEF      = NO\n\n# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first\n# line (until the first dot) of a Qt-style comment as the brief description. If\n# set to NO, the Qt-style will behave just like regular Qt-style comments (thus\n# requiring an explicit \\brief command for a brief description.)\n# The default value is: NO.\n\nQT_AUTOBRIEF           = NO\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a\n# multi-line C++ special comment block (i.e. a block of //! or /// comments) as\n# a brief description. This used to be the default behavior. The new default is\n# to treat a multi-line C++ comment block as a detailed description. Set this\n# tag to YES if you prefer the old behavior instead.\n#\n# Note that setting this tag to YES also means that rational rose comments are\n# not recognized any more.\n# The default value is: NO.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the\n# documentation from any documented member that it re-implements.\n# The default value is: YES.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a\n# new page for each member. If set to NO, the documentation of a member will be\n# part of the file/class/namespace that contains it.\n# The default value is: NO.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen\n# uses this value to replace tabs by spaces in code fragments.\n# Minimum value: 1, maximum value: 16, default value: 4.\n\nTAB_SIZE               = 2\n\n# This tag can be used to specify a number of aliases that act as commands in\n# the documentation. An alias has the form:\n# name=value\n# For example adding\n# \"sideeffect=@par Side Effects:\\n\"\n# will allow you to put the command \\sideeffect (or @sideeffect) in the\n# documentation, which will result in a user-defined paragraph with heading\n# \"Side Effects:\". You can put \\n's in the value part of an alias to insert\n# newlines.\n\nALIASES                =\n\n# This tag can be used to specify a number of word-keyword mappings (TCL only).\n# A mapping has the form \"name=value\". For example adding \"class=itcl::class\"\n# will allow you to use the command class in the itcl::class meaning.\n\nTCL_SUBST              =\n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources\n# only. Doxygen will then generate output that is more tailored for C. For\n# instance, some of the names that are used will be different. The list of all\n# members will be omitted, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_FOR_C  = NO\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or\n# Python sources only. Doxygen will then generate output that is more tailored\n# for that language. For instance, namespaces will be presented as packages,\n# qualified scopes will look different, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_JAVA   = NO\n\n# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran\n# sources. Doxygen will then generate output that is tailored for Fortran.\n# The default value is: NO.\n\nOPTIMIZE_FOR_FORTRAN   = NO\n\n# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL\n# sources. Doxygen will then generate output that is tailored for VHDL.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_VHDL   = NO\n\n# Doxygen selects the parser to use depending on the extension of the files it\n# parses. With this tag you can assign which parser to use for a given\n# extension. Doxygen has a built-in mapping, but you can override or extend it\n# using this tag. The format is ext=language, where ext is a file extension, and\n# language is one of the parsers supported by doxygen: IDL, Java, Javascript,\n# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make\n# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C\n# (default is Fortran), use: inc=Fortran f=C.\n#\n# Note For files without extension you can use no_extension as a placeholder.\n#\n# Note that for custom extensions you also need to set FILE_PATTERNS otherwise\n# the files are not read by doxygen.\n\nEXTENSION_MAPPING      =\n\n# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments\n# according to the Markdown format, which allows for more readable\n# documentation. See http://daringfireball.net/projects/markdown/ for details.\n# The output of markdown processing is further processed by doxygen, so you can\n# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in\n# case of backward compatibilities issues.\n# The default value is: YES.\n\nMARKDOWN_SUPPORT       = YES\n\n# When enabled doxygen tries to link words that correspond to documented\n# classes, or namespaces to their corresponding documentation. Such a link can\n# be prevented in individual cases by by putting a % sign in front of the word\n# or globally by setting AUTOLINK_SUPPORT to NO.\n# The default value is: YES.\n\nAUTOLINK_SUPPORT       = YES\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want\n# to include (a tag file for) the STL sources as input, then you should set this\n# tag to YES in order to let doxygen match functions declarations and\n# definitions whose arguments contain STL classes (e.g. func(std::string);\n# versus func(std::string) {}). This also make the inheritance and collaboration\n# diagrams that involve STL classes more complete and accurate.\n# The default value is: NO.\n\nBUILTIN_STL_SUPPORT    = NO\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to\n# enable parsing support.\n# The default value is: NO.\n\nCPP_CLI_SUPPORT        = NO\n\n# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:\n# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen\n# will parse them like normal C++ but will assume all classes use public instead\n# of private inheritance when no explicit protection keyword is present.\n# The default value is: NO.\n\nSIP_SUPPORT            = NO\n\n# For Microsoft's IDL there are propget and propput attributes to indicate\n# getter and setter methods for a property. Setting this option to YES will make\n# doxygen to replace the get and set methods by a property in the documentation.\n# This will only work if the methods are indeed getting or setting a simple\n# type. If this is not the case, or you want to show the methods anyway, you\n# should set this option to NO.\n# The default value is: YES.\n\nIDL_PROPERTY_SUPPORT   = YES\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC\n# tag is set to YES, then doxygen will reuse the documentation of the first\n# member in the group (if any) for the other members of the group. By default\n# all members of a group must be documented explicitly.\n# The default value is: NO.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# Set the SUBGROUPING tag to YES to allow class member groups of the same type\n# (for instance a group of public functions) to be put as a subgroup of that\n# type (e.g. under the Public Functions section). Set it to NO to prevent\n# subgrouping. Alternatively, this can be done per class using the\n# \\nosubgrouping command.\n# The default value is: YES.\n\nSUBGROUPING            = YES\n\n# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions\n# are shown inside the group in which they are included (e.g. using \\ingroup)\n# instead of on a separate page (for HTML and Man pages) or section (for LaTeX\n# and RTF).\n#\n# Note that this feature does not work in combination with\n# SEPARATE_MEMBER_PAGES.\n# The default value is: NO.\n\nINLINE_GROUPED_CLASSES = NO\n\n# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions\n# with only public data fields or simple typedef fields will be shown inline in\n# the documentation of the scope in which they are defined (i.e. file,\n# namespace, or group documentation), provided this scope is documented. If set\n# to NO, structs, classes, and unions are shown on a separate page (for HTML and\n# Man pages) or section (for LaTeX and RTF).\n# The default value is: NO.\n\nINLINE_SIMPLE_STRUCTS  = NO\n\n# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or\n# enum is documented as struct, union, or enum with the name of the typedef. So\n# typedef struct TypeS {} TypeT, will appear in the documentation as a struct\n# with name TypeT. When disabled the typedef will appear as a member of a file,\n# namespace, or class. And the struct will be named TypeS. This can typically be\n# useful for C code in case the coding convention dictates that all compound\n# types are typedef'ed and only the typedef is referenced, never the tag name.\n# The default value is: NO.\n\nTYPEDEF_HIDES_STRUCT   = NO\n\n# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This\n# cache is used to resolve symbols given their name and scope. Since this can be\n# an expensive process and often the same symbol appears multiple times in the\n# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small\n# doxygen will become slower. If the cache is too large, memory is wasted. The\n# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range\n# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536\n# symbols. At the end of a run doxygen will report the cache usage and suggest\n# the optimal cache size from a speed point of view.\n# Minimum value: 0, maximum value: 9, default value: 0.\n\nLOOKUP_CACHE_SIZE      = 0\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in\n# documentation are documented, even if no documentation was available. Private\n# class members and static file members will be hidden unless the\n# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.\n# Note: This will also disable the warnings about undocumented members that are\n# normally produced when WARNINGS is set to YES.\n# The default value is: NO.\n\nEXTRACT_ALL            = NO\n\n# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will\n# be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PRIVATE        = NO\n\n# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal\n# scope will be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PACKAGE        = NO\n\n# If the EXTRACT_STATIC tag is set to YES all static members of a file will be\n# included in the documentation.\n# The default value is: NO.\n\nEXTRACT_STATIC         = YES\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined\n# locally in source files will be included in the documentation. If set to NO\n# only classes defined in header files are included. Does not have any effect\n# for Java sources.\n# The default value is: YES.\n\nEXTRACT_LOCAL_CLASSES  = NO\n\n# This flag is only useful for Objective-C code. When set to YES local methods,\n# which are defined in the implementation section but not in the interface are\n# included in the documentation. If set to NO only methods in the interface are\n# included.\n# The default value is: NO.\n\nEXTRACT_LOCAL_METHODS  = NO\n\n# If this flag is set to YES, the members of anonymous namespaces will be\n# extracted and appear in the documentation as a namespace called\n# 'anonymous_namespace{file}', where file will be replaced with the base name of\n# the file that contains the anonymous namespace. By default anonymous namespace\n# are hidden.\n# The default value is: NO.\n\nEXTRACT_ANON_NSPACES   = NO\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all\n# undocumented members inside documented classes or files. If set to NO these\n# members will be included in the various overviews, but no documentation\n# section is generated. This option has no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_MEMBERS     = NO\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all\n# undocumented classes that are normally visible in the class hierarchy. If set\n# to NO these classes will be included in the various overviews. This option has\n# no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_CLASSES     = NO\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend\n# (class|struct|union) declarations. If set to NO these declarations will be\n# included in the documentation.\n# The default value is: NO.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any\n# documentation blocks found inside the body of a function. If set to NO these\n# blocks will be appended to the function's detailed documentation block.\n# The default value is: NO.\n\nHIDE_IN_BODY_DOCS      = NO\n\n# The INTERNAL_DOCS tag determines if documentation that is typed after a\n# \\internal command is included. If the tag is set to NO then the documentation\n# will be excluded. Set it to YES to include the internal documentation.\n# The default value is: NO.\n\nINTERNAL_DOCS          = NO\n\n# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file\n# names in lower-case letters. If set to YES upper-case letters are also\n# allowed. This is useful if you have classes or files whose names only differ\n# in case and if your file system supports case sensitive file names. Windows\n# and Mac users are advised to set this option to NO.\n# The default value is: system dependent.\n\nCASE_SENSE_NAMES       = NO\n\n# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with\n# their full class and namespace scopes in the documentation. If set to YES the\n# scope will be hidden.\n# The default value is: NO.\n\nHIDE_SCOPE_NAMES       = NO\n\n# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of\n# the files that are included by a file in the documentation of that file.\n# The default value is: YES.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include\n# files with double quotes in the documentation rather than with sharp brackets.\n# The default value is: NO.\n\nFORCE_LOCAL_INCLUDES   = NO\n\n# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the\n# documentation for inline members.\n# The default value is: YES.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the\n# (detailed) documentation of file and class members alphabetically by member\n# name. If set to NO the members will appear in declaration order.\n# The default value is: YES.\n\nSORT_MEMBER_DOCS       = YES\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief\n# descriptions of file, namespace and class members alphabetically by member\n# name. If set to NO the members will appear in declaration order.\n# The default value is: NO.\n\nSORT_BRIEF_DOCS        = NO\n\n# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the\n# (brief and detailed) documentation of class members so that constructors and\n# destructors are listed first. If set to NO the constructors will appear in the\n# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.\n# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief\n# member documentation.\n# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting\n# detailed member documentation.\n# The default value is: NO.\n\nSORT_MEMBERS_CTORS_1ST = NO\n\n# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy\n# of group names into alphabetical order. If set to NO the group names will\n# appear in their defined order.\n# The default value is: NO.\n\nSORT_GROUP_NAMES       = NO\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by\n# fully-qualified names, including namespaces. If set to NO, the class list will\n# be sorted only by class name, not including the namespace part.\n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.\n# Note: This option applies only to the class list, not to the alphabetical\n# list.\n# The default value is: NO.\n\nSORT_BY_SCOPE_NAME     = NO\n\n# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper\n# type resolution of all parameters of a function it will reject a match between\n# the prototype and the implementation of a member function even if there is\n# only one candidate or it is obvious which candidate to choose by doing a\n# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still\n# accept a match between prototype and implementation in such cases.\n# The default value is: NO.\n\nSTRICT_PROTO_MATCHING  = NO\n\n# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the\n# todo list. This list is created by putting \\todo commands in the\n# documentation.\n# The default value is: YES.\n\nGENERATE_TODOLIST      = NO\n\n# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the\n# test list. This list is created by putting \\test commands in the\n# documentation.\n# The default value is: YES.\n\nGENERATE_TESTLIST      = NO\n\n# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug\n# list. This list is created by putting \\bug commands in the documentation.\n# The default value is: YES.\n\nGENERATE_BUGLIST       = NO\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)\n# the deprecated list. This list is created by putting \\deprecated commands in\n# the documentation.\n# The default value is: YES.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional documentation\n# sections, marked by \\if <section_label> ... \\endif and \\cond <section_label>\n# ... \\endcond blocks.\n\nENABLED_SECTIONS       =\n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the\n# initial value of a variable or macro / define can have for it to appear in the\n# documentation. If the initializer consists of more lines than specified here\n# it will be hidden. Use a value of 0 to hide initializers completely. The\n# appearance of the value of individual variables and macros / defines can be\n# controlled using \\showinitializer or \\hideinitializer command in the\n# documentation regardless of this setting.\n# Minimum value: 0, maximum value: 10000, default value: 30.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at\n# the bottom of the documentation of classes and structs. If set to YES the list\n# will mention the files that were used to generate the documentation.\n# The default value is: YES.\n\nSHOW_USED_FILES        = YES\n\n# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This\n# will remove the Files entry from the Quick Index and from the Folder Tree View\n# (if specified).\n# The default value is: YES.\n\nSHOW_FILES             = YES\n\n# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces\n# page. This will remove the Namespaces entry from the Quick Index and from the\n# Folder Tree View (if specified).\n# The default value is: YES.\n\nSHOW_NAMESPACES        = YES\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that\n# doxygen should invoke to get the current version for each file (typically from\n# the version control system). Doxygen will invoke the program by executing (via\n# popen()) the command command input-file, where command is the value of the\n# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided\n# by doxygen. Whatever the program writes to standard output is used as the file\n# version. For an example see the documentation.\n\nFILE_VERSION_FILTER    =\n\n# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed\n# by doxygen. The layout file controls the global structure of the generated\n# output files in an output format independent way. To create the layout file\n# that represents doxygen's defaults, run doxygen with the -l option. You can\n# optionally specify a file name after the option, if omitted DoxygenLayout.xml\n# will be used as the name of the layout file.\n#\n# Note that if you run doxygen from a directory containing a file called\n# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE\n# tag is left empty.\n\nLAYOUT_FILE            = doxygen_layout.xml\n\n# The CITE_BIB_FILES tag can be used to specify one or more bib files containing\n# the reference definitions. This must be a list of .bib files. The .bib\n# extension is automatically appended if omitted. This requires the bibtex tool\n# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.\n# For LaTeX the style of the bibliography can be controlled using\n# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the\n# search path. Do not use file names with spaces, bibtex cannot handle them. See\n# also \\cite for info how to create references.\n\nCITE_BIB_FILES         =\n\n#---------------------------------------------------------------------------\n# Configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated to\n# standard output by doxygen. If QUIET is set to YES this implies that the\n# messages are off.\n# The default value is: NO.\n\nQUIET                  = NO\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are\n# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES\n# this implies that the warnings are on.\n#\n# Tip: Turn warnings on while writing the documentation.\n# The default value is: YES.\n\nWARNINGS               = YES\n\n# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate\n# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag\n# will automatically be disabled.\n# The default value is: YES.\n\nWARN_IF_UNDOCUMENTED   = YES\n\n# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for\n# potential errors in the documentation, such as not documenting some parameters\n# in a documented function, or documenting parameters that don't exist or using\n# markup commands wrongly.\n# The default value is: YES.\n\nWARN_IF_DOC_ERROR      = YES\n\n# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that\n# are documented, but have no documentation for their parameters or return\n# value. If set to NO doxygen will only warn about wrong or incomplete parameter\n# documentation, but not about the absence of documentation.\n# The default value is: NO.\n\nWARN_NO_PARAMDOC       = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that doxygen\n# can produce. The string should contain the $file, $line, and $text tags, which\n# will be replaced by the file and line number from which the warning originated\n# and the warning text. Optionally the format may contain $version, which will\n# be replaced by the version of the file (if it could be obtained via\n# FILE_VERSION_FILTER)\n# The default value is: $file:$line: $text.\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning and error\n# messages should be written. If left blank the output is written to standard\n# error (stderr).\n\nWARN_LOGFILE           =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag is used to specify the files and/or directories that contain\n# documented source files. You may enter file names like myfile.cpp or\n# directories like /usr/src/myproject. Separate the files or directories with\n# spaces.\n# Note: If this tag is empty the current directory is searched.\n\nINPUT                  = \"contributing.md\" \\\n                         \"index.md\" \\\n                         \"programmers_guide/assets.md\" \\\n                         \"programmers_guide/audio.md\" \\\n                         \"programmers_guide/building.md\" \\\n                         \"programmers_guide/core.md\" \\\n                         \"programmers_guide/gameplay.md\" \\\n                         \"programmers_guide/google_api.md\" \\\n                         \"programmers_guide/mission.md\" \\\n                         \"programmers_guide/overview.md\" \\\n                         \"../../readme.md\" \\\n                         \"../../src\"\n\n# This tag can be used to specify the character encoding of the source files\n# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses\n# libiconv (or the iconv built into libc) for the transcoding. See the libiconv\n# documentation (see: http://www.gnu.org/software/libiconv) for the list of\n# possible encodings.\n# The default value is: UTF-8.\n\nINPUT_ENCODING         = UTF-8\n\n# If the value of the INPUT tag contains directories, you can use the\n# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and\n# *.h) to filter out the source-files in the directories. If left blank the\n# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,\n# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,\n# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,\n# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,\n# *.qsf, *.as and *.js.\n\nFILE_PATTERNS          = *.c \\\n                         *.cc \\\n                         *.cxx \\\n                         *.cpp \\\n                         *.c++ \\\n                         *.java \\\n                         *.ii \\\n                         *.ixx \\\n                         *.ipp \\\n                         *.i++ \\\n                         *.inl \\\n                         *.idl \\\n                         *.ddl \\\n                         *.odl \\\n                         *.h \\\n                         *.hh \\\n                         *.hxx \\\n                         *.hpp \\\n                         *.h++ \\\n                         *.cs \\\n                         *.d \\\n                         *.php \\\n                         *.php4 \\\n                         *.php5 \\\n                         *.phtml \\\n                         *.inc \\\n                         *.m \\\n                         *.markdown \\\n                         *.md \\\n                         *.mm \\\n                         *.dox \\\n                         *.py \\\n                         *.f90 \\\n                         *.f \\\n                         *.for \\\n                         *.tcl \\\n                         *.vhd \\\n                         *.vhdl \\\n                         *.ucf \\\n                         *.qsf \\\n                         *.as \\\n                         *.js\n\n# The RECURSIVE tag can be used to specify whether or not subdirectories should\n# be searched for input files as well.\n# The default value is: NO.\n\nRECURSIVE              = YES\n\n# The EXCLUDE tag can be used to specify files and/or directories that should be\n# excluded from the INPUT source files. This way you can easily exclude a\n# subdirectory from a directory tree whose root is specified with the INPUT tag.\n#\n# Note that relative paths are relative to the directory from which doxygen is\n# run.\n\nEXCLUDE                =\n\n# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or\n# directories that are symbolic links (a Unix file system feature) are excluded\n# from the input.\n# The default value is: NO.\n\nEXCLUDE_SYMLINKS       = NO\n\n# If the value of the INPUT tag contains directories, you can use the\n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude\n# certain files from those directories.\n#\n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       =\n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names\n# (namespaces, classes, functions, etc.) that should be excluded from the\n# output. The symbol name can be a fully qualified name, a word, or if the\n# wildcard * is used, a substring. Examples: ANamespace, AClass,\n# AClass::ANamespace, ANamespace::*Test\n#\n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories use the pattern */test/*\n\nEXCLUDE_SYMBOLS        =\n\n# The EXAMPLE_PATH tag can be used to specify one or more files or directories\n# that contain example code fragments that are included (see the \\include\n# command).\n\nEXAMPLE_PATH           =\n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the\n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and\n# *.h) to filter out the source-files in the directories. If left blank all\n# files are included.\n\nEXAMPLE_PATTERNS       =\n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be\n# searched for input files to be used with the \\include or \\dontinclude commands\n# irrespective of the value of the RECURSIVE tag.\n# The default value is: NO.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or directories\n# that contain images that are to be included in the documentation (see the\n# \\image command).\n\nIMAGE_PATH             =\n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should\n# invoke to filter for each input file. Doxygen will invoke the filter program\n# by executing (via popen()) the command:\n#\n# <filter> <input-file>\n#\n# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the\n# name of an input file. Doxygen will then use the output that the filter\n# program writes to standard output. If FILTER_PATTERNS is specified, this tag\n# will be ignored.\n#\n# Note that the filter must not add or remove lines; it is applied before the\n# code is scanned, but not when the output code is generated. If lines are added\n# or removed, the anchors will not be placed correctly.\n\nINPUT_FILTER           =\n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern\n# basis. Doxygen will compare the file name with each pattern and apply the\n# filter if there is a match. The filters are a list of the form: pattern=filter\n# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how\n# filters are used. If the FILTER_PATTERNS tag is empty or if none of the\n# patterns match the file name, INPUT_FILTER is applied.\n\nFILTER_PATTERNS        =\n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using\n# INPUT_FILTER ) will also be used to filter the input files that are used for\n# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).\n# The default value is: NO.\n\nFILTER_SOURCE_FILES    = NO\n\n# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file\n# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and\n# it is also possible to disable source filtering for a specific pattern using\n# *.ext= (so without naming a filter).\n# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.\n\nFILTER_SOURCE_PATTERNS =\n\n# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that\n# is part of the input, its contents will be placed on the main page\n# (index.html). This can be useful if you have a project on for instance GitHub\n# and want to reuse the introduction page also for the doxygen output.\n\nUSE_MDFILE_AS_MAINPAGE = index.md\n\n#---------------------------------------------------------------------------\n# Configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will be\n# generated. Documented entities will be cross-referenced with these sources.\n#\n# Note: To get rid of all source code in the generated output, make sure that\n# also VERBATIM_HEADERS is set to NO.\n# The default value is: NO.\n\nSOURCE_BROWSER         = NO\n\n# Setting the INLINE_SOURCES tag to YES will include the body of functions,\n# classes and enums directly into the documentation.\n# The default value is: NO.\n\nINLINE_SOURCES         = NO\n\n# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any\n# special comment blocks from generated source code fragments. Normal C, C++ and\n# Fortran comments will always remain visible.\n# The default value is: YES.\n\nSTRIP_CODE_COMMENTS    = NO\n\n# If the REFERENCED_BY_RELATION tag is set to YES then for each documented\n# function all documented functions referencing it will be listed.\n# The default value is: NO.\n\nREFERENCED_BY_RELATION = NO\n\n# If the REFERENCES_RELATION tag is set to YES then for each documented function\n# all documented entities called/used by that function will be listed.\n# The default value is: NO.\n\nREFERENCES_RELATION    = NO\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set\n# to YES, then the hyperlinks from functions in REFERENCES_RELATION and\n# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will\n# link to the documentation.\n# The default value is: YES.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the\n# source code will show a tooltip with additional information such as prototype,\n# brief description and links to the definition and documentation. Since this\n# will make the HTML file larger and loading of large files a bit slower, you\n# can opt to disable this feature.\n# The default value is: YES.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nSOURCE_TOOLTIPS        = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code will\n# point to the HTML generated by the htags(1) tool instead of doxygen built-in\n# source browser. The htags tool is part of GNU's global source tagging system\n# (see http://www.gnu.org/software/global/global.html). You will need version\n# 4.8.6 or higher.\n#\n# To use it do the following:\n# - Install the latest version of global\n# - Enable SOURCE_BROWSER and USE_HTAGS in the config file\n# - Make sure the INPUT points to the root of the source tree\n# - Run doxygen as normal\n#\n# Doxygen will invoke htags (and that will in turn invoke gtags), so these\n# tools must be available from the command line (i.e. in the search path).\n#\n# The result: instead of the source browser generated by doxygen, the links to\n# source code will now point to the output of htags.\n# The default value is: NO.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a\n# verbatim copy of the header file for each class for which an include is\n# specified. Set to NO to disable this.\n# See also: Section \\class.\n# The default value is: YES.\n\nVERBATIM_HEADERS       = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all\n# compounds will be generated. Enable this if the project contains a lot of\n# classes, structs, unions or interfaces.\n# The default value is: YES.\n\nALPHABETICAL_INDEX     = YES\n\n# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in\n# which the alphabetical index list will be split.\n# Minimum value: 1, maximum value: 20, default value: 5.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nCOLS_IN_ALPHA_INDEX    = 5\n\n# In case all classes in a project start with a common prefix, all classes will\n# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag\n# can be used to specify a prefix (or a list of prefixes) that should be ignored\n# while generating the index headers.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nIGNORE_PREFIX          =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output\n# The default value is: YES.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_OUTPUT            = html\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each\n# generated HTML page (for example: .htm, .php, .asp).\n# The default value is: .html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FILE_EXTENSION    = .html\n\n# The HTML_HEADER tag can be used to specify a user-defined HTML header file for\n# each generated HTML page. If the tag is left blank doxygen will generate a\n# standard header.\n#\n# To get valid HTML the header file that includes any scripts and style sheets\n# that doxygen needs, which is dependent on the configuration options used (e.g.\n# the setting GENERATE_TREEVIEW). It is highly recommended to start with a\n# default header using\n# doxygen -w html new_header.html new_footer.html new_stylesheet.css\n# YourConfigFile\n# and then modify the file new_header.html. See also section \"Doxygen usage\"\n# for information on how to generate the default header that doxygen normally\n# uses.\n# Note: The header is subject to change so you typically have to regenerate the\n# default header when upgrading to a newer version of doxygen. For a description\n# of the possible markers and block names see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_HEADER            =\n\n# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each\n# generated HTML page. If the tag is left blank doxygen will generate a standard\n# footer. See HTML_HEADER for more information on how to generate a default\n# footer and what special commands can be used inside the footer. See also\n# section \"Doxygen usage\" for information on how to generate the default footer\n# that doxygen normally uses.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FOOTER            =\n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style\n# sheet that is used by each HTML page. It can be used to fine-tune the look of\n# the HTML output. If left blank doxygen will generate a default style sheet.\n# See also section \"Doxygen usage\" for information on how to generate the style\n# sheet that doxygen normally uses.\n# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as\n# it is more robust and this tag (HTML_STYLESHEET) will in the future become\n# obsolete.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_STYLESHEET        =\n\n# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-\n# defined cascading style sheet that is included after the standard style sheets\n# created by doxygen. Using this option one can overrule certain style aspects.\n# This is preferred over using HTML_STYLESHEET since it does not replace the\n# standard style sheet and is therefor more robust against future updates.\n# Doxygen will copy the style sheet file to the output directory. For an example\n# see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_STYLESHEET  =\n\n# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the HTML output directory. Note\n# that these files will be copied to the base HTML output directory. Use the\n# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these\n# files. In the HTML_STYLESHEET file, use the file name only. Also note that the\n# files will be copied as-is; there are no commands or markers available.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_FILES       = \"programmers_guide/change_config.png\"\n\n# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen\n# will adjust the colors in the stylesheet and background images according to\n# this color. Hue is specified as an angle on a colorwheel, see\n# http://en.wikipedia.org/wiki/Hue for more information. For instance the value\n# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300\n# purple, and 360 is red again.\n# Minimum value: 0, maximum value: 359, default value: 220.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_HUE    = 220\n\n# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors\n# in the HTML output. For a value of 0 the output will use grayscales only. A\n# value of 255 will produce the most vivid colors.\n# Minimum value: 0, maximum value: 255, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_SAT    = 100\n\n# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the\n# luminance component of the colors in the HTML output. Values below 100\n# gradually make the output lighter, whereas values above 100 make the output\n# darker. The value divided by 100 is the actual gamma applied, so 80 represents\n# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not\n# change the gamma.\n# Minimum value: 40, maximum value: 240, default value: 80.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_GAMMA  = 80\n\n# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML\n# page will contain the date and time when the page was generated. Setting this\n# to NO can help when comparing the output of multiple runs.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_TIMESTAMP         = YES\n\n# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML\n# documentation will contain sections that can be hidden and shown after the\n# page has loaded.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_DYNAMIC_SECTIONS  = NO\n\n# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries\n# shown in the various tree structured indices initially; the user can expand\n# and collapse entries dynamically later on. Doxygen will expand the tree to\n# such a level that at most the specified number of entries are visible (unless\n# a fully collapsed tree already exceeds this amount). So setting the number of\n# entries 1 will produce a full collapsed tree by default. 0 is a special value\n# representing an infinite number of entries and will result in a full expanded\n# tree by default.\n# Minimum value: 0, maximum value: 9999, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_INDEX_NUM_ENTRIES = 100\n\n# If the GENERATE_DOCSET tag is set to YES, additional index files will be\n# generated that can be used as input for Apple's Xcode 3 integrated development\n# environment (see: http://developer.apple.com/tools/xcode/), introduced with\n# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a\n# Makefile in the HTML output directory. Running make will produce the docset in\n# that directory and running make install will install the docset in\n# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at\n# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html\n# for more information.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_DOCSET        = NO\n\n# This tag determines the name of the docset feed. A documentation feed provides\n# an umbrella under which multiple documentation sets from a single provider\n# (such as a company or product suite) can be grouped.\n# The default value is: Doxygen generated docs.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_FEEDNAME        = \"Doxygen generated docs\"\n\n# This tag specifies a string that should uniquely identify the documentation\n# set bundle. This should be a reverse domain-name style string, e.g.\n# com.mycompany.MyDocSet. Doxygen will append .docset to the name.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_BUNDLE_ID       = org.doxygen.Project\n\n# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify\n# the documentation publisher. This should be a reverse domain-name style\n# string, e.g. com.mycompany.MyDocSet.documentation.\n# The default value is: org.doxygen.Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_ID    = org.doxygen.Publisher\n\n# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.\n# The default value is: Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_NAME  = Publisher\n\n# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three\n# additional HTML index files: index.hhp, index.hhc, and index.hhk. The\n# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop\n# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on\n# Windows.\n#\n# The HTML Help Workshop contains a compiler that can convert all HTML output\n# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML\n# files are now used as the Windows 98 help format, and will replace the old\n# Windows help format (.hlp) on all Windows platforms in the future. Compressed\n# HTML files also contain an index, a table of contents, and you can search for\n# words in the documentation. The HTML workshop also contains a viewer for\n# compressed HTML files.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_HTMLHELP      = NO\n\n# The CHM_FILE tag can be used to specify the file name of the resulting .chm\n# file. You can add a path in front of the file if the result should not be\n# written to the html output directory.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_FILE               =\n\n# The HHC_LOCATION tag can be used to specify the location (absolute path\n# including file name) of the HTML help compiler ( hhc.exe). If non-empty\n# doxygen will try to run the HTML help compiler on the generated index.hhp.\n# The file has to be specified with full path.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nHHC_LOCATION           =\n\n# The GENERATE_CHI flag controls if a separate .chi index file is generated (\n# YES) or that it should be included in the master .chm file ( NO).\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nGENERATE_CHI           = NO\n\n# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)\n# and project file content.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_INDEX_ENCODING     =\n\n# The BINARY_TOC flag controls whether a binary table of contents is generated (\n# YES) or a normal table of contents ( NO) in the .chm file.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nBINARY_TOC             = NO\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members to\n# the table of contents of the HTML help documentation and to the tree view.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nTOC_EXPAND             = NO\n\n# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and\n# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that\n# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help\n# (.qch) of the generated HTML documentation.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_QHP           = NO\n\n# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify\n# the file name of the resulting .qch file. The path specified is relative to\n# the HTML output folder.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQCH_FILE               =\n\n# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help\n# Project output. For more information please see Qt Help Project / Namespace\n# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_NAMESPACE          = org.doxygen.Project\n\n# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt\n# Help Project output. For more information please see Qt Help Project / Virtual\n# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-\n# folders).\n# The default value is: doc.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_VIRTUAL_FOLDER     = doc\n\n# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom\n# filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_NAME   =\n\n# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the\n# custom filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_ATTRS  =\n\n# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this\n# project's filter section matches. Qt Help Project / Filter Attributes (see:\n# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_SECT_FILTER_ATTRS  =\n\n# The QHG_LOCATION tag can be used to specify the location of Qt's\n# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the\n# generated .qhp file.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHG_LOCATION           =\n\n# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be\n# generated, together with the HTML files, they form an Eclipse help plugin. To\n# install this plugin and make it available under the help contents menu in\n# Eclipse, the contents of the directory containing the HTML and XML files needs\n# to be copied into the plugins directory of eclipse. The name of the directory\n# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.\n# After copying Eclipse needs to be restarted before the help appears.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_ECLIPSEHELP   = NO\n\n# A unique identifier for the Eclipse help plugin. When installing the plugin\n# the directory name containing the HTML and XML files should also have this\n# name. Each documentation set should have its own identifier.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.\n\nECLIPSE_DOC_ID         = org.doxygen.Project\n\n# If you want full control over the layout of the generated HTML pages it might\n# be necessary to disable the index and replace it with your own. The\n# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top\n# of each HTML page. A value of NO enables the index and the value YES disables\n# it. Since the tabs in the index contain the same information as the navigation\n# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nDISABLE_INDEX          = NO\n\n# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index\n# structure should be generated to display hierarchical information. If the tag\n# value is set to YES, a side panel will be generated containing a tree-like\n# index structure (just like the one that is generated for HTML Help). For this\n# to work a browser that supports JavaScript, DHTML, CSS and frames is required\n# (i.e. any modern browser). Windows users are probably better off using the\n# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can\n# further fine-tune the look of the index. As an example, the default style\n# sheet generated by doxygen has an example that shows how to put an image at\n# the root of the tree instead of the PROJECT_NAME. Since the tree basically has\n# the same information as the tab index, you could consider setting\n# DISABLE_INDEX to YES when enabling this option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_TREEVIEW      = YES\n\n# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that\n# doxygen will group on one line in the generated HTML documentation.\n#\n# Note that a value of 0 will completely suppress the enum values from appearing\n# in the overview section.\n# Minimum value: 0, maximum value: 20, default value: 4.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used\n# to set the initial width (in pixels) of the frame in which the tree is shown.\n# Minimum value: 0, maximum value: 1500, default value: 250.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nTREEVIEW_WIDTH         = 250\n\n# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to\n# external symbols imported via tag files in a separate window.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nEXT_LINKS_IN_WINDOW    = NO\n\n# Use this tag to change the font size of LaTeX formulas included as images in\n# the HTML documentation. When you change the font size after a successful\n# doxygen run you need to manually remove any form_*.png images from the HTML\n# output directory to force them to be regenerated.\n# Minimum value: 8, maximum value: 50, default value: 10.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_FONTSIZE       = 10\n\n# Use the FORMULA_TRANPARENT tag to determine whether or not the images\n# generated for formulas are transparent PNGs. Transparent PNGs are not\n# supported properly for IE 6.0, but are supported on all modern browsers.\n#\n# Note that when changing this option you need to delete any form_*.png files in\n# the HTML output directory before the changes have effect.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_TRANSPARENT    = YES\n\n# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see\n# http://www.mathjax.org) which uses client side Javascript for the rendering\n# instead of using prerendered bitmaps. Use this if you do not have LaTeX\n# installed or if you want to formulas look prettier in the HTML output. When\n# enabled you may also need to install MathJax separately and configure the path\n# to it using the MATHJAX_RELPATH option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nUSE_MATHJAX            = NO\n\n# When MathJax is enabled you can set the default output format to be used for\n# the MathJax output. See the MathJax site (see:\n# http://docs.mathjax.org/en/latest/output.html) for more details.\n# Possible values are: HTML-CSS (which is slower, but has the best\n# compatibility), NativeMML (i.e. MathML) and SVG.\n# The default value is: HTML-CSS.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_FORMAT         = HTML-CSS\n\n# When MathJax is enabled you need to specify the location relative to the HTML\n# output directory using the MATHJAX_RELPATH option. The destination directory\n# should contain the MathJax.js script. For instance, if the mathjax directory\n# is located at the same level as the HTML output directory, then\n# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax\n# Content Delivery Network so you can quickly see the result without installing\n# MathJax. However, it is strongly recommended to install a local copy of\n# MathJax from http://www.mathjax.org before deployment.\n# The default value is: http://cdn.mathjax.org/mathjax/latest.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest\n\n# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax\n# extension names that should be enabled during MathJax rendering. For example\n# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_EXTENSIONS     =\n\n# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces\n# of code that will be used on startup of the MathJax code. See the MathJax site\n# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an\n# example see the documentation.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_CODEFILE       =\n\n# When the SEARCHENGINE tag is enabled doxygen will generate a search box for\n# the HTML output. The underlying search engine uses javascript and DHTML and\n# should work on any modern browser. Note that when using HTML help\n# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)\n# there is already a search function so this one should typically be disabled.\n# For large projects the javascript based search engine can be slow, then\n# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to\n# search using the keyboard; to jump to the search box use <access key> + S\n# (what the <access key> is depends on the OS and browser, but it is typically\n# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down\n# key> to jump into the search results window, the results can be navigated\n# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel\n# the search. The filter options can be selected when the cursor is inside the\n# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>\n# to select a filter and <Enter> or <escape> to activate or cancel the filter\n# option.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nSEARCHENGINE           = YES\n\n# When the SERVER_BASED_SEARCH tag is enabled the search engine will be\n# implemented using a web server instead of a web client using Javascript. There\n# are two flavours of web server based searching depending on the\n# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for\n# searching and an index file used by the script. When EXTERNAL_SEARCH is\n# enabled the indexing and searching needs to be provided by external tools. See\n# the section \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSERVER_BASED_SEARCH    = NO\n\n# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP\n# script for searching. Instead the search results are written to an XML file\n# which needs to be processed by an external indexer. Doxygen will invoke an\n# external search engine pointed to by the SEARCHENGINE_URL option to obtain the\n# search results.\n#\n# Doxygen ships with an example indexer ( doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: http://xapian.org/).\n#\n# See the section \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH        = NO\n\n# The SEARCHENGINE_URL should point to a search engine hosted by a web server\n# which will return the search results when EXTERNAL_SEARCH is enabled.\n#\n# Doxygen ships with an example indexer ( doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: http://xapian.org/). See the section \"External Indexing and\n# Searching\" for details.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHENGINE_URL       =\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed\n# search data is written to a file for indexing by an external tool. With the\n# SEARCHDATA_FILE tag the name of this file can be specified.\n# The default file is: searchdata.xml.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHDATA_FILE        = searchdata.xml\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the\n# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is\n# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple\n# projects and redirect the results back to the right project.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH_ID     =\n\n# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen\n# projects other than the one defined by this configuration file, but that are\n# all added to the same external search index. Each project needs to have a\n# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of\n# to a relative location where the documentation can be found. The format is:\n# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTRA_SEARCH_MAPPINGS  =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.\n# The default value is: YES.\n\nGENERATE_LATEX         = NO\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: latex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be\n# invoked.\n#\n# Note that when enabling USE_PDFLATEX this option is only used for generating\n# bitmaps for formulas in the HTML output, but not in the Makefile that is\n# written to the output directory.\n# The default file is: latex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_CMD_NAME         = latex\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate\n# index for LaTeX.\n# The default file is: makeindex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used by the\n# printer.\n# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x\n# 14 inches) and executive (7.25 x 10.5 inches).\n# The default value is: a4.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPAPER_TYPE             = a4\n\n# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names\n# that should be included in the LaTeX output. To get the times font for\n# instance you can specify\n# EXTRA_PACKAGES=times\n# If left blank no extra packages will be included.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nEXTRA_PACKAGES         =\n\n# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the\n# generated LaTeX document. The header should contain everything until the first\n# chapter. If it is left blank doxygen will generate a standard header. See\n# section \"Doxygen usage\" for information on how to let doxygen write the\n# default header to a separate file.\n#\n# Note: Only use a user-defined header if you know what you are doing! The\n# following commands have a special meaning inside the header: $title,\n# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will\n# replace them by respectively the title of the page, the current date and time,\n# only the current date, the version number of doxygen, the project name (see\n# PROJECT_NAME), or the project number (see PROJECT_NUMBER).\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HEADER           =\n\n# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the\n# generated LaTeX document. The footer should contain everything after the last\n# chapter. If it is left blank doxygen will generate a standard footer.\n#\n# Note: Only use a user-defined footer if you know what you are doing!\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_FOOTER           =\n\n# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the LATEX_OUTPUT output\n# directory. Note that the files will be copied as-is; there are no commands or\n# markers available.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EXTRA_FILES      =\n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is\n# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will\n# contain links (just like the HTML output) instead of page references. This\n# makes the output suitable for online browsing using a PDF viewer.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPDF_HYPERLINKS         = YES\n\n# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate\n# the PDF file directly from the LaTeX files. Set this option to YES to get a\n# higher quality PDF documentation.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nUSE_PDFLATEX           = YES\n\n# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode\n# command to the generated LaTeX files. This will instruct LaTeX to keep running\n# if errors occur, instead of asking the user for help. This option is also used\n# when generating formulas in HTML.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BATCHMODE        = NO\n\n# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the\n# index chapters (such as File Index, Compound Index, etc.) in the output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HIDE_INDICES     = NO\n\n# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source\n# code with syntax highlighting in the LaTeX output.\n#\n# Note that which sources are shown also depends on other settings such as\n# SOURCE_BROWSER.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_SOURCE_CODE      = NO\n\n# The LATEX_BIB_STYLE tag can be used to specify the style to use for the\n# bibliography, e.g. plainnat, or ieeetr. See\n# http://en.wikipedia.org/wiki/BibTeX and \\cite for more info.\n# The default value is: plain.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BIB_STYLE        = plain\n\n#---------------------------------------------------------------------------\n# Configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The\n# RTF output is optimized for Word 97 and may not look too pretty with other RTF\n# readers/editors.\n# The default value is: NO.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: rtf.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will\n# contain hyperlink fields. The RTF file will contain links (just like the HTML\n# output) instead of page references. This makes the output suitable for online\n# browsing using Word or some other Word compatible readers that support those\n# fields.\n#\n# Note: WordPad (write) and others do not support links.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_HYPERLINKS         = NO\n\n# Load stylesheet definitions from file. Syntax is similar to doxygen's config\n# file, i.e. a series of assignments. You only have to provide replacements,\n# missing definitions are set to their default value.\n#\n# See also section \"Doxygen usage\" for information on how to generate the\n# default style sheet that doxygen normally uses.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_STYLESHEET_FILE    =\n\n# Set optional variables used in the generation of an RTF document. Syntax is\n# similar to doxygen's config file. A template extensions file can be generated\n# using doxygen -e rtf extensionFile.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_EXTENSIONS_FILE    =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for\n# classes and files.\n# The default value is: NO.\n\nGENERATE_MAN           = NO\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it. A directory man3 will be created inside the directory specified by\n# MAN_OUTPUT.\n# The default directory is: man.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to the generated\n# man pages. In case the manual section does not start with a number, the number\n# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is\n# optional.\n# The default value is: .3.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_EXTENSION          = .3\n\n# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it\n# will generate one additional man file for each entity documented in the real\n# man page(s). These additional files only source the real man page, but without\n# them the man command would be unable to find the correct page.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that\n# captures the structure of the code including all documentation.\n# The default value is: NO.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: xml.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_OUTPUT             = xml\n\n# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program\n# listings (including syntax highlighting and cross-referencing information) to\n# the XML output. Note that enabling this will significantly increase the size\n# of the XML output.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_PROGRAMLISTING     = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to the DOCBOOK output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files\n# that can be used to generate PDF.\n# The default value is: NO.\n\nGENERATE_DOCBOOK       = NO\n\n# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.\n# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in\n# front of it.\n# The default directory is: docbook.\n# This tag requires that the tag GENERATE_DOCBOOK is set to YES.\n\nDOCBOOK_OUTPUT         = docbook\n\n#---------------------------------------------------------------------------\n# Configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen\n# Definitions (see http://autogen.sf.net) file that captures the structure of\n# the code including all documentation. Note that this feature is still\n# experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module\n# file that captures the structure of the code including all documentation.\n#\n# Note that this feature is still experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary\n# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI\n# output from the Perl module output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely\n# formatted so it can be parsed by a human reader. This is useful if you want to\n# understand what is going on. On the other hand, if this tag is set to NO the\n# size of the Perl module output will be much smaller and Perl will parse it\n# just the same.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file are\n# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful\n# so different doxyrules.make files included by the same Makefile don't\n# overwrite each other's variables.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_MAKEVAR_PREFIX =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor\n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all\n# C-preprocessor directives found in the sources and include files.\n# The default value is: YES.\n\nENABLE_PREPROCESSING   = YES\n\n# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names\n# in the source code. If set to NO only conditional compilation will be\n# performed. Macro expansion can be done in a controlled way by setting\n# EXPAND_ONLY_PREDEF to YES.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nMACRO_EXPANSION        = YES\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then\n# the macro expansion is limited to the macros specified with the PREDEFINED and\n# EXPAND_AS_DEFINED tags.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_ONLY_PREDEF     = YES\n\n# If the SEARCH_INCLUDES tag is set to YES the includes files in the\n# INCLUDE_PATH will be searched if a #include is found.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that\n# contain include files that are not input files but should be processed by the\n# preprocessor.\n# This tag requires that the tag SEARCH_INCLUDES is set to YES.\n\nINCLUDE_PATH           =\n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard\n# patterns (like *.h and *.hpp) to filter out the header-files in the\n# directories. If left blank, the patterns specified with FILE_PATTERNS will be\n# used.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nINCLUDE_FILE_PATTERNS  =\n\n# The PREDEFINED tag can be used to specify one or more macro names that are\n# defined before the preprocessor is started (similar to the -D option of e.g.\n# gcc). The argument of the tag is a list of macros of the form: name or\n# name=definition (no spaces). If the definition and the \"=\" are omitted, \"=1\"\n# is assumed. To prevent a macro definition from being undefined via #undef or\n# recursively expanded use the := operator instead of the = operator.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nPREDEFINED             =\n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this\n# tag can be used to specify a list of macro names that should be expanded. The\n# macro definition that is found in the sources will be used. Use the PREDEFINED\n# tag if you want to use a different macro definition that overrules the\n# definition found in the source code.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_AS_DEFINED      =\n\n# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will\n# remove all refrences to function-like macros that are alone on a line, have an\n# all uppercase name, and do not end with a semicolon. Such function macros are\n# typically used for boiler-plate code, and will confuse the parser if not\n# removed.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSKIP_FUNCTION_MACROS   = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to external references\n#---------------------------------------------------------------------------\n\n# The TAGFILES tag can be used to specify one or more tag files. For each tag\n# file the location of the external documentation should be added. The format of\n# a tag file without this location is as follows:\n# TAGFILES = file1 file2 ...\n# Adding location for the tag files is done as follows:\n# TAGFILES = file1=loc1 \"file2 = loc2\" ...\n# where loc1 and loc2 can be relative or absolute paths or URLs. See the\n# section \"Linking to external documentation\" for more information about the use\n# of tag files.\n# Note: Each tag file must have an unique name (where the name does NOT include\n# the path). If a tag file is not located in the directory in which doxygen is\n# run, you must also specify the path to the tagfile here.\n\nTAGFILES               =\n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create a\n# tag file that is based on the input files it reads. See section \"Linking to\n# external documentation\" for more information about the usage of tag files.\n\nGENERATE_TAGFILE       =\n\n# If the ALLEXTERNALS tag is set to YES all external class will be listed in the\n# class index. If set to NO only the inherited external classes will be listed.\n# The default value is: NO.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in\n# the modules index. If set to NO, only the current project's groups will be\n# listed.\n# The default value is: YES.\n\nEXTERNAL_GROUPS        = NO\n\n# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in\n# the related pages index. If set to NO, only the current project's pages will\n# be listed.\n# The default value is: YES.\n\nEXTERNAL_PAGES         = YES\n\n# The PERL_PATH should be the absolute path and name of the perl script\n# interpreter (i.e. the result of 'which perl').\n# The default file (with absolute path) is: /usr/bin/perl.\n\nPERL_PATH              = /usr/bin/perl\n\n#---------------------------------------------------------------------------\n# Configuration options related to the dot tool\n#---------------------------------------------------------------------------\n\n# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram\n# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to\n# NO turns the diagrams off. Note that this option also works with HAVE_DOT\n# disabled, but it is recommended to install and use dot, since it yields more\n# powerful graphs.\n# The default value is: YES.\n\nCLASS_DIAGRAMS         = YES\n\n# You can define message sequence charts within doxygen comments using the \\msc\n# command. Doxygen will then run the mscgen tool (see:\n# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the\n# documentation. The MSCGEN_PATH tag allows you to specify the directory where\n# the mscgen tool resides. If left empty the tool is assumed to be found in the\n# default search path.\n\nMSCGEN_PATH            =\n\n# If set to YES, the inheritance and collaboration graphs will hide inheritance\n# and usage relations if the target is undocumented or is not a class.\n# The default value is: YES.\n\nHIDE_UNDOC_RELATIONS   = YES\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is\n# available from the path. This tool is part of Graphviz (see:\n# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent\n# Bell Labs. The other options in this section have no effect if this option is\n# set to NO\n# The default value is: NO.\n\nHAVE_DOT               = NO\n\n# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed\n# to run in parallel. When set to 0 doxygen will base this on the number of\n# processors available in the system. You can set it explicitly to a value\n# larger than 0 to get control over the balance between CPU load and processing\n# speed.\n# Minimum value: 0, maximum value: 32, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_NUM_THREADS        = 0\n\n# When you want a differently looking font n the dot files that doxygen\n# generates you can specify the font name using DOT_FONTNAME. You need to make\n# sure dot is able to find the font, which can be done by putting it in a\n# standard location or by setting the DOTFONTPATH environment variable or by\n# setting DOT_FONTPATH to the directory containing the font.\n# The default value is: Helvetica.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTNAME           = Helvetica\n\n# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of\n# dot graphs.\n# Minimum value: 4, maximum value: 24, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTSIZE           = 10\n\n# By default doxygen will tell dot to use the default font as specified with\n# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set\n# the path where dot can find it using this tag.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTPATH           =\n\n# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for\n# each documented class showing the direct and indirect inheritance relations.\n# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a\n# graph for each documented class showing the direct and indirect implementation\n# dependencies (inheritance, containment, and class references variables) of the\n# class with other documented classes.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCOLLABORATION_GRAPH    = YES\n\n# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for\n# groups, showing the direct groups dependencies.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES doxygen will generate inheritance and\n# collaboration diagrams in a style similar to the OMG's Unified Modeling\n# Language.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LOOK               = NO\n\n# If the UML_LOOK tag is enabled, the fields and methods are shown inside the\n# class node. If there are many fields or methods and many nodes the graph may\n# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the\n# number of items for each type to make the size more manageable. Set this to 0\n# for no limit. Note that the threshold may be exceeded by 50% before the limit\n# is enforced. So when you set the threshold to 10, up to 15 fields may appear,\n# but if the number exceeds 15, the total amount of fields shown is limited to\n# 10.\n# Minimum value: 0, maximum value: 100, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LIMIT_NUM_FIELDS   = 10\n\n# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and\n# collaboration graphs will show the relations between templates and their\n# instances.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nTEMPLATE_RELATIONS     = NO\n\n# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to\n# YES then doxygen will generate a graph for each documented file showing the\n# direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDE_GRAPH          = YES\n\n# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are\n# set to YES then doxygen will generate a graph for each documented file showing\n# the direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH tag is set to YES then doxygen will generate a call\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable call graphs for selected\n# functions only using the \\callgraph command.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALL_GRAPH             = NO\n\n# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable caller graphs for selected\n# functions only using the \\callergraph command.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALLER_GRAPH           = NO\n\n# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical\n# hierarchy of all classes instead of a textual one.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the\n# dependencies a directory has on other directories in a graphical way. The\n# dependency relations are determined by the #include relations between the\n# files in the directories.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDIRECTORY_GRAPH        = YES\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images\n# generated by dot.\n# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order\n# to make the SVG files visible in IE 9+ (other browsers do not have this\n# requirement).\n# Possible values are: png, jpg, gif and svg.\n# The default value is: png.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_IMAGE_FORMAT       = png\n\n# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to\n# enable generation of interactive SVG images that allow zooming and panning.\n#\n# Note that this requires a modern browser other than Internet Explorer. Tested\n# and working are Firefox, Chrome, Safari, and Opera.\n# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make\n# the SVG files visible. Older versions of IE do not have SVG support.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINTERACTIVE_SVG        = NO\n\n# The DOT_PATH tag can be used to specify the path where the dot tool can be\n# found. If left blank, it is assumed the dot tool can be found in the path.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_PATH               =\n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that\n# contain dot files that are included in the documentation (see the \\dotfile\n# command).\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOTFILE_DIRS           =\n\n# The MSCFILE_DIRS tag can be used to specify one or more directories that\n# contain msc files that are included in the documentation (see the \\mscfile\n# command).\n\nMSCFILE_DIRS           =\n\n# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes\n# that will be shown in the graph. If the number of nodes in a graph becomes\n# larger than this value, doxygen will truncate the graph, which is visualized\n# by representing a node as a red box. Note that doxygen if the number of direct\n# children of the root node in a graph is already larger than\n# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that\n# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n# Minimum value: 0, maximum value: 10000, default value: 50.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs\n# generated by dot. A depth value of 3 means that only nodes reachable from the\n# root by following a path via at most 3 edges will be shown. Nodes that lay\n# further from the root node will be omitted. Note that setting this option to 1\n# or 2 may greatly reduce the computation time needed for large code bases. Also\n# note that the size of a graph can be further restricted by\n# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n# Minimum value: 0, maximum value: 1000, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nMAX_DOT_GRAPH_DEPTH    = 0\n\n# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent\n# background. This is disabled by default, because dot on Windows does not seem\n# to support this out of the box.\n#\n# Warning: Depending on the platform used, enabling this option may lead to\n# badly anti-aliased labels on the edges of a graph (i.e. they become hard to\n# read).\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_TRANSPARENT        = NO\n\n# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output\n# files in one run (i.e. multiple -o and -T options on the command line). This\n# makes dot run faster, but since only newer versions of dot (>1.8.10) support\n# this, this feature is disabled by default.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_MULTI_TARGETS      = NO\n\n# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page\n# explaining the meaning of the various boxes and arrows in the dot generated\n# graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot\n# files that are used to generate the various graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_CLEANUP            = YES\n"
  },
  {
    "path": "docs/src/doxygen_layout.xml",
    "content": "<!-- Copyright 2015 Google Inc. All rights reserved.\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n\n          http://www.apache.org/licenses/LICENSE-2.0\n\n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n -->\n<doxygenlayout version=\"1.0\">\n  <navindex>\n    <tab type=\"mainpage\" visible=\"no\" title=\"\"/>\n    <tab type=\"user\" url=\"@ref games_in_motion_guide_gameplay\" title=\"Gameplay\"/>\n    <tab type=\"usergroup\" url=\"@ref games_in_motion_guide_overview\"\n         title=\"Programmer's Guide\">\n      <tab type=\"usergroup\" url=\"@ref games_in_motion_guide_building\"\n           title=\"Building\"/>\n      <tab type=\"user\" url=\"@ref games_in_motion_guide_assets\"\n           title=\"Modifying Assets\"/>\n      <tab type=\"usergroup\" title=\"Components\">\n        <tab type=\"user\" url=\"@ref games_in_motion_guide_core\"\n             title=\"Core and GUI\"/>\n        <tab type=\"user\" url=\"@ref games_in_motion_guide_mission\"\n             title=\"Mission System\"/>\n        <tab type=\"user\" url=\"@ref games_in_motion_guide_google_api\"\n             title=\"Google Api\"/>\n        <tab type=\"user\" url=\"@ref games_in_motion_guide_audio\" title=\"Audio\"/>\n      </tab>\n    </tab>\n    <tab type=\"user\" url=\"@ref games_in_motion_readme\" title=\"Readme\"/>\n    <tab type=\"user\" url=\"@ref contributing\" title=\"Contributing\"/>\n  </navindex>\n\n  <!-- Layout definition for a class page -->\n  <class>\n    <briefdescription visible=\"yes\"/>\n    <includes visible=\"$SHOW_INCLUDE_FILES\"/>\n    <inheritancegraph visible=\"$CLASS_GRAPH\"/>\n    <collaborationgraph visible=\"$COLLABORATION_GRAPH\"/>\n    <detaileddescription title=\"\"/>\n    <memberdecl>\n      <nestedclasses visible=\"yes\" title=\"\"/>\n      <publictypes title=\"\"/>\n      <services title=\"\"/>\n      <interfaces title=\"\"/>\n      <publicslots title=\"\"/>\n      <signals title=\"\"/>\n      <publicmethods title=\"\"/>\n      <publicstaticmethods title=\"\"/>\n      <publicattributes title=\"\"/>\n      <publicstaticattributes title=\"\"/>\n      <protectedtypes title=\"\"/>\n      <protectedslots title=\"\"/>\n      <protectedmethods title=\"\"/>\n      <protectedstaticmethods title=\"\"/>\n      <protectedattributes title=\"\"/>\n      <protectedstaticattributes title=\"\"/>\n      <packagetypes title=\"\"/>\n      <packagemethods title=\"\"/>\n      <packagestaticmethods title=\"\"/>\n      <packageattributes title=\"\"/>\n      <packagestaticattributes title=\"\"/>\n      <properties title=\"\"/>\n      <events title=\"\"/>\n      <privatetypes title=\"\"/>\n      <privateslots title=\"\"/>\n      <privatemethods title=\"\"/>\n      <privatestaticmethods title=\"\"/>\n      <privateattributes title=\"\"/>\n      <privatestaticattributes title=\"\"/>\n      <friends title=\"\"/>\n      <related title=\"\" subtitle=\"\"/>\n      <membergroups visible=\"yes\"/>\n    </memberdecl>\n    <memberdef>\n      <inlineclasses title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <services title=\"\"/>\n      <interfaces title=\"\"/>\n      <constructors title=\"\"/>\n      <functions title=\"\"/>\n      <related title=\"\"/>\n      <variables title=\"\"/>\n      <properties title=\"\"/>\n      <events title=\"\"/>\n    </memberdef>\n    <allmemberslink visible=\"yes\"/>\n    <usedfiles visible=\"$SHOW_USED_FILES\"/>\n    <authorsection visible=\"yes\"/>\n  </class>\n\n  <!-- Layout definition for a namespace page -->\n  <namespace>\n    <briefdescription visible=\"yes\"/>\n    <memberdecl>\n      <nestednamespaces visible=\"yes\" title=\"\"/>\n      <constantgroups visible=\"yes\" title=\"\"/>\n      <classes visible=\"yes\" title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <functions title=\"\"/>\n      <variables title=\"\"/>\n      <membergroups visible=\"yes\"/>\n    </memberdecl>\n    <detaileddescription title=\"\"/>\n    <memberdef>\n      <inlineclasses title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <functions title=\"\"/>\n      <variables title=\"\"/>\n    </memberdef>\n    <authorsection visible=\"yes\"/>\n  </namespace>\n\n  <!-- Layout definition for a file page -->\n  <file>\n    <briefdescription visible=\"yes\"/>\n    <includes visible=\"$SHOW_INCLUDE_FILES\"/>\n    <includegraph visible=\"$INCLUDE_GRAPH\"/>\n    <includedbygraph visible=\"$INCLUDED_BY_GRAPH\"/>\n    <sourcelink visible=\"yes\"/>\n    <detaileddescription title=\"\"/>\n    <memberdecl>\n      <classes visible=\"yes\" title=\"\"/>\n      <namespaces visible=\"yes\" title=\"\"/>\n      <constantgroups visible=\"yes\" title=\"\"/>\n      <defines title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <functions title=\"\"/>\n      <variables title=\"\"/>\n      <membergroups visible=\"yes\"/>\n    </memberdecl>\n    <memberdef>\n      <inlineclasses title=\"\"/>\n      <defines title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <functions title=\"\"/>\n      <variables title=\"\"/>\n    </memberdef>\n    <authorsection/>\n  </file>\n\n  <!-- Layout definition for a group page -->\n  <group>\n    <briefdescription visible=\"yes\"/>\n    <groupgraph visible=\"$GROUP_GRAPHS\"/>\n    <detaileddescription title=\"\"/>\n    <memberdecl>\n      <nestedgroups visible=\"yes\" title=\"\"/>\n      <dirs visible=\"yes\" title=\"\"/>\n      <files visible=\"yes\" title=\"\"/>\n      <namespaces visible=\"yes\" title=\"\"/>\n      <classes visible=\"yes\" title=\"\"/>\n      <defines title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <enumvalues title=\"\"/>\n      <functions title=\"\"/>\n      <variables title=\"\"/>\n      <signals title=\"\"/>\n      <publicslots title=\"\"/>\n      <protectedslots title=\"\"/>\n      <privateslots title=\"\"/>\n      <events title=\"\"/>\n      <properties title=\"\"/>\n      <friends title=\"\"/>\n      <membergroups visible=\"yes\"/>\n    </memberdecl>\n    <memberdef>\n      <pagedocs/>\n      <inlineclasses title=\"\"/>\n      <defines title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <enumvalues title=\"\"/>\n      <functions title=\"\"/>\n      <variables title=\"\"/>\n      <signals title=\"\"/>\n      <publicslots title=\"\"/>\n      <protectedslots title=\"\"/>\n      <privateslots title=\"\"/>\n      <events title=\"\"/>\n      <properties title=\"\"/>\n      <friends title=\"\"/>\n    </memberdef>\n    <authorsection visible=\"yes\"/>\n  </group>\n\n  <!-- Layout definition for a directory page -->\n  <directory>\n    <briefdescription visible=\"yes\"/>\n    <directorygraph visible=\"yes\"/>\n    <memberdecl>\n      <dirs visible=\"yes\"/>\n      <files visible=\"yes\"/>\n    </memberdecl>\n    <detaileddescription title=\"\"/>\n  </directory>\n</doxygenlayout>\n"
  },
  {
    "path": "docs/src/index.md",
    "content": "Games in Motion\n===============\n\nGames in Motion    {#games_in_motion_index}\n===============\n\n[Games in Motion][] is a game that motivates people to run, walk and get fit. It\nis a sample game with a goal to demonstrate different key game technologies.\n\nIt is developed entirely using [Android Studio][].\n\n## Motivation\n\n[Games in Motion][] demonstrates several Android-specific technologies,\nincluding the [Google Fit][] API, the [Android Wear][] API, and a simple\ndata-driven design mechanism. [Games in Motion][] is also compatible with\n[Material design][] UX system.\n\nThis sample shows how all these pieces can be put together in a fun context,\nwhile also giving players a good motivation to exercise.\n\nIn addition, [fplutil][] is used to build the documentation of this project.\n\n## Functionality\n\n[Games in Motion][] is an open-source sample on [Android][] that demonstrates\n\n   * A fun game mechanic involving [Android Wear][],\n   * Game development in [Android Studio][],\n   * How to run a game entirely on a background service thread,\n   * [Google Fit][] API integration,\n   * [Android Wear][] API integration,\n   * [Google Play Games Services][] API integration,\n   * [Android Text to Speech][] API integration,\n   * [Android Audio Focus][] API integration,\n   * and JUnit test integration.\n\n\n## Supported Platforms\n\n[Games in Motion][] has been tested on the following platforms:\n\n   * [Android][] phones and tablets\n\nWe use [Android Studio][] and gradle to build. The game is written in Java with\ndata authored in XML.\n\n## Download\n\n[Games in Motion][] can be downloaded from:\n   * [GitHub][] (source)\n   * [GitHub Releases Page](http://github.com/googlesamples/android-play-games-in-motion/releases)\n     (source)\n\n**Important**: Games in Motion uses submodules to reference other components it\ndepends upon, so download the source from [GitHub][] using:\n\n~~~{.sh}\n    git clone --recursive https://github.com/googlesamples/android-play-games-in-motion.git\n~~~\n\n## Feedback and Reporting Bugs\n\n   * File issues on the [Games in Motion Issue Tracker][].\n   * Post your questions to [stackoverflow.com][] with a mention of\n     **gamesinmotion**.\n\n\\s\\s\n\n  [Android]: http://developer.android.com\n  [Android Audio Focus]: http://developer.android.com/training/managing-audio/audio-focus.html\n  [Android Studio]: http://developer.android.com/tools/studio/index.html\n  [Android Text to Speech]: http://developer.android.com/reference/android/speech/tts/TextToSpeech.html\n  [Android Wear]: https://developer.android.com/wear/index.html\n  [fplutil]: http://google.github.io/fplutil/\n  [Games in Motion]: http://github.com/googlesamples/android-play-games-in-motion\n  [Games in Motion Issue Tracker]: http://github.com/googlesamples/android-play-games-in-motion/issues\n  [Google Fit]: https://developers.google.com/fit/\n  [Google Play Games Services]: https://developer.android.com/google/play-services/games.html\n  [GitHub]: http://github.com/googlesamples/android-play-games-in-motion\n  [Material design]: http://www.google.com/design/spec/material-design/introduction.html\n  [stackoverflow.com]: http://www.stackoverflow.com\n\n"
  },
  {
    "path": "docs/src/programmers_guide/assets.md",
    "content": "Modifying Assets {#games_in_motion_guide_assets}\n================\n\n### Overview\n\nThe game utilizes a data-driven component for gameplay. Games in Motion uses a\nXML-based data component to describe missions.\n\nTo add a Mission, add a new XML file in the `app/src/main/assets/missions`\nfolder. There are existing XML files in both the `app/src/main/assets/missions`\nand the `app/src/main/assets/legacy_missions` folders, which can be used as a\nstarting point.\n\nThe game loads gameplay assets from the `app/src/main/assets` directory, and\nother assets (art, strings, layouts) from the `app/src/main/res` directory, as\nis conventional in [Android Studio][].\n\n### Authoring\n\nAs outlined at the [Mission][] system page, missions are comprised of moments.\n\nEach moment signifies a different kind of event, and there is a `type` and an\n`id` associated with each of them. Each kind of moment can define specific XML\ntags. Optionally, each moment can have multiple `fictional_progress` tags, which\nare information displayed to the user at the end of the mission.\n\nEach mission has a `name` and a `start_id`. `start_id` signifies the first\nmoment of the mission. A mission progresses through its moments linearly, the\norder of which is determined by the `next_moment_id` tag. The first moment will\nalways have an `id` identical to the mission's `start_id` property, whereas the\nlast moment will not have a `next_moment_id` tag.\n\nFor example, here is a simple mission with one moment:\n\n    <mission\n        start_id=\"foo\"\n        name=\"Foo Example\">\n        <moment\n            type=\"timer\"\n            id=\"foo\">\n            <length_minutes>0.5</length_minutes>\n            <fictional_progress>Played a mission!</fictional_progress>\n            <fictional_progress>Played a timer moment</fictional_progress>\n        </moment>\n    </mission>\n\nHere is a mission with two moments:\n\n    <mission\n        start_id=\"bar\"\n        name=\"Bar Example\">\n        <moment\n            type=\"sfx\"\n            id=\"bar\">\n            <next_moment id=\"half_minute_timer\"/>\n            <uri>android.resource://com.google.fpl.gim.examplegame/raw/bar</uri>\n            <fictional_progress>Bar!</fictional_progress>\n        </moment>\n        <moment\n            type=\"timer\"\n            id=\"half_minute_timer\">\n            <length_minutes>0.5</length_minutes>\n        </moment>\n    </mission>\n\n### Testing\n\nThere are simple unit tests written for the mission parser. The tests are in the\n`app/src/androidTest` directory.\n\nThe tests can be run by changing the run configuration to `All Tests`.\n\n<img src=\"change_config.png\"\n     width=\"300em\"\n     align=\"left\" />\n\n\\s\\s\n\n  [Android Studio]: http://developer.android.com/tools/studio/index.html\n  [Mission]: @ref games_in_motion_guide_mission\n"
  },
  {
    "path": "docs/src/programmers_guide/audio.md",
    "content": "Audio {#games_in_motion_guide_audio}\n=====\n\nAudio is essential to [Games in Motion][]. It signals game progression to the\nplayer, provides feedback for player actions, and allows the game to be played\nwithout many physical interactions with a device.\n\nWe also want to let players choose their own background music.\n[Games in Motion][] is designed to encourage people to move more, and often\nbackground music helps set a pace for the activity.\n\nIn [Games in Motion][], audio is mostly handled by the [MainService][].\n\n# Media Player {#games_in_motion_guide_mediaplayer}\n\nWe use [Android Media Player][] to control the playback of our raw audio files.\nIt is owned by [MainService][].\n\nIn this sample, we do not allow any sound effects to be played on top of each\nother because all of them provide important user feedback. Therefore, we have\nimplemented an audio queue to make sure that only one sound effect is played at\na time.\n\nCurrently, only `SfxMoment` and `Mission` are queueing audio to be played by the\n[Android Media Player][]. Any audio will only be played if we can properly\nobtain [Audio Focus][].\n\n# Text to Speech {#games_in_motion_guide_tts}\n\nFor certain game story elements, it is better to be able to author and change\nthem without having to re-record after every change. We use\n[Android Text to Speech][] to generate audio from these texts.\n\nThe main Text to Speech module is owned by the [MainService][].\n`SpokenTextMoment` obtains a reference to the module in order to convert its\ntext to audio and play it. Again, the audio will not be played unless we have\nproperly obtained [Audio focus][].\n\nUnlike raw audio files, we cannot queue Text to Speech requests as easily.\nInstead, we restart any `SpokenTextMoment` until we are successful in calling\nthe Text to Speech module.\n\n# Audio Focus {#games_in_motion_guide_audiofocus}\n\nA piece of audio, regardless of which module it is from, can only be played if\nwe satisfy these following conditions:\n\n* No audio from the [Media Player][] or the [Text to Speech][] modules is\n  currently playing.\n* We can obtain audio focus properly from the Android system.\n\nThe first condition is important so we are not overlapping any important audio\ncues. The second is important because we want to make sure that the Android\nsystem isn't performing any important audio tasks.\n\nBecause players can choose any background music from their favourite app, we\nneed to be able to lower the volume of any audio from other apps before we can\nplay our own. We return the volume level of those audio to previous levels once\nwe are done. We manage this by properly implementing Android Audio Focus. Please\nreview the [Managing Audio Focus][] page if you are not familiar with it.\n\n\\s\\s\n\n  [Android Media Player]: http://developer.android.com/reference/android/media/MediaPlayer.html\n  [Android Text to Speech]: http://developer.android.com/reference/android/speech/tts/TextToSpeech.html\n  [Audio Focus]: @ref games_in_motion_guide_audiofocus\n  [Games in Motion]: @ref games_in_motion_index\n  [MainService]: @ref games_in_motion_guide_mainservice\n  [Managing Audio Focus]: http://developer.android.com/training/managing-audio/audio-focus.html\n  [Media Player]: @ref games_in_motion_guide_mediaplayer\n  [Text to Speech]: @ref games_in_motion_guide_tts\n"
  },
  {
    "path": "docs/src/programmers_guide/building.md",
    "content": "Building    {#games_in_motion_guide_building}\n========\n\nDevelopers can build the game from source for [Android][], using\n[Android Studio][].\n\n# Version Requirements\n\nFollowing are the minimum required versions for the tools and libraries you\nneed for building [Games in Motion][] for [Android][]:\n\n-   [Android Studio][]: Version 1.0.\n-   [Android SDK][]:  Android 4.1 (API Level 16)\n-   [Android Support Library][]: v7.21\n-   [Google Play Games Services][]: 6.1 or above\n-   Install [fplutil prerequisites][] if you would like to build documentation.\n\n# Before Building\n\n-   Install [Android Studio][].\n-   Install all required libraries via the Android SDK Manager from within\n    [Android Studio][].\n\n## Set up Google Play Games Services\n\nTo use the [Google Play Games Services][] features in the game, follow the steps\nbelow to set up [Google Play Games Services][] IDs:\n\n-   Create an App ID with new package name in the\n    [Google Play Developer Console][].\n    -   Replace `app_id` in `app/build.gradle` with the newly created one.\n    -   Update the package name in `app/src/AndroidManifest.xml` and Java source files.\n        - For example, rename `com.google.fpl.gim.examplegame` to\n          `com.mystudio.coolgame`.\n-   Add [Google Play Games Services][] to the App in the\n    [Google Play Developer Console][].\n-   For testing prior to publishing an APK, in the Game Services sections of the\n    [Google Play Developer Console][], add your email account as a tester.\n\n# Building, installing, testing and running the game.\n\nYou can use the standard build and run instructions for [Android Studio][].\n\nTo build and run the JUnit tests, change the configuration from `app` to\n`All Tests`.\n\n<img src=\"change_config.png\"\n     width=\"300em\"\n     align=\"left\" />\n\n\\s\\s\n\n  [Android]: http://www.android.com\n  [Android SDK]: http://developer.android.com/sdk/index.html\n  [Android Studio]: http://developer.android.com/tools/studio/index.html\n  [Android Support Library]: https://developer.android.com/tools/support-library/features.html\n  [fplutil prerequisites]: http://google.github.io/fplutil/fplutil_prerequisites.html\n  [Games in Motion]: @ref games_in_motion_guide_overview\n  [Google Play Developer Console]: http://play.google.com/apps/publish/\n  [Google Play Games Services]: https://developer.android.com/google/play-services/games.html\n"
  },
  {
    "path": "docs/src/programmers_guide/core.md",
    "content": "Games in Motion Core    {#games_in_motion_guide_core}\n====================\n\nThere are two main components of the game, `MainActivity` and `MainService`.\nFind them in `app/src/main/java/com/google/fpl/gim/examplegame`.\n\n# MainActivity\n\nAll Android applications have a main [Activity][] class which the application\nwill show on launch. Please review the [Activity Lifecycle][] if you are not\nfamiliar with it.\n\nFor Games in Motion, `MainActivity` manages all the UI elements that are shown\non screen. It holds a pointer to `MainService` so it can query game state\nchanges in order to update the UI dynamically.\n\n# MainService {#games_in_motion_guide_mainservice}\n\n`MainService` is included in `AndroidManifest.xml`. It will automatically be\nstarted when the app is launched. Please review the [Service Basics][] if you\nare not familiar with Services. `MainService` is run in the background to allow\nthe game to continue running when the player turns off the phone screen, or when\n`MainActivity` is paused for any reason.\n\n`MainService::Run` contains the main game loop. Every call to that function is\none frame of the game update.\n\n`MainService` holds references to all the key systems that are needed during\ngameplay. This includes the [Mission system][], [Android Audio Manager][], \n[Android Text to Speech][], and the [Google Api Wrapper][]. `MainService` is\nalso responsible for starting up these systems and channeling queries to them.\n\n# UI\n\nMost of Games in Motion's UI is handled using [Fragments][].\n`MainActivity` holds all the fragments and handles all incoming requests to\nadvance the UI, or delegate them to the fragments. The UI fragments reside in\n`app/src/main/java/com/google/fpl/gim/examplegame/gui`.\n\nGames in Motion also uses [Notifications][] extensively. They allow the user to\ninteract with the game, either through the notifications menu, or an Android\nWear device. Notifications are typically issued through `MainService` as they\ncan occur while `MainActivity` is not in display.\n\n# State Machine\n\nThere is a simple state machine that resides in `MainService`. The `mState`\nvariable dictates the mission flow. There are two functions that help control\nthe states: `canEnterState` checks if we can enter a state from the current\nstate, and `setAndInitNextState` sets the state machine to the next state while\ndoing all the initializations needed for the transition. The states and their \ntransitions are described below.\n\n  * `UNINITIALIZED` -- No mission is loaded. The player is still going through\n    the UI flow and hasn't started a game mission yet.\n\n    You can enter this state from any other states. It happens when the player\n    hit the back button from `END_SCREEN`, when the connection to Google Apis\n    has been disconnected, or when some other sort of error has occurred.\n\n  * `MISSION_LOADED` -- The game mission has been loaded and we are waiting for\n    a few key systems to finish starting up before we start the mission.\n    \n    When the player starts a mission, it will trigger a load from the `assets`\n    folder. It will also trigger subscriptions to the appropriate [Google Fit][]\n    data streams.\n\n    When the game is ready, the game transitions to `MISSION_RUNNING`.\n\n  * `MISSION_RUNNING` -- The misson is started when we transition to this state.\n    While in this state, the mission is also running, even if the device screen\n    is not on.\n    \n    This state can only be transitioned from `MISSION_LOADED`.\n\n  * `END_SCREEN` -- When a mission is over (all its moments have been played),\n    or when a player aborts a mission by hitting the back button, the game will\n    transition to this state.\n    \n    The game will display the statistics from the mission while in this state.\n\n    This state can only be transitioned from `MISSION_RUNNING`.\n\n\\s\\s\n\n  [Activity]: http://developer.android.com/reference/android/app/Activity.html\n  [Activity Lifecycle]: http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle\n  [Android Audio Manager]: http://developer.android.com/reference/android/media/AudioManager.html\n  [Android Text to Speech]: http://developer.android.com/reference/android/speech/tts/TextToSpeech.html\n  [Fragments]: http://developer.android.com/reference/android/app/Activity.html#Fragments\n  [Google Api Wrapper]: @ref games_in_motion_guide_google_api\n  [Google Fit]: https://developers.google.com/fit/\n  [Mission system]: @ref games_in_motion_guide_mission\n  [Notifications]: http://developer.android.com/guide/topics/ui/notifiers/notifications.html\n  [Service Basics]: http://developer.android.com/guide/components/services.html\n"
  },
  {
    "path": "docs/src/programmers_guide/gameplay.md",
    "content": "Gameplay {#games_in_motion_guide_gameplay}\n===============\n\nThe player selects a mission to play and exercises (walk or run) while receiving\naudio cues on gameplay.\n\nThe player can customize their experience based on their fitness level and\ngoals. In order to fulfill the player's exercise goals, they can select an\ninterval speed they want to challenge. If the player wants to listen to music\nwhile running, they can switch over to their favourite music app and start\nplaying the music before starting a mission.\n\nWhile on a mission, the player listens to mission details, learning about the\nstory and what the game goals are. When it comes time to interact with the game,\nthe player will make choices by tapping or swiping on their [Android Wear][]\ndevice or the notifications menu of their phone or tablet.\n\nIf the player has been consistently running at the interval speed,\nthey will be rewarded with extra choices.\n\nUpon completion of the mission, the app presents the statistics of the exercise\nand uploads the data to [Google Fit][].\n\n\\s\\s\n\n  [Android Wear]: https://developer.android.com/wear/index.html\n  [Google Fit]: https://developers.google.com/fit/\n\n\n"
  },
  {
    "path": "docs/src/programmers_guide/google_api.md",
    "content": "Google API {#games_in_motion_guide_google_api}\n==========\n\nGoogle APIs provide feature access that is important to Games in Motion. These\nAPIs are accessed using the [GoogleApiClient][] which handles all connections to\nGoogle-provided services.\n\nThe `GoogleApiClientWrapper` class handles all connections to\n[GoogleApiClient][]. Find it in\n`app/src/main/java/com/google/fpl/gim/examplegame/google`.\n\nAt start up, Games in Motion attempts to connect to various Google API services.\nThe connection flow is delegated to the appropriate service by default.\n\n# Google Fit\n\n[Google Fit][] is a core part of Games in Motion. It keeps track of step count,\ntracks speed, and keeps data in the cloud so the player can retrieve it via\nother apps that connect to [Google Fit][].\n\nWhen the player is ready to start a mission, Games in Motion connects to\n[Google Fit][] to register callbacks for step count and speed. When all the\nsensors are connected properly (detected via callbacks), Games in Motion start\nthe mission.\n\nNote that for certain Android devices, there might be a noticeable delay between\nsuccessfully registering a sensor and actually getting sensor data. If the\ndevice has hardware sensors: the sensors might take some time to start up. Games\nin Motion does not account for the delay.\n\nFor tracking speed, Games in Motion provide a fallback mechanism to calculating\nspeed in case sensor data is unreliable.\n\n# Google Play Games Service\n\nIn the `GoogleApiClientWrapper` class, Games in Motion connects to\n[Google Play Games Services][] in the same manner as it connects to\n[Google Fit][]. Games in Motion provides an example of unlocking achievements.\nLook for the `unlockAchievement` method in `MainService.java`.\n\n\\s\\s\n\n  [GoogleApiClient]: https://developer.android.com/reference/com/google/android/gms/common/api/GoogleApiClient.html\n  [Google Fit]: https://developers.google.com/fit/\n  [Google Play Games Services]: https://developer.android.com/google/play-services/games.html\n"
  },
  {
    "path": "docs/src/programmers_guide/mission.md",
    "content": "Mission System {#games_in_motion_guide_mission}\n==============\n\nThe data-driven mission system is controlled by the `Mission` class. Only one\n`Mission`, consisting of a list `Moments`, may be active at any point during\ngameplay. Only one `Moment` is active at a time while the player plays.\n\nEach of the data-driven classes (`Mission` and various `Moment` classes) has\nan equivalent Data class that contains the actual data parsed from the input XML\nfiles. Find them in `app/src/main/java/com/google/fpl/gim/examplegame`.\n\n# Mission\n\n`Mission` keeps track of the game progression, as well as all the data generated\nby the user during the game. Its `update()` method is being called by\n`MainService` per game frame, and it will trigger the relevant `Moment`s as time\nprogresses.\n\nOn mission start, `Mission` will register listeners with [Google Fit][]. This\nallows us to obtain speed and step data, which is critical to the game.\n\n# Moment\n\nA `Moment` is a discrete event within a `Mission`. `Moment`s know when they\nfinish, the next `Moment` to start, are sequential, and are never reused.\n\nWe have implemented a few types of `Moment`s for a basic mission flow.\n\n* Choice moments.\n\n  These give the player a couple choices to choose from. The choices are\n  shown to players as [Notifications][].\n\n* Sfx moments.\n\n  These queue a simple sound effect to be played.\n\n* Spoken Text moments.\n\n  These use [Android Text to Speech][] to generate spoken speech to be played\n  when the app gets [Audio Focus][].\n\n* Timer moments.\n\n  These are simple timers to space out the other `Moment`s.\n\nAs you can see, each of these `Moment`s are small encapsulated game events. They\nare highly specialized, but can be authored to allow for variety and flexibility\nin each game mission.\n\n# Parser\n\nIn order to parse our custom data formats for `Mission`s and `Moment`s, we have\nwritten a `MissionParser`. Find it in\n`app/src/main/java/com/google/fpl/gim/examplegame/utils`.\n\nThis is a runtime parser that will parse XML data when the player selected a\nmission. It is also the only component that has unit testing. Find the test in\n`app/src/androidTest/`.\n\n\\s\\s\n\n  [Android Text to Speech]: http://developer.android.com/reference/android/speech/tts/TextToSpeech.html\n  [Audio Focus]: http://developer.android.com/training/managing-audio/audio-focus.html\n  [Google Fit]: https://developers.google.com/fit/\n  [Notifications]: http://developer.android.com/guide/topics/ui/notifiers/notifications.html\n"
  },
  {
    "path": "docs/src/programmers_guide/overview.md",
    "content": "Overview    {#games_in_motion_guide_overview}\n========\n\n## Downloading\n\n[Games in Motion][] can be downloaded from [GitHub](http://github.com/googlesamples/android-play-games-in-motion)\nor the [releases page](http://github.com/googlesamples/android-play-games-in-motion/releases).\n\n~~~{.sh}\n    git clone --recursive https://github.com/googlesamples/android-play-games-in-motion.git\n~~~\n\n## Subsystems\n\nGames in Motion code is divided into the following subsystems\n- [Core][] -- holds game subsystems, state, and state machine, and UI.\n- [Mission System][] -- a simple, game-agnostic system for organizing game\n  events.\n- [Google Api][] -- an interface with different Google services APIs.\n- [Audio][] -- various systems integrated to produce audio and control focus.\n\n## Source Layout\n\nThe following bullets describe the directory structure of the game.\n\n\n| Path                          | Description                                  |\n|-------------------------------|----------------------------------------------|\n| base directory                | Android Studio project files.                |\n| `app/main`                    | Main directory for all code and assets.      |\n| `app/main/assets`             | Game mission data in .xml format.            |\n| `app/main/java`               | Where the main code lives.                   |\n| `app/main/res`                | Android-style assets.                        |\n| `app/androidTest`             | JUnit tests for the mission authoring        |\n|                               | component.                                   |\n| `docs`                        | Documentation source and html files.         |\n\n\n\\s\\s\n\n  [Audio]: @ref games_in_motion_guide_audio\n  [Core]: @ref games_in_motion_guide_core\n  [Games in Motion]: @ref games_in_motion_index\n  [Google Api]: @ref games_in_motion_guide_google_api\n  [Mission System]: @ref games_in_motion_guide_mission\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#\n# Copyright 2015 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n#Fri Jan 09 12:15:18 PST 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-2.2.1-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "#\n# Copyright 2015 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Settings specified in this file will override any Gradle settings\n# configured through the IDE.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# For Cygwin, ensure paths are in UNIX format before anything is touched.\nif $cygwin ; then\n    [ -n \"$JAVA_HOME\" ] && JAVA_HOME=`cygpath --unix \"$JAVA_HOME\"`\nfi\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >&-\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >&-\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windowz variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\ngoto execute\r\n\r\n:4NT_args\r\n@rem Get arguments from the 4NT Shell from JP Software\r\nset CMD_LINE_ARGS=%$\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "prototype.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.path=\"$MODULE_DIR$\" external.root.project.path=\"$MODULE_DIR$\" external.system.id=\"GRADLE\" external.system.module.group=\"\" external.system.module.version=\"unspecified\" type=\"JAVA_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <excludeFolder url=\"file://$MODULE_DIR$/.gradle\" />\n    </content>\n    <orderEntry type=\"inheritedJdk\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n  </component>\n</module>\n\n"
  },
  {
    "path": "readme.md",
    "content": "Games in Motion   {#games_in_motion_readme}\n===============\n\nGames in Motion Version 1.0.0\n\n[Games in Motion][] is a simple game that motivates you to run.\n\n## Motivation\n\n[Games in Motion][] is a demonstration for several Android-specific\ntechnologies, including the [Google Fit][] API, the [Android Wear][] API, and a\nsimple data-driven design mechanic. It is also compatible with\n[Material design][]. This sample shows how all these pieces can be put together\nin a fun context, while also giving players a good motivation to exercise.\n\n[Games in Motion][] is developed entirely using [Android Studio][].\n\n## Downloading\n\n[Games in Motion][] can be downloaded from:\n   * [GitHub][] (source)\n   * [GitHub Releases Page](http://github.com/googlesamples/android-play-games-in-motion/releases) (source)\n\n~~~{.sh}\n    git clone --recursive https://github.com/googlesamples/android-play-games-in-motion.git\n~~~\n\n## Documentation\n\nThe documentation is include with the GitHub codebase. It is in the `docs`\ndirectory.\n\nRequired libraries:\n    * Python 2.7\n    * [fplutil][] library\n\n[fplutil][] is referenced as a submodule from the [Games in Motion][]\nrepository, so the download command referenced above will automatically download\nit as well.\n\nAfter all required libraries are downloaded, run:\n\n~~~{.sh}\n    ./docs/generate_docs.py\n~~~\n\nThe generated documentation will be in `docs/html`.\n\nTo contribute the this project see [CONTRIBUTING][]. The license file is at\n[LICENSE][].\n\n\\s\\s\n\n  [Android Studio]: http://developer.android.com/tools/studio/index.html\n  [Android Wear]: https://developer.android.com/wear/index.html\n  [Build and Run Games in Motion]: http://github.com/googlesamples/android-play-games-in-motiongames_in_motion_guide_building.html\n  [fplutil]: http://google.github.io/fplutil/\n  [Games in Motion]: http://github.com/googlesamples/android-play-games-in-motion\n  [Google Fit]: https://developers.google.com/fit/\n  [Material design]: http://www.google.com/design/spec/material-design/introduction.html\n  [Programmer's Guide]: http://github.com/googlesamples/android-play-games-in-motion/games_in_motion_guide_overview.html\n  [CONTRIBUTING]: http://github.com/googlesamples/android-play-games-in-motion/blob/master/CONTRIBUTING\n  [LICENSE]: http://github.com/googlesamples/android-play-games-in-motion/blob/master/LICENSE\n  [GitHub]: http://github.com/googlesamples/android-play-games-in-motion\n"
  },
  {
    "path": "settings.gradle",
    "content": "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ninclude ':app'\n"
  }
]