Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some 'static' keywords. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions misc/module/table/table.game.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ function error($msg) {
class APP_DbObject extends APP_Object {
public $query;

function DbQuery($str) {
static function DbQuery($str) {
$this->query = $str;
echo "dbquery: $str\n";
}

function getUniqueValueFromDB($sql) {
static function getUniqueValueFromDB($sql) {
return 0;
}

Expand Down Expand Up @@ -154,11 +154,11 @@ public function __construct() {
/** Report gamename for translation function */
abstract protected function getGameName( );

function getActivePlayerId() {
static function getActivePlayerId() {
return 1;
}

function getActivePlayerName() {
static function getActivePlayerName() {
return "player1";
}

Expand All @@ -170,7 +170,7 @@ function getTablePreferences() {
return [ ];
}

function loadPlayersBasicInfos() {
static function loadPlayersBasicInfos() {
$default_colors = array ("ff0000","008000","0000ff","ffa500","4c1b5b" );
$values = array ();
$id = 1;
Expand All @@ -181,15 +181,15 @@ function loadPlayersBasicInfos() {
return $values;
}

protected function getCurrentPlayerId() {
protected static function getCurrentPlayerId() {
return 0;
}

protected function getCurrentPlayerName() {
protected static function getCurrentPlayerName() {
return '';
}

protected function getCurrentPlayerColor() {
protected static function getCurrentPlayerColor() {
return '';
}

Expand All @@ -202,27 +202,27 @@ function isCurrentPlayerZombie() {
* Setup correspondance "labels to id"
* @param [] $labels - map string -> int (label of state variable -> numeric id in the database)
*/
function initGameStateLabels($labels) {
static function initGameStateLabels($labels) {
}

function setGameStateInitialValue($value_label, $value_value) {
static function setGameStateInitialValue($value_label, $value_value) {
}

function getGameStateValue($value_label) {
static function getGameStateValue($value_label) {
return 0;
}

function setGameStateValue($value_label, $value_value) {
static function setGameStateValue($value_label, $value_value) {
}

function incGameStateValue($value_label, $increment) {
static function incGameStateValue($value_label, $increment) {
return 0;
}

/**
* Make the next player active (in natural order)
*/
protected function activeNextPlayer() {
protected static function activeNextPlayer() {
}

/**
Expand All @@ -237,7 +237,7 @@ protected function activePrevPlayer() {
* @param string $actionName
* @param boolean $bThrowException
*/
function checkAction($actionName, $bThrowException = true) {
static function checkAction($actionName, $bThrowException = true) {
}

function getNextPlayerTable() {
Expand All @@ -248,11 +248,11 @@ function getPrevPlayerTable() {
return 0;
}

function getPlayerAfter($player_id) {
static function getPlayerAfter($player_id) {
return 0;
}

function getPlayerBefore($player_id) {
static function getPlayerBefore($player_id) {
return 0;
}

Expand All @@ -264,7 +264,7 @@ function createPrevPlayerTable($players, $bLoop = true) {
return array ();
}

function notifyAllPlayers($type, $message, $args) {
static function notifyAllPlayers($type, $message, $args) {
$args2 = array ();
foreach ( $args as $key => $val ) {
$key = '${' . $key . '}';
Expand All @@ -275,47 +275,47 @@ function notifyAllPlayers($type, $message, $args) {
echo "\n";
}

function notifyPlayer($player_id, $notification_type, $notification_log, $notification_args) {
static function notifyPlayer($player_id, $notification_type, $notification_log, $notification_args) {
}

function getStatTypes() {
return array ();
}

function initStat($table_or_player, $name, $value, $player_id = null) {
static function initStat($table_or_player, $name, $value, $player_id = null) {
}

function setStat($value, $name, $player_id = null, $bDoNotLoop = false) {
static function setStat($value, $name, $player_id = null, $bDoNotLoop = false) {
echo "stat: $name=$value\n";
}

function incStat($delta, $name, $player_id = null) {
static function incStat($delta, $name, $player_id = null) {
}

function getStat($name, $player_id = null) {
static function getStat($name, $player_id = null) {
return 0;
}

function _($s) {
static function _($s) {
return $s;
}

function getPlayersNumber() {
return 2;
}

function reattributeColorsBasedOnPreferences($players, $colors) {
static function reattributeColorsBasedOnPreferences($players, $colors) {
}

function reloadPlayersBasicInfos() {
static function reloadPlayersBasicInfos() {
}

function getNew($deck_definition) {
static function getNew($deck_definition) {
}

// Give standard extra time to this player
// (standard extra time is a game option)
function giveExtraTime( $player_id, $specific_time=null ) {
static function giveExtraTime( $player_id, $specific_time=null ) {

}

Expand All @@ -334,7 +334,7 @@ function applyDbUpgradeToAllDB($sql) {
}


function getGameinfos() {
static function getGameinfos() {
unset($gameinfos);
require ('gameinfos.inc.php');
if (isset($gameinfos)) {
Expand Down Expand Up @@ -398,4 +398,4 @@ function getKeysWithMaximum( $array, $bWithMaximum=true ) {

function getKeyWithMaximum($array) {
return '';
}
}