aboutsummaryrefslogtreecommitdiffstats
path: root/inc/account.inc
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-05-10 22:24:50 +0200
committerpiernov <piernov@piernov.org>2016-05-10 22:24:50 +0200
commit9ad61ab6a23bd6fd51e67b85d743b4a7664ec637 (patch)
tree04c4ef3158c9848db91e56f9318162431a6040b4 /inc/account.inc
parent204e838a7794bbce0d44fc35efb367abb052d02f (diff)
parent1e52affe15fb13e920f8942de998073238be6d01 (diff)
downloadcandybox-9ad61ab6a23bd6fd51e67b85d743b4a7664ec637.tar.gz
candybox-9ad61ab6a23bd6fd51e67b85d743b4a7664ec637.tar.bz2
candybox-9ad61ab6a23bd6fd51e67b85d743b4a7664ec637.tar.xz
candybox-9ad61ab6a23bd6fd51e67b85d743b4a7664ec637.zip
Merge branch 'phpdoc' into piernov
Diffstat (limited to 'inc/account.inc')
-rw-r--r--inc/account.inc20
1 files changed, 20 insertions, 0 deletions
diff --git a/inc/account.inc b/inc/account.inc
index 6f398bb..f7e3c05 100644
--- a/inc/account.inc
+++ b/inc/account.inc
@@ -1,6 +1,20 @@
<?php
+/**
+ * Manages player's account: debit and credit.
+ *
+ * @package inc\account.inc
+ * @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 +24,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;
}