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.

708 lines
56 KiB

  1. <!DOCTYPE HTML>
  2. <html lang="de">
  3. <head>
  4. <!-- Generated by javadoc (17) on Fri May 13 10:01:19 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-13">
  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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/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/javase/8/docs/api/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/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/javase/8/docs/api/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/javase/8/docs/api/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 considered
  423. 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
  427. name</dd>
  428. </dl>
  429. </section>
  430. </li>
  431. <li>
  432. <section class="detail" id="deleteObject(java.lang.String)">
  433. <h3>deleteObject</h3>
  434. <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/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id)</span></div>
  435. <div class="block">Removes a graphics object from a level.</div>
  436. <dl class="notes">
  437. <dt>Parameters:</dt>
  438. <dd><code>id</code> - String The unique identifier of the object</dd>
  439. </dl>
  440. </section>
  441. </li>
  442. <li>
  443. <section class="detail" id="deleteObjectNow(java.lang.String)">
  444. <h3>deleteObjectNow</h3>
  445. <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/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id)</span></div>
  446. <div class="block">Removes a graphics object from a level immediately, CAUTION.</div>
  447. <dl class="notes">
  448. <dt>Parameters:</dt>
  449. <dd><code>id</code> - String The unique identifier of the object</dd>
  450. </dl>
  451. </section>
  452. </li>
  453. <li>
  454. <section class="detail" id="getObject(java.lang.String)">
  455. <h3>getObject</h3>
  456. <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/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id)</span></div>
  457. <div class="block">Retrieves a graphics object by name.</div>
  458. <dl class="notes">
  459. <dt>Parameters:</dt>
  460. <dd><code>id</code> - String Unique id of the object</dd>
  461. <dt>Returns:</dt>
  462. <dd>reference to the requested game object, or null if not found</dd>
  463. </dl>
  464. </section>
  465. </li>
  466. <li>
  467. <section class="detail" id="setGlobalFlag(java.lang.String,java.lang.Object)">
  468. <h3>setGlobalFlag</h3>
  469. <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/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  470. <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;value)</span></div>
  471. <div class="block">Sets a level-wide permanent flag.</div>
  472. <dl class="notes">
  473. <dt>Parameters:</dt>
  474. <dd><code>flag</code> - String Q unique name in this level. If it exists value is overwritten.</dd>
  475. <dd><code>value</code> - Object Any Object can be the value of a flag!</dd>
  476. </dl>
  477. </section>
  478. </li>
  479. <li>
  480. <section class="detail" id="setLevelFlag(java.lang.String,java.lang.Object)">
  481. <h3>setLevelFlag</h3>
  482. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/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/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  483. <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;value)</span></div>
  484. </section>
  485. </li>
  486. <li>
  487. <section class="detail" id="resetFlags(int)">
  488. <h3>resetFlags</h3>
  489. <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>
  490. <div class="block">mode can be: FLAGS_ALL (all), FLAGS_GLOBAL(global), FLAGs_LEVEL(level)</div>
  491. <dl class="notes">
  492. <dt>Parameters:</dt>
  493. <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
  494. <a href="#FLAGS_LEVEL"><code>FLAGS_LEVEL</code></a></dd>
  495. </dl>
  496. </section>
  497. </li>
  498. <li>
  499. <section class="detail" id="getGlobalFlag(java.lang.String)">
  500. <h3>getGlobalFlag</h3>
  501. <div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/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/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag)</span></div>
  502. <div class="block">Retrieves a level-wide flag by name.</div>
  503. <dl class="notes">
  504. <dt>Parameters:</dt>
  505. <dd><code>flag</code> - String Unique flag id</dd>
  506. <dt>Returns:</dt>
  507. <dd>the value associated with <b>flag</b>, or <b>null</b> if the flag does not exist.</dd>
  508. </dl>
  509. </section>
  510. </li>
  511. <li>
  512. <section class="detail" id="getOrCreateGlobalFlag(java.lang.String,java.lang.Object)">
  513. <h3>getOrCreateGlobalFlag</h3>
  514. <div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/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/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  515. <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;value)</span></div>
  516. <div class="block">checks for existence and if not creates the new global flag with the given initial value. Returns the value.
  517. afterwards it is guaranteed that no priorly existing value is overridden and that it definitely exists (created if not present before).</div>
  518. <dl class="notes">
  519. <dt>Parameters:</dt>
  520. <dd><code>flag</code> - String name for the global flag (created if not present)</dd>
  521. <dd><code>value</code> - Object value to be stored (used only if flag was not present)</dd>
  522. <dt>Returns:</dt>
  523. <dd>the current value of the flag (maybe the initial one in case flag was not there before)</dd>
  524. </dl>
  525. </section>
  526. </li>
  527. <li>
  528. <section class="detail" id="getLevelFlag(java.lang.String)">
  529. <h3>getLevelFlag</h3>
  530. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/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/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag)</span></div>
  531. </section>
  532. </li>
  533. <li>
  534. <section class="detail" id="getOrCreateLevelFlag(java.lang.String,java.lang.Object)">
  535. <h3>getOrCreateLevelFlag</h3>
  536. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/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/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;flag,
  537. <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;createValue)</span></div>
  538. </section>
  539. </li>
  540. <li>
  541. <section class="detail" id="reset()">
  542. <h3>reset</h3>
  543. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">reset</span>()</div>
  544. <div class="block">Reinitializes the level.</div>
  545. </section>
  546. </li>
  547. <li>
  548. <section class="detail" id="isPaused()">
  549. <h3>isPaused</h3>
  550. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isPaused</span>()</div>
  551. </section>
  552. </li>
  553. <li>
  554. <section class="detail" id="setPaused(boolean)">
  555. <h3>setPaused</h3>
  556. <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>
  557. </section>
  558. </li>
  559. <li>
  560. <section class="detail" id="togglePause()">
  561. <h3>togglePause</h3>
  562. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">togglePause</span>()</div>
  563. </section>
  564. </li>
  565. <li>
  566. <section class="detail" id="processKeyEvents(java.util.Stack)">
  567. <h3>processKeyEvents</h3>
  568. <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/javase/8/docs/api/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&gt;&nbsp;keyEvents)</span></div>
  569. <div class="block">Method meant to be filled with own code, processes Keyboard inputs.</div>
  570. <dl class="notes">
  571. <dt>Parameters:</dt>
  572. <dd><code>keyEvents</code> - all collected <a href="https://docs.oracle.com/javase/8/docs/api/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>
  573. </dl>
  574. </section>
  575. </li>
  576. <li>
  577. <section class="detail" id="processMouseEvents(java.util.Stack)">
  578. <h3>processMouseEvents</h3>
  579. <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/javase/8/docs/api/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/MouseEvent.html" title="class or interface in java.awt.event" class="external-link">MouseEvent</a>&gt;&nbsp;mouseEvents)</span></div>
  580. </section>
  581. </li>
  582. <li>
  583. <section class="detail" id="getKeyEvents()">
  584. <h3>getKeyEvents</h3>
  585. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/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>
  586. </section>
  587. </li>
  588. <li>
  589. <section class="detail" id="getMouseEvents()">
  590. <h3>getMouseEvents</h3>
  591. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/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>
  592. </section>
  593. </li>
  594. <li>
  595. <section class="detail" id="applyGameLogic()">
  596. <h3>applyGameLogic</h3>
  597. <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>
  598. <div class="block">Method meant to be filled with own code, handles the entore game logic (collision checks, timed
  599. events, ...).</div>
  600. </section>
  601. </li>
  602. <li>
  603. <section class="detail" id="prepareLevel(java.lang.String)">
  604. <h3>prepareLevel</h3>
  605. <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/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;level)</span></div>
  606. <div class="block">Sets up a single level. Prepares all objects etc.</div>
  607. <dl class="notes">
  608. <dt>Parameters:</dt>
  609. <dd><code>level</code> - String a string identifying the level number etc</dd>
  610. </dl>
  611. </section>
  612. </li>
  613. <li>
  614. <section class="detail" id="gameOver()">
  615. <h3>gameOver</h3>
  616. <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>
  617. </section>
  618. </li>
  619. <li>
  620. <section class="detail" id="levelFinished()">
  621. <h3>levelFinished</h3>
  622. <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>
  623. </section>
  624. </li>
  625. <li>
  626. <section class="detail" id="getSizeX()">
  627. <h3>getSizeX</h3>
  628. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getSizeX</span>()</div>
  629. </section>
  630. </li>
  631. <li>
  632. <section class="detail" id="getSizeY()">
  633. <h3>getSizeY</h3>
  634. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getSizeY</span>()</div>
  635. </section>
  636. </li>
  637. <li>
  638. <section class="detail" id="updateObjects()">
  639. <h3>updateObjects</h3>
  640. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">updateObjects</span>()</div>
  641. <div class="block">Calls all object update methods in level. Internal, never call directly.</div>
  642. </section>
  643. </li>
  644. <li>
  645. <section class="detail" id="setTimestep(double)">
  646. <h3>setTimestep</h3>
  647. <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>
  648. </section>
  649. </li>
  650. <li>
  651. <section class="detail" id="getTimestep()">
  652. <h3>getTimestep</h3>
  653. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getTimestep</span>()</div>
  654. </section>
  655. </li>
  656. <li>
  657. <section class="detail" id="setGameTime(double)">
  658. <h3>setGameTime</h3>
  659. <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>
  660. <div class="block">set the game time value (in seconds)</div>
  661. <dl class="notes">
  662. <dt>Parameters:</dt>
  663. <dd><code>s</code> - seconds the game is running</dd>
  664. </dl>
  665. </section>
  666. </li>
  667. <li>
  668. <section class="detail" id="getGameTime()">
  669. <h3>getGameTime</h3>
  670. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getGameTime</span>()</div>
  671. <div class="block">returns time in seconds since level start</div>
  672. </section>
  673. </li>
  674. <li>
  675. <section class="detail" id="redrawLevel(java.awt.Graphics2D)">
  676. <h3>redrawLevel</h3>
  677. <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/javase/8/docs/api/java/awt/Graphics2D.html" title="class or interface in java.awt" class="external-link">Graphics2D</a>&nbsp;g2)</span></div>
  678. <div class="block">To be redefined!! Draws mainly h level background and global information like points etc.</div>
  679. <dl class="notes">
  680. <dt>Parameters:</dt>
  681. <dd><code>g2</code> - Graphics2D abstract drawing object of java Swing, used to carry out all drawing
  682. operations.</dd>
  683. </dl>
  684. </section>
  685. </li>
  686. <li>
  687. <section class="detail" id="redraw(java.awt.Graphics2D)">
  688. <h3>redraw</h3>
  689. <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/javase/8/docs/api/java/awt/Graphics2D.html" title="class or interface in java.awt" class="external-link">Graphics2D</a>&nbsp;g2)</span></div>
  690. <div class="block">Internal, do not call directly.</div>
  691. <dl class="notes">
  692. <dt>Parameters:</dt>
  693. <dd><code>g2</code> - Graphics2D abstract drawing object of java Swing, used to carry out all drawing
  694. operations.</dd>
  695. </dl>
  696. </section>
  697. </li>
  698. </ul>
  699. </section>
  700. </li>
  701. </ul>
  702. </section>
  703. <!-- ========= END OF CLASS DATA ========= -->
  704. </main>
  705. </div>
  706. </div>
  707. </body>
  708. </html>