aboutsummaryrefslogtreecommitdiffstats
path: root/inc/account.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/account.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/account.inc')
-rw-r--r--inc/account.inc19
1 files changed, 19 insertions, 0 deletions
diff --git a/inc/account.inc b/inc/account.inc
index 6f398bb..bfbd47b 100644
--- a/inc/account.inc
+++ b/inc/account.inc
@@ -1,6 +1,19 @@
<?php
+/**
+ * Manages player's account: debit and credit.
+ *
+ * @author Alexandre Renoux
+ * @author Pierre-Emmanuel Novac
+ */
+
require_once("messages.inc");
+/**
+ * Debits the account of a certain amount of gold.
+ *
+ * @param int $amount amount to debit
+ * @return boolean true if player had enough gold, false otherwise
+ */
function debitAccount($amount) {
if($_SESSION["mine"]["gold"] < $amount) {
sendError("gold_insufficient");
@@ -10,6 +23,12 @@ function debitAccount($amount) {
return true;
}
+/**
+ * Credits the account of a certain amount of gold.
+ *
+ * @param int $amount amount to credit
+ * @return void
+ */
function creditAccount($amount) {
$_SESSION["mine"]["gold"] += $amount;
}