aboutsummaryrefslogtreecommitdiffstats
path: root/inc/account.inc
diff options
context:
space:
mode:
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;
}