diff options
author | piernov <piernov@piernov.org> | 2016-05-10 22:24:50 +0200 |
---|---|---|
committer | piernov <piernov@piernov.org> | 2016-05-10 22:24:50 +0200 |
commit | 9ad61ab6a23bd6fd51e67b85d743b4a7664ec637 (patch) | |
tree | 04c4ef3158c9848db91e56f9318162431a6040b4 /inc/guild.inc | |
parent | 204e838a7794bbce0d44fc35efb367abb052d02f (diff) | |
parent | 1e52affe15fb13e920f8942de998073238be6d01 (diff) | |
download | candybox-9ad61ab6a23bd6fd51e67b85d743b4a7664ec637.tar.gz candybox-9ad61ab6a23bd6fd51e67b85d743b4a7664ec637.tar.bz2 candybox-9ad61ab6a23bd6fd51e67b85d743b4a7664ec637.tar.xz candybox-9ad61ab6a23bd6fd51e67b85d743b4a7664ec637.zip |
Merge branch 'phpdoc' into piernov
Diffstat (limited to 'inc/guild.inc')
-rw-r--r-- | inc/guild.inc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/inc/guild.inc b/inc/guild.inc index c0e8264..f4c10af 100644 --- a/inc/guild.inc +++ b/inc/guild.inc @@ -1,8 +1,27 @@ <?php +/** + * Manages miners guild. + * + * @package inc\guild.inc + * @author Alexandre Renoux + * @author Pierre-Emmanuel Novac + */ +/** + * Amount of gold required to build the miners guild. + */ define("GUILD_COST",10); +/** + * Amount of gold required to hire a miner. + */ define("MINER_COST",5); +/** + * Create the miners guild in the session. + * Debits GUILD_COST from the player's gold. + * + * @return void + */ function createGuild(){ if(!empty($_SESSION["guild"])) { sendError("guild_already_built"); @@ -13,6 +32,12 @@ function createGuild(){ } } +/** + * Hire one miner. + * Debits MINER_COST from the player's gold. + * + * @return void + */ function hireMiner(){ if(!isset($_SESSION["guild"])){ sendError("guild_not_yet_created"); @@ -23,6 +48,11 @@ function hireMiner(){ } } +/** + * Returns the number of miners currently in the guild. + * + * @return int number of miners in the guild + */ function sendMiners(){ return $_SESSION["mine"]["miners"]; } |