本文整理汇总了PHP中Game::mapFilename方法的典型用法代码示例。如果您正苦于以下问题:PHP Game::mapFilename方法的具体用法?PHP Game::mapFilename怎么用?PHP Game::mapFilename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Game
的用法示例。
在下文中一共展示了Game::mapFilename方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mapHTML
function mapHTML()
{
global $User;
$mapTurn = $this->phase == 'Pre-game' || $this->phase == 'Diplomacy' ? $this->turn - 1 : $this->turn;
$smallmapLink = 'map.php?gameID=' . $this->id . '&turn=' . $mapTurn . ($User->options->value['showMoves'] == 'No' ? '&hideMoves' : '');
$largemapLink = $smallmapLink . '&mapType=large' . ($User->options->value['showMoves'] == 'No' ? '&hideMoves' : '');
$staticFilename = Game::mapFilename($this->id, $mapTurn, 'small');
if (file_exists($staticFilename) && $User->options->value['showMoves'] == 'Yes') {
$smallmapLink = STATICSRV . $staticFilename . '?nocache=' . rand(0, 99999);
}
$map = '
<div id="mapstore">
<img id="mapImage" src="' . $smallmapLink . '" alt=" " title="' . l_t('The small map for the current phase. If you are starting a new turn this will show the last turn\'s orders') . '" />
<p class="lightgrey" style="text-align:center">
<a class="mapnav" href="#" onClick="loadMap(' . $this->id . ',' . $mapTurn . ',-1); return false;">
<img id="Start" src="' . l_s('images/historyicons/Start_disabled.png') . '" alt="' . l_t('Start') . '" title="' . l_t('View the map from the first turn') . '" /></a>
<a class="mapnav" href="#" onClick="loadMapStep(' . $this->id . ',' . $mapTurn . ',-1); return false;"><img id="Backward" src="' . l_s('images/historyicons/Backward_disabled.png') . '" alt="' . l_t('Backward') . '" title="' . l_t('View the map from the previous turn') . '" /></a>
<!-- The following is the toggle for removing the movement arrows. Uncomment this section if you want the movement arrow toggle.
<a class="mapnav" href="#" onClick="toggleMoves(' . $this->id . ',' . $mapTurn . '); return false;"><img id="NoMoves" src="images/historyicons/hidemoves.png" alt="NoMoves" title="Toggle movement lines" />
</a> -->
<a id="LargeMapLink" class="mapnav" href="' . $largemapLink . '" target="_blank" class="light"><img src="' . l_s('images/historyicons/external.png') . '" alt="' . l_t('Open large map') . '" title="' . l_t('This button will open the large map in a new window. The large map shows all the moves, and is useful when the small map isn\'t clear enough.') . '" /></a></span>
<a class="mapnav" href="#" onClick="loadMapStep(' . $this->id . ',' . $mapTurn . ',1); return false;"><img id="Forward" src="' . l_s('images/historyicons/Forward_disabled.png') . '" alt="' . l_t('Forward') . '" title="' . l_t('View the map from the next turn') . '" /></a>
<a class="mapnav" href="#" onClick="loadMap(' . $this->id . ',' . $mapTurn . ',' . $mapTurn . '); return false;"><img id="End" src="' . l_s('images/historyicons/End_disabled.png') . '" alt="' . l_t('End') . '" title="' . l_t('View the map from the most recent turn') . '" /></a>' . ($this->Members->isJoined() ? '<a class="mapnav" href="#" onClick="togglePreview(' . $this->id . ',' . $mapTurn . '); return false;"><img id="Preview" src="images/historyicons/Preview.png" alt="PreviewMoves" title="Show server side stored orders on the map" /></a>' : '') . '
</p>
<p id="History" class="lightgrey"></p>
</div>
';
$this->mapJS($mapTurn);
return $map;
}
示例2: jsLiveBoardData
protected function jsLiveBoardData()
{
$jsonBoardDataFile = Game::mapFilename($this->gameID, $this->phase == 'Diplomacy' ? $this->turn - 1 : $this->turn, 'json');
if (!file_exists($jsonBoardDataFile)) {
$jsonBoardDataFile = 'map.php?gameID=' . $this->gameID . '&turn=' . $this->turn . '&phase=' . $this->phase . '&mapType=json' . (defined('DATC') ? '&DATC=1' : '') . '&nocache=' . rand(0, 1000);
} else {
$jsonBoardDataFile .= '?phase=' . $this->phase . '&nocache=' . rand(0, 10000);
}
return '<script type="text/javascript" src="' . STATICSRV . $jsonBoardDataFile . '"></script>';
}
示例3: round
* Territories colored, orders entered, units drawn on.
* Now add territory names, and game-over caption if finished
*/
// Territory names
$drawMap->addTerritoryNames();
if (DELETECACHE) {
$drawMap->caption(round(microtime(true) - $GLOBALS['scriptStartTime'], 2) . 'sec, DB-Out:' . $DB->getqueries . ', DB-In:' . $DB->putqueries . (function_exists('memory_get_usage') ? ', ' . round(memory_get_usage() / 1024 / 1024, 3) . 'MB' : ''));
} elseif ($Game->phase == 'Finished' and $turn == $latestTurn) {
$drawMap->caption($Game->gameovertxt(TRUE));
}
/*
* All done; save map to disk, then generate a new JavaScript list
* of available maps which includes the new map, and finally output
* the map which was saved.
*/
$filename = Game::mapFilename($Game->id, $turn);
if (HIDEMOVES) {
$filename = str_replace(".map", "-hideMoves.map", $filename);
}
if (defined('DATC') && $mapType != 'small') {
$drawMap->saveThumbnail($filename . '-thumb');
}
// colorCorrect Patch
if (COLORCORRECT) {
$filename = str_replace(".map", "-" . COLORCORRECT . ".map", $filename);
$drawMap->colorEnhance(COLORCORRECT);
}
// End colorCorrect Patch
// Add countrynames for colorblind:
if (COUNTRYNAMES) {
$filename = str_replace(".map", "-names.map", $filename);