You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 lines
17 KiB

  1. <!DOCTYPE HTML>
  2. <html lang="de">
  3. <head>
  4. <!-- Generated by javadoc (17) on Thu May 12 09:13:23 CEST 2022 -->
  5. <title>CollisionAwareEgoController</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <meta name="dc.created" content="2022-05-12">
  9. <meta name="description" content="declaration: package: controller, class: CollisionAwareEgoController">
  10. <meta name="generator" content="javadoc/ClassWriterImpl">
  11. <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
  12. <link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
  13. <link rel="stylesheet" type="text/css" href="../jquery-ui.overrides.css" title="Style">
  14. <script type="text/javascript" src="../script.js"></script>
  15. <script type="text/javascript" src="../script-dir/jquery-3.5.1.min.js"></script>
  16. <script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
  17. </head>
  18. <body class="class-declaration-page">
  19. <script type="text/javascript">var evenRowColor = "even-row-color";
  20. var oddRowColor = "odd-row-color";
  21. var tableTab = "table-tab";
  22. var activeTableTab = "active-table-tab";
  23. var pathtoroot = "../";
  24. loadScripts(document, 'script');</script>
  25. <noscript>
  26. <div>JavaScript is disabled on your browser.</div>
  27. </noscript>
  28. <div class="flex-box">
  29. <header role="banner" class="flex-header">
  30. <nav role="navigation">
  31. <!-- ========= START OF TOP NAVBAR ======= -->
  32. <div class="top-nav" id="navbar-top">
  33. <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
  34. <ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
  35. <li><a href="../index.html">Overview</a></li>
  36. <li><a href="package-summary.html">Package</a></li>
  37. <li class="nav-bar-cell1-rev">Class</li>
  38. <li><a href="class-use/CollisionAwareEgoController.html">Use</a></li>
  39. <li><a href="package-tree.html">Tree</a></li>
  40. <li><a href="../index-files/index-1.html">Index</a></li>
  41. <li><a href="../help-doc.html#class">Help</a></li>
  42. </ul>
  43. </div>
  44. <div class="sub-nav">
  45. <div>
  46. <ul class="sub-nav-list">
  47. <li>Summary:&nbsp;</li>
  48. <li>Nested&nbsp;|&nbsp;</li>
  49. <li>Field&nbsp;|&nbsp;</li>
  50. <li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
  51. <li><a href="#method-summary">Method</a></li>
  52. </ul>
  53. <ul class="sub-nav-list">
  54. <li>Detail:&nbsp;</li>
  55. <li>Field&nbsp;|&nbsp;</li>
  56. <li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
  57. <li><a href="#method-detail">Method</a></li>
  58. </ul>
  59. </div>
  60. <div class="nav-list-search"><label for="search-input">SEARCH:</label>
  61. <input type="text" id="search-input" value="search" disabled="disabled">
  62. <input type="reset" id="reset-button" value="reset" disabled="disabled">
  63. </div>
  64. </div>
  65. <!-- ========= END OF TOP NAVBAR ========= -->
  66. <span class="skip-nav" id="skip-navbar-top"></span></nav>
  67. </header>
  68. <div class="flex-content">
  69. <main role="main">
  70. <!-- ======== START OF CLASS DATA ======== -->
  71. <div class="header">
  72. <div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">controller</a></div>
  73. <h1 title="Class CollisionAwareEgoController" class="title">Class CollisionAwareEgoController</h1>
  74. </div>
  75. <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
  76. <div class="inheritance"><a href="ObjectController.html" title="class in controller">controller.ObjectController</a>
  77. <div class="inheritance"><a href="EgoController.html" title="class in controller">controller.EgoController</a>
  78. <div class="inheritance">controller.CollisionAwareEgoController</div>
  79. </div>
  80. </div>
  81. </div>
  82. <section class="class-description" id="class-description">
  83. <hr>
  84. <div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">CollisionAwareEgoController</span>
  85. <span class="extends-implements">extends <a href="EgoController.html" title="class in controller">EgoController</a></span></div>
  86. <div class="block">An EgoController which cannot move through obstacle objects (is collission aware). Only respects
  87. GameObjects that have the String 'obstacle' in their name.</div>
  88. </section>
  89. <section class="summary">
  90. <ul class="summary-list">
  91. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  92. <li>
  93. <section class="constructor-summary" id="constructor-summary">
  94. <h2>Constructor Summary</h2>
  95. <div class="caption"><span>Constructors</span></div>
  96. <div class="summary-table two-column-summary">
  97. <div class="table-header col-first">Constructor</div>
  98. <div class="table-header col-last">Description</div>
  99. <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(double)" class="member-name-link">CollisionAwareEgoController</a><wbr>(double&nbsp;egoRad)</code></div>
  100. <div class="col-last even-row-color">&nbsp;</div>
  101. <div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(double,java.io.File)" class="member-name-link">CollisionAwareEgoController</a><wbr>(double&nbsp;egoRad,
  102. <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/io/File.html" title="class or interface in java.io" class="external-link">File</a>&nbsp;soundOnShot)</code></div>
  103. <div class="col-last odd-row-color">&nbsp;</div>
  104. </div>
  105. </section>
  106. </li>
  107. <!-- ========== METHOD SUMMARY =========== -->
  108. <li>
  109. <section class="method-summary" id="method-summary">
  110. <h2>Method Summary</h2>
  111. <div id="method-summary-table">
  112. <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
  113. <div id="method-summary-table.tabpanel" role="tabpanel">
  114. <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
  115. <div class="table-header col-first">Modifier and Type</div>
  116. <div class="table-header col-second">Method</div>
  117. <div class="table-header col-last">Description</div>
  118. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  119. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#onSpace(java.awt.event.KeyEvent,gameobjects.GameObject)" class="member-name-link">onSpace</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.desktop/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;e,
  120. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</code></div>
  121. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  122. <div class="block">behavior for shooting on key space</div>
  123. </div>
  124. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  125. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#restoreDynamicState()" class="member-name-link">restoreDynamicState</a>()</code></div>
  126. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  127. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  128. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#saveDynamicState()" class="member-name-link">saveDynamicState</a>()</code></div>
  129. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  130. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
  131. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#stopObject()" class="member-name-link">stopObject</a>()</code></div>
  132. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  133. <div class="block">checks the position and respects level boundaries and own radius or width/height set on constructor.</div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <div class="inherited-list">
  139. <h3 id="methods-inherited-from-class-controller.EgoController">Methods inherited from class&nbsp;controller.<a href="EgoController.html" title="class in controller">EgoController</a></h3>
  140. <code><a href="EgoController.html#onDown(java.awt.event.KeyEvent,gameobjects.GameObject)">onDown</a>, <a href="EgoController.html#onLeft(java.awt.event.KeyEvent,gameobjects.GameObject)">onLeft</a>, <a href="EgoController.html#onRight(java.awt.event.KeyEvent,gameobjects.GameObject)">onRight</a>, <a href="EgoController.html#onStop(java.awt.event.KeyEvent,gameobjects.GameObject)">onStop</a>, <a href="EgoController.html#onUp(java.awt.event.KeyEvent,gameobjects.GameObject)">onUp</a>, <a href="EgoController.html#updateObject()">updateObject</a></code></div>
  141. <div class="inherited-list">
  142. <h3 id="methods-inherited-from-class-controller.ObjectController">Methods inherited from class&nbsp;controller.<a href="ObjectController.html" title="class in controller">ObjectController</a></h3>
  143. <code><a href="ObjectController.html#applySpeedVector()">applySpeedVector</a>, <a href="ObjectController.html#getPlayground()">getPlayground</a>, <a href="ObjectController.html#getTimestep()">getTimestep</a>, <a href="ObjectController.html#getVX()">getVX</a>, <a href="ObjectController.html#getVY()">getVY</a>, <a href="ObjectController.html#getX()">getX</a>, <a href="ObjectController.html#getY()">getY</a>, <a href="ObjectController.html#setDummy(java.lang.String)">setDummy</a>, <a href="ObjectController.html#setObject(gameobjects.GameObject)">setObject</a>, <a href="ObjectController.html#setPlayground(playground.Playground)">setPlayground</a>, <a href="ObjectController.html#setVX(double)">setVX</a>, <a href="ObjectController.html#setVY(double)">setVY</a>, <a href="ObjectController.html#setX(double)">setX</a>, <a href="ObjectController.html#setY(double)">setY</a></code></div>
  144. <div class="inherited-list">
  145. <h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
  146. <code><a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
  147. </section>
  148. </li>
  149. </ul>
  150. </section>
  151. <section class="details">
  152. <ul class="details-list">
  153. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  154. <li>
  155. <section class="constructor-details" id="constructor-detail">
  156. <h2>Constructor Details</h2>
  157. <ul class="member-list">
  158. <li>
  159. <section class="detail" id="&lt;init&gt;(double)">
  160. <h3>CollisionAwareEgoController</h3>
  161. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">CollisionAwareEgoController</span><wbr><span class="parameters">(double&nbsp;egoRad)</span></div>
  162. <dl class="notes">
  163. <dt>Parameters:</dt>
  164. <dd><code>egoRad</code> - radius of ego object to be used.</dd>
  165. </dl>
  166. </section>
  167. </li>
  168. <li>
  169. <section class="detail" id="&lt;init&gt;(double,java.io.File)">
  170. <h3>CollisionAwareEgoController</h3>
  171. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">CollisionAwareEgoController</span><wbr><span class="parameters">(double&nbsp;egoRad,
  172. <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/io/File.html" title="class or interface in java.io" class="external-link">File</a>&nbsp;soundOnShot)</span></div>
  173. <dl class="notes">
  174. <dt>Parameters:</dt>
  175. <dd><code>egoRad</code> - radius of ego object to be used.</dd>
  176. <dd><code>soundOnShot</code> - WAV file to be played on shot</dd>
  177. </dl>
  178. </section>
  179. </li>
  180. </ul>
  181. </section>
  182. </li>
  183. <!-- ============ METHOD DETAIL ========== -->
  184. <li>
  185. <section class="method-details" id="method-detail">
  186. <h2>Method Details</h2>
  187. <ul class="member-list">
  188. <li>
  189. <section class="detail" id="saveDynamicState()">
  190. <h3>saveDynamicState</h3>
  191. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">saveDynamicState</span>()</div>
  192. </section>
  193. </li>
  194. <li>
  195. <section class="detail" id="restoreDynamicState()">
  196. <h3>restoreDynamicState</h3>
  197. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">restoreDynamicState</span>()</div>
  198. </section>
  199. </li>
  200. <li>
  201. <section class="detail" id="stopObject()">
  202. <h3>stopObject</h3>
  203. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">stopObject</span>()</div>
  204. <div class="block"><span class="descfrm-type-label">Description copied from class:&nbsp;<code><a href="EgoController.html#stopObject()">EgoController</a></code></span></div>
  205. <div class="block">checks the position and respects level boundaries and own radius or width/height set on constructor.</div>
  206. <dl class="notes">
  207. <dt>Overrides:</dt>
  208. <dd><code><a href="EgoController.html#stopObject()">stopObject</a></code>&nbsp;in class&nbsp;<code><a href="EgoController.html" title="class in controller">EgoController</a></code></dd>
  209. <dt>Returns:</dt>
  210. <dd>true if the object reached the boundaries of the level, false otherwise</dd>
  211. </dl>
  212. </section>
  213. </li>
  214. <li>
  215. <section class="detail" id="onSpace(java.awt.event.KeyEvent,gameobjects.GameObject)">
  216. <h3>onSpace</h3>
  217. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">onSpace</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.desktop/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&nbsp;e,
  218. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;ego)</span></div>
  219. <div class="block"><span class="descfrm-type-label">Description copied from class:&nbsp;<code><a href="EgoController.html#onSpace(java.awt.event.KeyEvent,gameobjects.GameObject)">EgoController</a></code></span></div>
  220. <div class="block">behavior for shooting on key space</div>
  221. <dl class="notes">
  222. <dt>Overrides:</dt>
  223. <dd><code><a href="EgoController.html#onSpace(java.awt.event.KeyEvent,gameobjects.GameObject)">onSpace</a></code>&nbsp;in class&nbsp;<code><a href="EgoController.html" title="class in controller">EgoController</a></code></dd>
  224. <dt>Parameters:</dt>
  225. <dd><code>e</code> - KeyEvent of the space key</dd>
  226. <dd><code>ego</code> - EgoObject instance (used to determine position of shot object's start)</dd>
  227. </dl>
  228. </section>
  229. </li>
  230. </ul>
  231. </section>
  232. </li>
  233. </ul>
  234. </section>
  235. <!-- ========= END OF CLASS DATA ========= -->
  236. </main>
  237. </div>
  238. </div>
  239. </body>
  240. </html>