aboutsummaryrefslogtreecommitdiffstats
path: root/inc/guild.inc
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-05-08 20:14:40 +0200
committerpiernov <piernov@piernov.org>2016-05-08 20:14:40 +0200
commitfaefddcb8b3d3ac491331b702f8a8ac6fe58a894 (patch)
tree106ee88e861eae0fc9c783243db3668e8c9c8ae1 /inc/guild.inc
parentf1677164c3f46785f6d9380b68cdeba58a680404 (diff)
downloadcandybox-faefddcb8b3d3ac491331b702f8a8ac6fe58a894.tar.gz
candybox-faefddcb8b3d3ac491331b702f8a8ac6fe58a894.tar.bz2
candybox-faefddcb8b3d3ac491331b702f8a8ac6fe58a894.tar.xz
candybox-faefddcb8b3d3ac491331b702f8a8ac6fe58a894.zip
First PHPDoc push, Inventory not complete
Diffstat (limited to 'inc/guild.inc')
-rw-r--r--inc/guild.inc29
1 files changed, 29 insertions, 0 deletions
diff --git a/inc/guild.inc b/inc/guild.inc
index c0e8264..f348348 100644
--- a/inc/guild.inc
+++ b/inc/guild.inc
@@ -1,8 +1,26 @@
<?php
+/**
+ * Manages miners guild.
+ *
+ * @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 +31,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 +47,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"];
}