Ajoute les commentaires et la documentation RDoc

This commit is contained in:
julien committed 2026-10-08 19:42:56 +02:00
1 parent 5cf2d683e7
commit dbd8c51412
56 files changed
+3601 -17

No files matched your search

+331
View File
@@ -0,0 +1,331 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>class Player - RDoc Documentation</title>
<meta name="keywords" content="ruby,class,Player">
<meta name="description" content="class Player: Représente un joueur, sa main et son score.">
<script type="text/javascript">
var rdoc_rel_prefix = "./";
var index_rel_prefix = "./";
</script>
<script src="./js/navigation.js" defer></script>
<script src="./js/search.js" defer></script>
<script src="./js/search_index.js" defer></script>
<script src="./js/searcher.js" defer></script>
<script src="./js/darkfish.js" defer></script>
<link href="./css/fonts.css" rel="stylesheet">
<link href="./css/rdoc.css" rel="stylesheet">
<body id="top" role="document" class="class">
<div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
<span aria-hidden="true">&#9776;</span>
</div>
<nav id="navigation" role="navigation">
<div id="project-navigation">
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
<h2>
<a href="./index.html" rel="home">Home</a>
</h2>
<div id="table-of-contents-navigation">
<a href="./table_of_contents.html#pages">Pages</a>
<a href="./table_of_contents.html#classes">Classes</a>
<a href="./table_of_contents.html#methods">Methods</a>
</div>
</div>
<div id="search-section" role="search" class="project-section initially-hidden">
<form action="#" method="get" accept-charset="utf-8">
<div id="search-field-wrapper">
<input id="search-field" role="combobox" aria-label="Search"
aria-autocomplete="list" aria-controls="search-results"
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
title="Type to search, Up and Down to navigate, Enter to load">
</div>
<ul id="search-results" aria-label="Search Results"
aria-busy="false" aria-expanded="false"
aria-atomic="false" class="initially-hidden"></ul>
</form>
</div>
</div>
<div id="parent-class-section" class="nav-section">
<h3>Ancestors</h3>
<ul><li>Object</li></ul>
</div>
<div class="nav-section">
<h3>Class Methods</h3>
<ul class="link-list" role="directory">
<li ><a href="#method-c-new">new</a></li>
</ul>
</div>
<div class="nav-section">
<h3>Instance Methods</h3>
<ul class="link-list" role="directory">
<li ><a href="#method-i-add_point">add_point</a></li>
<li ><a href="#method-i-clear_hand">clear_hand</a></li>
<li ><a href="#method-i-play">play</a></li>
<li ><a href="#method-i-receive">receive</a></li>
</ul>
</div>
<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.14.0.
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>
</nav>
<main role="main" aria-labelledby="class-Player">
<h1 id="class-Player" class="anchor-link class">
class Player
</h1>
<section class="description">
<p>Représente un joueur, sa main et son score.</p>
</section>
<section id="5Buntitled-5D" class="documentation-section anchor-link">
<section class="attribute-method-details" class="method-section">
<header>
<h3>Attributes</h3>
</header>
<div id="attribute-i-hand" class="method-detail anchor-link">
<div class="method-heading attribute-method-heading">
<a href="#attribute-i-hand" title="Link to this attribute">
<span class="method-name">hand</span>
<span class="attribute-access-type">[R]</span>
</a>
</div>
<div class="method-description">
</div>
</div>
<div id="attribute-i-name" class="method-detail anchor-link">
<div class="method-heading attribute-method-heading">
<a href="#attribute-i-name" title="Link to this attribute">
<span class="method-name">name</span>
<span class="attribute-access-type">[R]</span>
</a>
</div>
<div class="method-description">
</div>
</div>
<div id="attribute-i-score" class="method-detail anchor-link">
<div class="method-heading attribute-method-heading">
<a href="#attribute-i-score" title="Link to this attribute">
<span class="method-name">score</span>
<span class="attribute-access-type">[R]</span>
</a>
</div>
<div class="method-description">
</div>
</div>
</section>
<section id="public-class-5Buntitled-5D-method-details" class="method-section anchor-link">
<header>
<h3>Public Class Methods</h3>
</header>
<div id="method-c-new" class="method-detail anchor-link ">
<div class="method-header">
<div class="method-heading">
<a href="#method-c-new" title="Link to this method">
<span class="method-name">new</span>
<span class="method-args">(name)</span>
</a>
</div>
</div>
<div class="method-controls">
<details class="method-source-toggle">
<summary>Source</summary>
</details>
</div>
<div class="method-description">
<div class="method-source-code" id="new-source">
<pre><span class="ruby-comment"># File lib/player.rb, line 5</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
<span class="ruby-ivar">@hand</span> = []
<span class="ruby-ivar">@score</span> = <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</section>
<section id="public-instance-5Buntitled-5D-method-details" class="method-section anchor-link">
<header>
<h3>Public Instance Methods</h3>
</header>
<div id="method-i-add_point" class="method-detail anchor-link ">
<div class="method-header">
<div class="method-heading">
<a href="#method-i-add_point" title="Link to this method">
<span class="method-name">add_point</span>
<span class="method-args">()</span>
</a>
</div>
</div>
<div class="method-controls">
<details class="method-source-toggle">
<summary>Source</summary>
</details>
</div>
<div class="method-description">
<div class="method-source-code" id="add_point-source">
<pre><span class="ruby-comment"># File lib/player.rb, line 27</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_point</span>
<span class="ruby-ivar">@score</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
<span class="ruby-keyword">end</span></pre>
</div>
<p>Ajoute un point au joueur.</p>
</div>
</div>
<div id="method-i-clear_hand" class="method-detail anchor-link ">
<div class="method-header">
<div class="method-heading">
<a href="#method-i-clear_hand" title="Link to this method">
<span class="method-name">clear_hand</span>
<span class="method-args">()</span>
</a>
</div>
</div>
<div class="method-controls">
<details class="method-source-toggle">
<summary>Source</summary>
</details>
</div>
<div class="method-description">
<div class="method-source-code" id="clear_hand-source">
<pre><span class="ruby-comment"># File lib/player.rb, line 17</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear_hand</span>
<span class="ruby-ivar">@hand</span>.<span class="ruby-identifier">clear</span>
<span class="ruby-keyword">end</span></pre>
</div>
<p>Vide la main du joueur.</p>
</div>
</div>
<div id="method-i-play" class="method-detail anchor-link ">
<div class="method-header">
<div class="method-heading">
<a href="#method-i-play" title="Link to this method">
<span class="method-name">play</span>
<span class="method-args">(card)</span>
</a>
</div>
</div>
<div class="method-controls">
<details class="method-source-toggle">
<summary>Source</summary>
</details>
</div>
<div class="method-description">
<div class="method-source-code" id="play-source">
<pre><span class="ruby-comment"># File lib/player.rb, line 22</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">play</span>(<span class="ruby-identifier">card</span>)
<span class="ruby-ivar">@hand</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">card</span>)
<span class="ruby-keyword">end</span></pre>
</div>
<p>Retire une carte de la main du joueur.</p>
</div>
</div>
<div id="method-i-receive" class="method-detail anchor-link ">
<div class="method-header">
<div class="method-heading">
<a href="#method-i-receive" title="Link to this method">
<span class="method-name">receive</span>
<span class="method-args">(card)</span>
</a>
</div>
</div>
<div class="method-controls">
<details class="method-source-toggle">
<summary>Source</summary>
</details>
</div>
<div class="method-description">
<div class="method-source-code" id="receive-source">
<pre><span class="ruby-comment"># File lib/player.rb, line 12</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">receive</span>(<span class="ruby-identifier">card</span>)
<span class="ruby-ivar">@hand</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">card</span>
<span class="ruby-keyword">end</span></pre>
</div>
<p>Ajoute une carte à la main du joueur.</p>
</div>
</div>
</section>
</section>
</main>