aboutsummaryrefslogtreecommitdiffstats
path: root/inc/account.inc
diff options
context:
space:
mode:
authoralexichi <alexbankai96@gmail.com>2016-05-11 11:56:19 +0200
committeralexichi <alexbankai96@gmail.com>2016-05-11 11:56:19 +0200
commit35efaf74e828b738a20324a664cf9c2e08ef47d4 (patch)
tree183b4704c87c61b690010efbd6f3b30218328bcc /inc/account.inc
parent2350d43a09495db18b22b86ffc815a84eeb35579 (diff)
parent1158d2063f00f38de19a4600566b244a942d86ba (diff)
downloadcandybox-35efaf74e828b738a20324a664cf9c2e08ef47d4.tar.gz
candybox-35efaf74e828b738a20324a664cf9c2e08ef47d4.tar.bz2
candybox-35efaf74e828b738a20324a664cf9c2e08ef47d4.tar.xz
candybox-35efaf74e828b738a20324a664cf9c2e08ef47d4.zip
Merge branch 'master' of piernov.org:candybox into alexichialexichi
Conflicts: inc/perso.inc
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;
}