Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion foogame.game.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ function actChangePreference($pref, $value)
Preferences::set($this->getCurrentPId(), $pref, $value);
}

function sendNotifications() {
// TODO
}

/////////////////////////////////////////////////////////////
// Exposing protected methods, please use at your own risk //
/////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -146,7 +150,7 @@ public function zombieTurn($state, $activePlayer)

if ($state['type'] === 'multipleactiveplayer') {
// Make sure player is in a non blocking status for role turn
$this->gamestate->setPlayerNonMultiactive($active_player, '');
$this->gamestate->setPlayerNonMultiactive($activePlayer, '');

return;
}
Expand Down
2 changes: 0 additions & 2 deletions modules/php/Core/Globals.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php
namespace FOO\Core;
use FOO\Core\Game;
use FOO\Managers\Players;

/*
* Globals
Expand Down
15 changes: 12 additions & 3 deletions modules/php/Core/Notifications.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<?php
namespace FOO\Core;
use FOO\Managers\Players;
use FOO\Helpers\Utils;
use FOO\Core\Globals;

class Notifications
{
Expand Down Expand Up @@ -65,6 +62,18 @@ protected static function updateArgs(&$args)
// }
// }
}

public static function clearTurn($currentPlayer, $notifIds){
// TODO
}

public static function refreshUI($datas) {
// TODO
}

public static function refreshHand($player, $ui) {
// TODO
}
}

?>
9 changes: 9 additions & 0 deletions modules/php/Helpers/Log.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace FOO\Helpers;
use FOO\Core\Game;
USE FOO\Core\Globals;
use FOO\Core\Notifications;
use FOO\Managers\Players;

Expand Down Expand Up @@ -290,4 +291,12 @@ public function clearUndoableStepNotifications($clearAll = false)
}
}
}

public function clearAll() {
// TODO
}

public function revertAll() {
// TODO
}
}
2 changes: 1 addition & 1 deletion modules/php/Managers/Cards.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function getOfPlayer($pId)
/**
* setupNewGame: create the deck of cards
*/
public function setupNewGame($players, $options)
public static function setupNewGame($players, $options)
{
$colors = [
CARD_BLUE => 9,
Expand Down
8 changes: 4 additions & 4 deletions modules/php/Managers/Players.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected static function cast($row)
return new \FOO\Models\Player($row);
}

public function setupNewGame($players, $options)
public static function setupNewGame($players, $options)
{
// Create players
$gameInfos = Game::get()->getGameinfos();
Expand Down Expand Up @@ -53,7 +53,7 @@ public function getCurrentId()
return Game::get()->getCurrentPId();
}

public function getAll()
public static function getAll()
{
$players = self::DB()->get(false);
return $players;
Expand Down Expand Up @@ -83,7 +83,7 @@ public function getActive()
return self::get();
}

public function getCurrent()
public static function getCurrent()
{
return self::get(self::getCurrentId());
}
Expand Down Expand Up @@ -117,7 +117,7 @@ public function count()
/*
* getUiData : get all ui data of all players
*/
public function getUiData($pId)
public static function getUiData($pId)
{
return self::getAll()->map(function ($player) use ($pId) {
return $player->jsonSerialize($pId);
Expand Down