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.

707 lines
57 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>Playground</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: playground, class: Playground">
  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/Playground.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><a href="#field-summary">Field</a>&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><a href="#field-detail">Field</a>&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">playground</a></div>
  73. <h1 title="Class Playground" class="title">Class Playground</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">playground.Playground</div>
  77. </div>
  78. <section class="class-description" id="class-description">
  79. <dl class="notes">
  80. <dt>Direct Known Subclasses:</dt>
  81. <dd><code><a href="SpaceInvadersLevel.html" title="class in playground">SpaceInvadersLevel</a></code></dd>
  82. </dl>
  83. <hr>
  84. <div class="type-signature"><span class="modifiers">public abstract class </span><span class="element-name type-name-label">Playground</span>
  85. <span class="extends-implements">extends <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></span></div>
  86. <div class="block">Playground represents a level of the game, focusing on the game LOGIC, i.e., not so much on the
  87. graphical representation. In particular, an instance of Playground
  88. <ul>
  89. <li>manages the different moving or static objects in a level (e.g., collisions, adding objects,
  90. removing objects). This is mainly done by the methods <a href="#addObject(gameobjects.GameObject)"><code>addObject(gameobjects.GameObject)</code></a>, <a href="#deleteObject(java.lang.String)"><code>deleteObject(java.lang.String)</code></a>.
  91. <li>processes keyboard inputs provided by GameLoop in <a href="#processKeyEvents(java.util.Stack)"><code>processKeyEvents(Stack)</code></a> and
  92. <a href="#processMouseEvents(java.util.Stack)"><code>processMouseEvents(Stack)</code></a>
  93. <li>represents the state of a level represented by <b>flags</b>. Each flag has a name (a String)
  94. and an arbitrary value of any type. Methods: <a href="#setLevelFlag(java.lang.String,java.lang.Object)"><code>setLevelFlag(String, Object)</code></a>,
  95. <a href="#getLevelFlag(java.lang.String)"><code>getLevelFlag(String)</code></a>. As an example, the current score is a flag usually named "points",
  96. with an Integer as a value. This value can be retrieved and manipulated using the above mentioned
  97. methods.
  98. </ul></div>
  99. </section>
  100. <section class="summary">
  101. <ul class="summary-list">
  102. <!-- =========== FIELD SUMMARY =========== -->
  103. <li>
  104. <section class="field-summary" id="field-summary">
  105. <h2>Field Summary</h2>
  106. <div class="caption"><span>Fields</span></div>
  107. <div class="summary-table three-column-summary">
  108. <div class="table-header col-first">Modifier and Type</div>
  109. <div class="table-header col-second">Field</div>
  110. <div class="table-header col-last">Description</div>
  111. <div class="col-first even-row-color"><code>static final int</code></div>
  112. <div class="col-second even-row-color"><code><a href="#FLAGS_ALL" class="member-name-link">FLAGS_ALL</a></code></div>
  113. <div class="col-last even-row-color">&nbsp;</div>
  114. <div class="col-first odd-row-color"><code>static final int</code></div>
  115. <div class="col-second odd-row-color"><code><a href="#FLAGS_GLOBAL" class="member-name-link">FLAGS_GLOBAL</a></code></div>
  116. <div class="col-last odd-row-color">&nbsp;</div>
  117. <div class="col-first even-row-color"><code>static final int</code></div>
  118. <div class="col-second even-row-color"><code><a href="#FLAGS_LEVEL" class="member-name-link">FLAGS_LEVEL</a></code></div>
  119. <div class="col-last even-row-color">&nbsp;</div>
  120. </div>
  121. </section>
  122. </li>
  123. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  124. <li>
  125. <section class="constructor-summary" id="constructor-summary">
  126. <h2>Constructor Summary</h2>
  127. <div class="caption"><span>Constructors</span></div>
  128. <div class="summary-table two-column-summary">
  129. <div class="table-header col-first">Constructor</div>
  130. <div class="table-header col-last">Description</div>
  131. <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">Playground</a>()</code></div>
  132. <div class="col-last even-row-color">&nbsp;</div>
  133. </div>
  134. </section>
  135. </li>
  136. <!-- ========== METHOD SUMMARY =========== -->
  137. <li>
  138. <section class="method-summary" id="method-summary">
  139. <h2>Method Summary</h2>
  140. <div id="method-summary-table">
  141. <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-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static 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-tab3" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="table-tab">Abstract 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>
  142. <div id="method-summary-table.tabpanel" role="tabpanel">
  143. <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
  144. <div class="table-header col-first">Modifier and Type</div>
  145. <div class="table-header col-second">Method</div>
  146. <div class="table-header col-last">Description</div>
  147. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  148. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addObject(gameobjects.GameObject)" class="member-name-link">addObject</a><wbr>(<a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;o)</code></div>
  149. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  150. <div class="block">Adds a graphics object to a level.</div>
  151. </div>
  152. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  153. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addObjectNow(gameobjects.GameObject)" class="member-name-link">addObjectNow</a><wbr>(<a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;o)</code></div>
  154. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  155. <div class="block">Adds a graphics object to a level.</div>
  156. </div>
  157. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract void</code></div>
  158. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#applyGameLogic()" class="member-name-link">applyGameLogic</a>()</code></div>
  159. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
  160. <div class="block">Method meant to be filled with own code, handles the entore game logic (collision checks, timed
  161. events, ...).</div>
  162. </div>
  163. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/util/LinkedList.html" title="class or interface in java.util" class="external-link">LinkedList</a>&lt;<a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&gt;</code></div>
  164. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#collectObjects(java.lang.String,boolean)" class="member-name-link">collectObjects</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;substr,
  165. boolean&nbsp;filterInactive)</code></div>
  166. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  167. <div class="block">Puts objects with a certain substring in their name into a LinkedLisrt and returns them.</div>
  168. </div>
  169. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  170. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#deleteObject(java.lang.String)" class="member-name-link">deleteObject</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id)</code></div>
  171. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  172. <div class="block">Removes a graphics object from a level.</div>
  173. </div>
  174. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  175. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#deleteObjectNow(java.lang.String)" class="member-name-link">deleteObjectNow</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id)</code></div>
  176. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  177. <div class="block">Removes a graphics object from a level immediately, CAUTION.</div>
  178. </div>
  179. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract boolean</code></div>
  180. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#gameOver()" class="member-name-link">gameOver</a>()</code></div>
  181. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">&nbsp;</div>
  182. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
  183. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getGameTime()" class="member-name-link">getGameTime</a>()</code></div>
  184. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  185. <div class="block">returns time in seconds since level start</div>
  186. </div>
  187. <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <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></code></div>
  188. <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getGlobalFlag(java.lang.String)" class="member-name-link">getGlobalFlag</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag)</code></div>
  189. <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
  190. <div class="block">Retrieves a level-wide flag by name.</div>
  191. </div>
  192. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<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>&gt;</code></div>
  193. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getKeyEvents()" class="member-name-link">getKeyEvents</a>()</code></div>
  194. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  195. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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></code></div>
  196. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getLevelFlag(java.lang.String)" class="member-name-link">getLevelFlag</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag)</code></div>
  197. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  198. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.desktop/java/awt/event/MouseEvent.html" title="class or interface in java.awt.event" class="external-link">MouseEvent</a>&gt;</code></div>
  199. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getMouseEvents()" class="member-name-link">getMouseEvents</a>()</code></div>
  200. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  201. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a></code></div>
  202. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getObject(java.lang.String)" class="member-name-link">getObject</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id)</code></div>
  203. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  204. <div class="block">Retrieves a graphics object by name.</div>
  205. </div>
  206. <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <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></code></div>
  207. <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getOrCreateGlobalFlag(java.lang.String,java.lang.Object)" class="member-name-link">getOrCreateGlobalFlag</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  208. <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>&nbsp;value)</code></div>
  209. <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
  210. <div class="block">checks for existence and if not creates the new global flag with the given initial value.</div>
  211. </div>
  212. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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></code></div>
  213. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getOrCreateLevelFlag(java.lang.String,java.lang.Object)" class="member-name-link">getOrCreateLevelFlag</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  214. <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>&nbsp;createValue)</code></div>
  215. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  216. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
  217. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getSizeX()" class="member-name-link">getSizeX</a>()</code></div>
  218. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  219. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
  220. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getSizeY()" class="member-name-link">getSizeY</a>()</code></div>
  221. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  222. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
  223. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTimestep()" class="member-name-link">getTimestep</a>()</code></div>
  224. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  225. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
  226. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isPaused()" class="member-name-link">isPaused</a>()</code></div>
  227. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  228. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract boolean</code></div>
  229. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#levelFinished()" class="member-name-link">levelFinished</a>()</code></div>
  230. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">&nbsp;</div>
  231. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract int</code></div>
  232. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#preferredSizeX()" class="member-name-link">preferredSizeX</a>()</code></div>
  233. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">&nbsp;</div>
  234. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract int</code></div>
  235. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#preferredSizeY()" class="member-name-link">preferredSizeY</a>()</code></div>
  236. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">&nbsp;</div>
  237. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract void</code></div>
  238. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#prepareLevel(java.lang.String)" class="member-name-link">prepareLevel</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;level)</code></div>
  239. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
  240. <div class="block">Sets up a single level.</div>
  241. </div>
  242. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  243. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#processKeyEvents(java.util.Stack)" class="member-name-link">processKeyEvents</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<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>&gt;&nbsp;keyEvents)</code></div>
  244. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  245. <div class="block">Method meant to be filled with own code, processes Keyboard inputs.</div>
  246. </div>
  247. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  248. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#processMouseEvents(java.util.Stack)" class="member-name-link">processMouseEvents</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.desktop/java/awt/event/MouseEvent.html" title="class or interface in java.awt.event" class="external-link">MouseEvent</a>&gt;&nbsp;mouseEvents)</code></div>
  249. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  250. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  251. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#redraw(java.awt.Graphics2D)" class="member-name-link">redraw</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.desktop/java/awt/Graphics2D.html" title="class or interface in java.awt" class="external-link">Graphics2D</a>&nbsp;g2)</code></div>
  252. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  253. <div class="block">Internal, do not call directly.</div>
  254. </div>
  255. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract void</code></div>
  256. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#redrawLevel(java.awt.Graphics2D)" class="member-name-link">redrawLevel</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.desktop/java/awt/Graphics2D.html" title="class or interface in java.awt" class="external-link">Graphics2D</a>&nbsp;g2)</code></div>
  257. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
  258. <div class="block">To be redefined!!</div>
  259. </div>
  260. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  261. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#reset()" class="member-name-link">reset</a>()</code></div>
  262. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  263. <div class="block">Reinitializes the level.</div>
  264. </div>
  265. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  266. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#resetFlags(int)" class="member-name-link">resetFlags</a><wbr>(int&nbsp;mode)</code></div>
  267. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  268. <div class="block">mode can be: FLAGS_ALL (all), FLAGS_GLOBAL(global), FLAGs_LEVEL(level)</div>
  269. </div>
  270. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  271. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setGameTime(double)" class="member-name-link">setGameTime</a><wbr>(double&nbsp;s)</code></div>
  272. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  273. <div class="block">set the game time value (in seconds)</div>
  274. </div>
  275. <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
  276. <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#setGlobalFlag(java.lang.String,java.lang.Object)" class="member-name-link">setGlobalFlag</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  277. <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>&nbsp;value)</code></div>
  278. <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
  279. <div class="block">Sets a level-wide permanent flag.</div>
  280. </div>
  281. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><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></code></div>
  282. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setLevelFlag(java.lang.String,java.lang.Object)" class="member-name-link">setLevelFlag</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  283. <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>&nbsp;value)</code></div>
  284. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  285. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  286. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setPaused(boolean)" class="member-name-link">setPaused</a><wbr>(boolean&nbsp;p)</code></div>
  287. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  288. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  289. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setTimestep(double)" class="member-name-link">setTimestep</a><wbr>(double&nbsp;s)</code></div>
  290. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  291. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  292. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#togglePause()" class="member-name-link">togglePause</a>()</code></div>
  293. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  294. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  295. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#updateObjects()" class="member-name-link">updateObjects</a>()</code></div>
  296. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  297. <div class="block">Calls all object update methods in level.</div>
  298. </div>
  299. </div>
  300. </div>
  301. </div>
  302. <div class="inherited-list">
  303. <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>
  304. <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>
  305. </section>
  306. </li>
  307. </ul>
  308. </section>
  309. <section class="details">
  310. <ul class="details-list">
  311. <!-- ============ FIELD DETAIL =========== -->
  312. <li>
  313. <section class="field-details" id="field-detail">
  314. <h2>Field Details</h2>
  315. <ul class="member-list">
  316. <li>
  317. <section class="detail" id="FLAGS_GLOBAL">
  318. <h3>FLAGS_GLOBAL</h3>
  319. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">FLAGS_GLOBAL</span></div>
  320. <dl class="notes">
  321. <dt>See Also:</dt>
  322. <dd>
  323. <ul class="see-list">
  324. <li><a href="../constant-values.html#playground.Playground.FLAGS_GLOBAL">Constant Field Values</a></li>
  325. </ul>
  326. </dd>
  327. </dl>
  328. </section>
  329. </li>
  330. <li>
  331. <section class="detail" id="FLAGS_LEVEL">
  332. <h3>FLAGS_LEVEL</h3>
  333. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">FLAGS_LEVEL</span></div>
  334. <dl class="notes">
  335. <dt>See Also:</dt>
  336. <dd>
  337. <ul class="see-list">
  338. <li><a href="../constant-values.html#playground.Playground.FLAGS_LEVEL">Constant Field Values</a></li>
  339. </ul>
  340. </dd>
  341. </dl>
  342. </section>
  343. </li>
  344. <li>
  345. <section class="detail" id="FLAGS_ALL">
  346. <h3>FLAGS_ALL</h3>
  347. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">FLAGS_ALL</span></div>
  348. <dl class="notes">
  349. <dt>See Also:</dt>
  350. <dd>
  351. <ul class="see-list">
  352. <li><a href="../constant-values.html#playground.Playground.FLAGS_ALL">Constant Field Values</a></li>
  353. </ul>
  354. </dd>
  355. </dl>
  356. </section>
  357. </li>
  358. </ul>
  359. </section>
  360. </li>
  361. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  362. <li>
  363. <section class="constructor-details" id="constructor-detail">
  364. <h2>Constructor Details</h2>
  365. <ul class="member-list">
  366. <li>
  367. <section class="detail" id="&lt;init&gt;()">
  368. <h3>Playground</h3>
  369. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">Playground</span>()</div>
  370. </section>
  371. </li>
  372. </ul>
  373. </section>
  374. </li>
  375. <!-- ============ METHOD DETAIL ========== -->
  376. <li>
  377. <section class="method-details" id="method-detail">
  378. <h2>Method Details</h2>
  379. <ul class="member-list">
  380. <li>
  381. <section class="detail" id="preferredSizeX()">
  382. <h3>preferredSizeX</h3>
  383. <div class="member-signature"><span class="modifiers">public abstract</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">preferredSizeX</span>()</div>
  384. </section>
  385. </li>
  386. <li>
  387. <section class="detail" id="preferredSizeY()">
  388. <h3>preferredSizeY</h3>
  389. <div class="member-signature"><span class="modifiers">public abstract</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">preferredSizeY</span>()</div>
  390. </section>
  391. </li>
  392. <li>
  393. <section class="detail" id="addObject(gameobjects.GameObject)">
  394. <h3>addObject</h3>
  395. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">addObject</span><wbr><span class="parameters">(<a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;o)</span></div>
  396. <div class="block">Adds a graphics object to a level.</div>
  397. <dl class="notes">
  398. <dt>Parameters:</dt>
  399. <dd><code>o</code> - GameObject The object to be added</dd>
  400. </dl>
  401. </section>
  402. </li>
  403. <li>
  404. <section class="detail" id="addObjectNow(gameobjects.GameObject)">
  405. <h3>addObjectNow</h3>
  406. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">addObjectNow</span><wbr><span class="parameters">(<a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;o)</span></div>
  407. <div class="block">Adds a graphics object to a level.</div>
  408. <dl class="notes">
  409. <dt>Parameters:</dt>
  410. <dd><code>o</code> - GameObject The object to be added</dd>
  411. </dl>
  412. </section>
  413. </li>
  414. <li>
  415. <section class="detail" id="collectObjects(java.lang.String,boolean)">
  416. <h3>collectObjects</h3>
  417. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/util/LinkedList.html" title="class or interface in java.util" class="external-link">LinkedList</a>&lt;<a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&gt;</span>&nbsp;<span class="element-name">collectObjects</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;substr,
  418. boolean&nbsp;filterInactive)</span></div>
  419. <div class="block">Puts objects with a certain substring in their name into a LinkedLisrt and returns them.</div>
  420. <dl class="notes">
  421. <dt>Parameters:</dt>
  422. <dd><code>substr</code> - The string that must be part of the object name if object is to be
  423. considered found.</dd>
  424. <dd><code>filterInactive</code> - if set true only active objects are considered.</dd>
  425. <dt>Returns:</dt>
  426. <dd>a reference to a LinkedList filled with all objects that have <b>substr</b> in their name</dd>
  427. </dl>
  428. </section>
  429. </li>
  430. <li>
  431. <section class="detail" id="deleteObject(java.lang.String)">
  432. <h3>deleteObject</h3>
  433. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">deleteObject</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id)</span></div>
  434. <div class="block">Removes a graphics object from a level.</div>
  435. <dl class="notes">
  436. <dt>Parameters:</dt>
  437. <dd><code>id</code> - String The unique identifier of the object</dd>
  438. </dl>
  439. </section>
  440. </li>
  441. <li>
  442. <section class="detail" id="deleteObjectNow(java.lang.String)">
  443. <h3>deleteObjectNow</h3>
  444. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">deleteObjectNow</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id)</span></div>
  445. <div class="block">Removes a graphics object from a level immediately, CAUTION.</div>
  446. <dl class="notes">
  447. <dt>Parameters:</dt>
  448. <dd><code>id</code> - String The unique identifier of the object</dd>
  449. </dl>
  450. </section>
  451. </li>
  452. <li>
  453. <section class="detail" id="getObject(java.lang.String)">
  454. <h3>getObject</h3>
  455. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a></span>&nbsp;<span class="element-name">getObject</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id)</span></div>
  456. <div class="block">Retrieves a graphics object by name.</div>
  457. <dl class="notes">
  458. <dt>Parameters:</dt>
  459. <dd><code>id</code> - String Unique id of the object</dd>
  460. <dt>Returns:</dt>
  461. <dd>reference to the requested game object, or null if not found</dd>
  462. </dl>
  463. </section>
  464. </li>
  465. <li>
  466. <section class="detail" id="setGlobalFlag(java.lang.String,java.lang.Object)">
  467. <h3>setGlobalFlag</h3>
  468. <div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setGlobalFlag</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  469. <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>&nbsp;value)</span></div>
  470. <div class="block">Sets a level-wide permanent flag.</div>
  471. <dl class="notes">
  472. <dt>Parameters:</dt>
  473. <dd><code>flag</code> - String Q unique name in this level. If it exists value is overwritten.</dd>
  474. <dd><code>value</code> - Object Any Object can be the value of a flag!</dd>
  475. </dl>
  476. </section>
  477. </li>
  478. <li>
  479. <section class="detail" id="setLevelFlag(java.lang.String,java.lang.Object)">
  480. <h3>setLevelFlag</h3>
  481. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><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></span>&nbsp;<span class="element-name">setLevelFlag</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  482. <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>&nbsp;value)</span></div>
  483. </section>
  484. </li>
  485. <li>
  486. <section class="detail" id="resetFlags(int)">
  487. <h3>resetFlags</h3>
  488. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">resetFlags</span><wbr><span class="parameters">(int&nbsp;mode)</span></div>
  489. <div class="block">mode can be: FLAGS_ALL (all), FLAGS_GLOBAL(global), FLAGs_LEVEL(level)</div>
  490. <dl class="notes">
  491. <dt>Parameters:</dt>
  492. <dd><code>mode</code> - can be only one of <a href="#FLAGS_GLOBAL"><code>FLAGS_GLOBAL</code></a> <a href="#FLAGS_ALL"><code>FLAGS_ALL</code></a> or <a href="#FLAGS_LEVEL"><code>FLAGS_LEVEL</code></a></dd>
  493. </dl>
  494. </section>
  495. </li>
  496. <li>
  497. <section class="detail" id="getGlobalFlag(java.lang.String)">
  498. <h3>getGlobalFlag</h3>
  499. <div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><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></span>&nbsp;<span class="element-name">getGlobalFlag</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag)</span></div>
  500. <div class="block">Retrieves a level-wide flag by name.</div>
  501. <dl class="notes">
  502. <dt>Parameters:</dt>
  503. <dd><code>flag</code> - String Unique flag id</dd>
  504. <dt>Returns:</dt>
  505. <dd>the value associated with <b>flag</b>, or <b>null</b> if the flag does not exist.</dd>
  506. </dl>
  507. </section>
  508. </li>
  509. <li>
  510. <section class="detail" id="getOrCreateGlobalFlag(java.lang.String,java.lang.Object)">
  511. <h3>getOrCreateGlobalFlag</h3>
  512. <div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><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></span>&nbsp;<span class="element-name">getOrCreateGlobalFlag</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  513. <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>&nbsp;value)</span></div>
  514. <div class="block">checks for existence and if not creates the new global flag with the given initial value. Returns
  515. the value. afterwards it is guaranteed that no priorly existing value is overridden and that it
  516. definitely exists (created if not present before).</div>
  517. <dl class="notes">
  518. <dt>Parameters:</dt>
  519. <dd><code>flag</code> - String name for the global flag (created if not present)</dd>
  520. <dd><code>value</code> - Object value to be stored (used only if flag was not present)</dd>
  521. <dt>Returns:</dt>
  522. <dd>the current value of the flag (maybe the initial one in case flag was not there before)</dd>
  523. </dl>
  524. </section>
  525. </li>
  526. <li>
  527. <section class="detail" id="getLevelFlag(java.lang.String)">
  528. <h3>getLevelFlag</h3>
  529. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><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></span>&nbsp;<span class="element-name">getLevelFlag</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag)</span></div>
  530. </section>
  531. </li>
  532. <li>
  533. <section class="detail" id="getOrCreateLevelFlag(java.lang.String,java.lang.Object)">
  534. <h3>getOrCreateLevelFlag</h3>
  535. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><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></span>&nbsp;<span class="element-name">getOrCreateLevelFlag</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  536. <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>&nbsp;createValue)</span></div>
  537. </section>
  538. </li>
  539. <li>
  540. <section class="detail" id="reset()">
  541. <h3>reset</h3>
  542. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">reset</span>()</div>
  543. <div class="block">Reinitializes the level.</div>
  544. </section>
  545. </li>
  546. <li>
  547. <section class="detail" id="isPaused()">
  548. <h3>isPaused</h3>
  549. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isPaused</span>()</div>
  550. </section>
  551. </li>
  552. <li>
  553. <section class="detail" id="setPaused(boolean)">
  554. <h3>setPaused</h3>
  555. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setPaused</span><wbr><span class="parameters">(boolean&nbsp;p)</span></div>
  556. </section>
  557. </li>
  558. <li>
  559. <section class="detail" id="togglePause()">
  560. <h3>togglePause</h3>
  561. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">togglePause</span>()</div>
  562. </section>
  563. </li>
  564. <li>
  565. <section class="detail" id="processKeyEvents(java.util.Stack)">
  566. <h3>processKeyEvents</h3>
  567. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">processKeyEvents</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<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>&gt;&nbsp;keyEvents)</span></div>
  568. <div class="block">Method meant to be filled with own code, processes Keyboard inputs.</div>
  569. <dl class="notes">
  570. <dt>Parameters:</dt>
  571. <dd><code>keyEvents</code> - all collected <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"><code>KeyEvent</code></a>s collected since last game loop.</dd>
  572. </dl>
  573. </section>
  574. </li>
  575. <li>
  576. <section class="detail" id="processMouseEvents(java.util.Stack)">
  577. <h3>processMouseEvents</h3>
  578. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">processMouseEvents</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.desktop/java/awt/event/MouseEvent.html" title="class or interface in java.awt.event" class="external-link">MouseEvent</a>&gt;&nbsp;mouseEvents)</span></div>
  579. </section>
  580. </li>
  581. <li>
  582. <section class="detail" id="getKeyEvents()">
  583. <h3>getKeyEvents</h3>
  584. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<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>&gt;</span>&nbsp;<span class="element-name">getKeyEvents</span>()</div>
  585. </section>
  586. </li>
  587. <li>
  588. <section class="detail" id="getMouseEvents()">
  589. <h3>getMouseEvents</h3>
  590. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.desktop/java/awt/event/MouseEvent.html" title="class or interface in java.awt.event" class="external-link">MouseEvent</a>&gt;</span>&nbsp;<span class="element-name">getMouseEvents</span>()</div>
  591. </section>
  592. </li>
  593. <li>
  594. <section class="detail" id="applyGameLogic()">
  595. <h3>applyGameLogic</h3>
  596. <div class="member-signature"><span class="modifiers">public abstract</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">applyGameLogic</span>()</div>
  597. <div class="block">Method meant to be filled with own code, handles the entore game logic (collision checks, timed
  598. events, ...).</div>
  599. </section>
  600. </li>
  601. <li>
  602. <section class="detail" id="prepareLevel(java.lang.String)">
  603. <h3>prepareLevel</h3>
  604. <div class="member-signature"><span class="modifiers">public abstract</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">prepareLevel</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;level)</span></div>
  605. <div class="block">Sets up a single level. Prepares all objects etc.</div>
  606. <dl class="notes">
  607. <dt>Parameters:</dt>
  608. <dd><code>level</code> - String a string identifying the level number etc</dd>
  609. </dl>
  610. </section>
  611. </li>
  612. <li>
  613. <section class="detail" id="gameOver()">
  614. <h3>gameOver</h3>
  615. <div class="member-signature"><span class="modifiers">public abstract</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">gameOver</span>()</div>
  616. </section>
  617. </li>
  618. <li>
  619. <section class="detail" id="levelFinished()">
  620. <h3>levelFinished</h3>
  621. <div class="member-signature"><span class="modifiers">public abstract</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">levelFinished</span>()</div>
  622. </section>
  623. </li>
  624. <li>
  625. <section class="detail" id="getSizeX()">
  626. <h3>getSizeX</h3>
  627. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getSizeX</span>()</div>
  628. </section>
  629. </li>
  630. <li>
  631. <section class="detail" id="getSizeY()">
  632. <h3>getSizeY</h3>
  633. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getSizeY</span>()</div>
  634. </section>
  635. </li>
  636. <li>
  637. <section class="detail" id="updateObjects()">
  638. <h3>updateObjects</h3>
  639. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">updateObjects</span>()</div>
  640. <div class="block">Calls all object update methods in level. Internal, never call directly.</div>
  641. </section>
  642. </li>
  643. <li>
  644. <section class="detail" id="setTimestep(double)">
  645. <h3>setTimestep</h3>
  646. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setTimestep</span><wbr><span class="parameters">(double&nbsp;s)</span></div>
  647. </section>
  648. </li>
  649. <li>
  650. <section class="detail" id="getTimestep()">
  651. <h3>getTimestep</h3>
  652. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getTimestep</span>()</div>
  653. </section>
  654. </li>
  655. <li>
  656. <section class="detail" id="setGameTime(double)">
  657. <h3>setGameTime</h3>
  658. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setGameTime</span><wbr><span class="parameters">(double&nbsp;s)</span></div>
  659. <div class="block">set the game time value (in seconds)</div>
  660. <dl class="notes">
  661. <dt>Parameters:</dt>
  662. <dd><code>s</code> - seconds the game is running</dd>
  663. </dl>
  664. </section>
  665. </li>
  666. <li>
  667. <section class="detail" id="getGameTime()">
  668. <h3>getGameTime</h3>
  669. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getGameTime</span>()</div>
  670. <div class="block">returns time in seconds since level start</div>
  671. </section>
  672. </li>
  673. <li>
  674. <section class="detail" id="redrawLevel(java.awt.Graphics2D)">
  675. <h3>redrawLevel</h3>
  676. <div class="member-signature"><span class="modifiers">public abstract</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">redrawLevel</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.desktop/java/awt/Graphics2D.html" title="class or interface in java.awt" class="external-link">Graphics2D</a>&nbsp;g2)</span></div>
  677. <div class="block">To be redefined!! Draws mainly h level background and global information like points etc.</div>
  678. <dl class="notes">
  679. <dt>Parameters:</dt>
  680. <dd><code>g2</code> - Graphics2D abstract drawing object of java Swing, used to carry out all drawing
  681. operations.</dd>
  682. </dl>
  683. </section>
  684. </li>
  685. <li>
  686. <section class="detail" id="redraw(java.awt.Graphics2D)">
  687. <h3>redraw</h3>
  688. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">redraw</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.desktop/java/awt/Graphics2D.html" title="class or interface in java.awt" class="external-link">Graphics2D</a>&nbsp;g2)</span></div>
  689. <div class="block">Internal, do not call directly.</div>
  690. <dl class="notes">
  691. <dt>Parameters:</dt>
  692. <dd><code>g2</code> - Graphics2D abstract drawing object of java Swing, used to carry out all drawing
  693. operations.</dd>
  694. </dl>
  695. </section>
  696. </li>
  697. </ul>
  698. </section>
  699. </li>
  700. </ul>
  701. </section>
  702. <!-- ========= END OF CLASS DATA ========= -->
  703. </main>
  704. </div>
  705. </div>
  706. </body>
  707. </html>