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.

287 lines
18 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <!DOCTYPE HTML>
  2. <html lang="de">
  3. <head>
  4. <!-- Generated by javadoc (17) on Tue Feb 15 08:42:59 CET 2022 -->
  5. <title>Game</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-02-15">
  9. <meta name="description" content="declaration: class: Game">
  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="package-summary.html">Package</a></li>
  36. <li class="nav-bar-cell1-rev">Class</li>
  37. <li><a href="package-tree.html">Tree</a></li>
  38. <li><a href="index-files/index-1.html">Index</a></li>
  39. <li><a href="help-doc.html#class">Help</a></li>
  40. </ul>
  41. </div>
  42. <div class="sub-nav">
  43. <div>
  44. <ul class="sub-nav-list">
  45. <li>Summary:&nbsp;</li>
  46. <li>Nested&nbsp;|&nbsp;</li>
  47. <li>Field&nbsp;|&nbsp;</li>
  48. <li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
  49. <li><a href="#method-summary">Method</a></li>
  50. </ul>
  51. <ul class="sub-nav-list">
  52. <li>Detail:&nbsp;</li>
  53. <li>Field&nbsp;|&nbsp;</li>
  54. <li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
  55. <li><a href="#method-detail">Method</a></li>
  56. </ul>
  57. </div>
  58. <div class="nav-list-search"><label for="search-input">SEARCH:</label>
  59. <input type="text" id="search-input" value="search" disabled="disabled">
  60. <input type="reset" id="reset-button" value="reset" disabled="disabled">
  61. </div>
  62. </div>
  63. <!-- ========= END OF TOP NAVBAR ========= -->
  64. <span class="skip-nav" id="skip-navbar-top"></span></nav>
  65. </header>
  66. <div class="flex-content">
  67. <main role="main">
  68. <!-- ======== START OF CLASS DATA ======== -->
  69. <div class="header">
  70. <h1 title="Class Game" class="title">Class Game</h1>
  71. </div>
  72. <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
  73. <div class="inheritance">Game</div>
  74. </div>
  75. <section class="class-description" id="class-description">
  76. <hr>
  77. <div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">Game</span>
  78. <span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
  79. </section>
  80. <section class="summary">
  81. <ul class="summary-list">
  82. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  83. <li>
  84. <section class="constructor-summary" id="constructor-summary">
  85. <h2>Constructor Summary</h2>
  86. <div class="caption"><span>Constructors</span></div>
  87. <div class="summary-table two-column-summary">
  88. <div class="table-header col-first">Constructor</div>
  89. <div class="table-header col-last">Description</div>
  90. <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">Game</a>()</code></div>
  91. <div class="col-last even-row-color">&nbsp;</div>
  92. </div>
  93. </section>
  94. </li>
  95. <!-- ========== METHOD SUMMARY =========== -->
  96. <li>
  97. <section class="method-summary" id="method-summary">
  98. <h2>Method Summary</h2>
  99. <div id="method-summary-table">
  100. <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-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>
  101. <div id="method-summary-table.tabpanel" role="tabpanel">
  102. <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
  103. <div class="table-header col-first">Modifier and Type</div>
  104. <div class="table-header col-second">Method</div>
  105. <div class="table-header col-last">Description</div>
  106. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
  107. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#checkDice(int,Player,int)" class="member-name-link">checkDice</a><wbr>(int&nbsp;dice,
  108. <a href="Player.html" title="class in Unnamed Package">Player</a>&nbsp;p,
  109. int&nbsp;countRolls)</code></div>
  110. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  111. <div class="block">Check if the Player is allowed to roll the dice again</div>
  112. </div>
  113. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
  114. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#checkFieldClear(int,Player,Game)" class="member-name-link">checkFieldClear</a><wbr>(int&nbsp;posToCheck,
  115. <a href="Player.html" title="class in Unnamed Package">Player</a>&nbsp;p,
  116. <a href="Game.html" title="class in Unnamed Package">Game</a>&nbsp;g)</code></div>
  117. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  118. <div class="block">Check if a target field is free or occupied by another figure</div>
  119. </div>
  120. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
  121. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#figureIsUsable(int,int,Player,Game)" class="member-name-link">figureIsUsable</a><wbr>(int&nbsp;dice,
  122. int&nbsp;figId,
  123. <a href="Player.html" title="class in Unnamed Package">Player</a>&nbsp;p,
  124. <a href="Game.html" title="class in Unnamed Package">Game</a>&nbsp;g)</code></div>
  125. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  126. <div class="block">Check if a figure is usable</div>
  127. </div>
  128. <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/17/docs/api/java.base/java/util/ArrayList.html" title="class or interface in java.util" class="external-link">ArrayList</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>&gt;</code></div>
  129. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getUsableFigures(int,Player,Game)" class="member-name-link">getUsableFigures</a><wbr>(int&nbsp;dice,
  130. <a href="Player.html" title="class in Unnamed Package">Player</a>&nbsp;p,
  131. <a href="Game.html" title="class in Unnamed Package">Game</a>&nbsp;g)</code></div>
  132. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  133. <div class="block">Get List of all usable Figures in the current Play for one Player</div>
  134. </div>
  135. <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
  136. <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#main(java.lang.String%5B%5D)" class="member-name-link">main</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;args)</code></div>
  137. <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
  138. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
  139. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setFigure(int,int,Player,Game)" class="member-name-link">setFigure</a><wbr>(int&nbsp;figId,
  140. int&nbsp;dice,
  141. <a href="Player.html" title="class in Unnamed Package">Player</a>&nbsp;p,
  142. <a href="Game.html" title="class in Unnamed Package">Game</a>&nbsp;g)</code></div>
  143. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  144. <div class="block">Set a figure on a field according</div>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. <div class="inherited-list">
  150. <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/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
  151. <code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/17/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/17/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/17/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/17/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/17/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/17/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/17/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/17/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/17/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/17/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>
  152. </section>
  153. </li>
  154. </ul>
  155. </section>
  156. <section class="details">
  157. <ul class="details-list">
  158. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  159. <li>
  160. <section class="constructor-details" id="constructor-detail">
  161. <h2>Constructor Details</h2>
  162. <ul class="member-list">
  163. <li>
  164. <section class="detail" id="&lt;init&gt;()">
  165. <h3>Game</h3>
  166. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">Game</span>()</div>
  167. </section>
  168. </li>
  169. </ul>
  170. </section>
  171. </li>
  172. <!-- ============ METHOD DETAIL ========== -->
  173. <li>
  174. <section class="method-details" id="method-detail">
  175. <h2>Method Details</h2>
  176. <ul class="member-list">
  177. <li>
  178. <section class="detail" id="main(java.lang.String[])">
  179. <h3>main</h3>
  180. <div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">main</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;args)</span>
  181. throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/InterruptedException.html" title="class or interface in java.lang" class="external-link">InterruptedException</a></span></div>
  182. <dl class="notes">
  183. <dt>Throws:</dt>
  184. <dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/InterruptedException.html" title="class or interface in java.lang" class="external-link">InterruptedException</a></code></dd>
  185. </dl>
  186. </section>
  187. </li>
  188. <li>
  189. <section class="detail" id="checkDice(int,Player,int)">
  190. <h3>checkDice</h3>
  191. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">checkDice</span><wbr><span class="parameters">(int&nbsp;dice,
  192. <a href="Player.html" title="class in Unnamed Package">Player</a>&nbsp;p,
  193. int&nbsp;countRolls)</span></div>
  194. <div class="block">Check if the Player is allowed to roll the dice again</div>
  195. <dl class="notes">
  196. <dt>Parameters:</dt>
  197. <dd><code>dice</code> - Value of dice got from rolldice()</dd>
  198. <dd><code>p</code> - active Player</dd>
  199. <dd><code>countRolls</code> - Counter how often the Player already rolled the dice</dd>
  200. <dt>Returns:</dt>
  201. <dd>true if Player can roll the dice another time</dd>
  202. </dl>
  203. </section>
  204. </li>
  205. <li>
  206. <section class="detail" id="checkFieldClear(int,Player,Game)">
  207. <h3>checkFieldClear</h3>
  208. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">checkFieldClear</span><wbr><span class="parameters">(int&nbsp;posToCheck,
  209. <a href="Player.html" title="class in Unnamed Package">Player</a>&nbsp;p,
  210. <a href="Game.html" title="class in Unnamed Package">Game</a>&nbsp;g)</span></div>
  211. <div class="block">Check if a target field is free or occupied by another figure</div>
  212. <dl class="notes">
  213. <dt>Parameters:</dt>
  214. <dd><code>posToCheck</code> - Target position to check</dd>
  215. <dd><code>p</code> - active Player</dd>
  216. <dd><code>g</code> - game instance</dd>
  217. <dt>Returns:</dt>
  218. <dd>2 - own Player 1 - another Player 0 - Field clear</dd>
  219. </dl>
  220. </section>
  221. </li>
  222. <li>
  223. <section class="detail" id="getUsableFigures(int,Player,Game)">
  224. <h3>getUsableFigures</h3>
  225. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/ArrayList.html" title="class or interface in java.util" class="external-link">ArrayList</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>&gt;</span>&nbsp;<span class="element-name">getUsableFigures</span><wbr><span class="parameters">(int&nbsp;dice,
  226. <a href="Player.html" title="class in Unnamed Package">Player</a>&nbsp;p,
  227. <a href="Game.html" title="class in Unnamed Package">Game</a>&nbsp;g)</span></div>
  228. <div class="block">Get List of all usable Figures in the current Play for one Player</div>
  229. <dl class="notes">
  230. <dt>Parameters:</dt>
  231. <dd><code>dice</code> - Value of dice got from rolldice()</dd>
  232. <dd><code>p</code> - active Player</dd>
  233. <dd><code>g</code> - game instance</dd>
  234. <dt>Returns:</dt>
  235. <dd>List of int with figIds the Player can choose from</dd>
  236. </dl>
  237. </section>
  238. </li>
  239. <li>
  240. <section class="detail" id="figureIsUsable(int,int,Player,Game)">
  241. <h3>figureIsUsable</h3>
  242. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">figureIsUsable</span><wbr><span class="parameters">(int&nbsp;dice,
  243. int&nbsp;figId,
  244. <a href="Player.html" title="class in Unnamed Package">Player</a>&nbsp;p,
  245. <a href="Game.html" title="class in Unnamed Package">Game</a>&nbsp;g)</span></div>
  246. <div class="block">Check if a figure is usable</div>
  247. <dl class="notes">
  248. <dt>Parameters:</dt>
  249. <dd><code>dice</code> - Value of dice got from rolldice()</dd>
  250. <dd><code>figId</code> - id of figure to check</dd>
  251. <dd><code>p</code> - active Player</dd>
  252. <dd><code>g</code> - game instance</dd>
  253. <dt>Returns:</dt>
  254. <dd>true if figure is usable</dd>
  255. </dl>
  256. </section>
  257. </li>
  258. <li>
  259. <section class="detail" id="setFigure(int,int,Player,Game)">
  260. <h3>setFigure</h3>
  261. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">setFigure</span><wbr><span class="parameters">(int&nbsp;figId,
  262. int&nbsp;dice,
  263. <a href="Player.html" title="class in Unnamed Package">Player</a>&nbsp;p,
  264. <a href="Game.html" title="class in Unnamed Package">Game</a>&nbsp;g)</span></div>
  265. <div class="block">Set a figure on a field according</div>
  266. <dl class="notes">
  267. <dt>Parameters:</dt>
  268. <dd><code>figId</code> - id of figure to check</dd>
  269. <dd><code>dice</code> - Value of dice got from rolldice()</dd>
  270. <dd><code>p</code> - active Player</dd>
  271. <dd><code>g</code> - game instance</dd>
  272. <dt>Returns:</dt>
  273. <dd>0 if no figure kicked. 1 if another figure was kicked</dd>
  274. </dl>
  275. </section>
  276. </li>
  277. </ul>
  278. </section>
  279. </li>
  280. </ul>
  281. </section>
  282. <!-- ========= END OF CLASS DATA ========= -->
  283. </main>
  284. </div>
  285. </div>
  286. </body>
  287. </html>