cl-ggp/reference/index.html @ 621ae61499ab
cl-ggp: Update site.
| author | Steve Losh <steve@stevelosh.com> |
|---|---|
| date | Wed, 23 Mar 2016 16:24:01 +0000 |
| parents | (none) |
| children | 641956c66398 |
<!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <title> API Reference / cl-ggp</title> <link rel="stylesheet" href="../_dmedia/bootstrap.css"/> <link rel="stylesheet" href="../_dmedia/tango.css"/> <link rel="stylesheet/less" type="text/css" href="../_dmedia/style.less"/> <script src="../_dmedia/less.js" type="text/javascript"> </script> </head> <body class="content"> <div class="wrap"> <header><h1><a href="..">cl-ggp</a></h1></header> <div class="markdown"> <h1 id="api-reference"><a href="">API Reference</a></h1><p>The following is a list of all user-facing parts of <code>cl-ggp</code>.</p> <p>If there are backwards-incompatible changes to anything listed here, they will be noted in the changelog and the author will feel bad.</p> <p>Anything not listed here is subject to change at any time with no warning, so don't touch it.</p> <div class="toc"> <ul> <li><a href="#package-ggp">Package GGP</a><ul> <li><a href="#ggp-player-class">GGP-PLAYER (class)</a><ul> <li><a href="#slot-name">Slot NAME</a></li> <li><a href="#slot-port">Slot PORT</a></li> <li><a href="#slot-current-match">Slot CURRENT-MATCH</a></li> <li><a href="#slot-server">Slot SERVER</a></li> </ul> </li> <li><a href="#kill-player-function">KILL-PLAYER (function)</a></li> <li><a href="#player-select-move-generic-function">PLAYER-SELECT-MOVE (generic function)</a></li> <li><a href="#player-start-game-generic-function">PLAYER-START-GAME (generic function)</a></li> <li><a href="#player-stop-game-generic-function">PLAYER-STOP-GAME (generic function)</a></li> <li><a href="#player-update-game-generic-function">PLAYER-UPDATE-GAME (generic function)</a></li> <li><a href="#start-player-function">START-PLAYER (function)</a></li> </ul> </li> </ul></div> <h2 id="package-ggp">Package GGP</h2> <h3 id="ggp-player-class">GGP-PLAYER (class)</h3> <p>The base class for a GGP player. Custom players should extend this.</p> <h4 id="slot-name">Slot NAME</h4> <ul> <li>Allocation: INSTANCE</li> <li>Type: <code>STRING</code></li> <li>Reader: <code>PLAYER-NAME</code></li> </ul> <p>The name of the player.</p> <h4 id="slot-port">Slot PORT</h4> <ul> <li>Allocation: INSTANCE</li> <li>Type: <code>(INTEGER 0)</code></li> <li>Reader: <code>PLAYER-PORT</code></li> </ul> <p>The port the HTTP server should listen on.</p> <h4 id="slot-current-match">Slot CURRENT-MATCH</h4> <ul> <li>Allocation: INSTANCE</li> </ul> <p>The ID of the current match the player is playing, or <code>nil</code> if it is waiting. <strong>Do not touch this.</strong></p> <h4 id="slot-server">Slot SERVER</h4> <ul> <li>Allocation: INSTANCE</li> </ul> <p>The Clack server object of the player. <strong>Do not touch this.</strong> Use <code>start-player</code> and <code>kill-player</code> to start/stop the server safely.</p> <h3 id="kill-player-function">KILL-PLAYER (function)</h3> <div class="codehilite"><pre>(KILL-PLAYER PLAYER) </pre></div> <p>Kill the HTTP server for the given player.</p> <p>This will <strong>not</strong> be done gently. No cleanup will be performed if the player is in the middle of a game. Be careful.</p> <h3 id="player-select-move-generic-function">PLAYER-SELECT-MOVE (generic function)</h3> <div class="codehilite"><pre>(PLAYER-SELECT-MOVE PLAYER) </pre></div> <p>Called when it's time for the player to select a move to play.</p> <p>Must return a list/symbol of the GDL move to play. Note that any symbols in the move should be ones that are interned in the <code>GGP</code> package. The author is aware that this sucks and welcomes suggestions on how to make it less awful.</p> <h3 id="player-start-game-generic-function">PLAYER-START-GAME (generic function)</h3> <div class="codehilite"><pre>(PLAYER-START-GAME PLAYER RULES ROLE START-CLOCK PLAY-CLOCK) </pre></div> <p>Called when the game is started.</p> <p><code>rules</code> is a list of lists/symbols representing the GDL description of the game. Note that all symbols are interned in the <code>GGP</code> package.</p> <h3 id="player-stop-game-generic-function">PLAYER-STOP-GAME (generic function)</h3> <div class="codehilite"><pre>(PLAYER-STOP-GAME PLAYER) </pre></div> <p>Called when the game is stopped.</p> <p>This is a good place to do any teardown stuff your player might need, or maybe to suggest a GC to your Lisp implementation.</p> <h3 id="player-update-game-generic-function">PLAYER-UPDATE-GAME (generic function)</h3> <div class="codehilite"><pre>(PLAYER-UPDATE-GAME PLAYER MOVES) </pre></div> <p>Called after all player have made their moves.</p> <p><code>moves</code> will be a list of moves made by the players.</p> <h3 id="start-player-function">START-PLAYER (function)</h3> <div class="codehilite"><pre>(START-PLAYER PLAYER) </pre></div> <p>Start the HTTP server for the given player.</p> </div> <footer><p><i>Made with Lisp and love by <a href="http://stevelosh.com/">Steve Losh</a> in Reykjavík, Iceland.</i></p> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-15328874-3', 'auto'); ga('send', 'pageview'); </script></footer> </div> </body> </html>