當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Stat::getAll方法代碼示例

本文整理匯總了PHP中Stat::getAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Stat::getAll方法的具體用法?PHP Stat::getAll怎麽用?PHP Stat::getAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Stat的用法示例。


在下文中一共展示了Stat::getAll方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testSave

 function testSave()
 {
     //Arrange
     $str = 2;
     $dex = 2;
     $con = 2;
     $intel = 2;
     $wis = 2;
     $cha = 2;
     $init = 2;
     $max_hp = 2;
     $speed = 2;
     $ac = 2;
     $acrobatics = 2;
     $arcana = 2;
     $animal_handling = 2;
     $athletics = 2;
     $deception = 2;
     $history = 2;
     $insight = 2;
     $intimidation = 2;
     $investigation = 2;
     $medicine = 2;
     $nature = 2;
     $perception = 2;
     $performance = 2;
     $persuasion = 2;
     $proficiency = 2;
     $religion = 2;
     $sleight_of_hand = 2;
     $stealth = 2;
     $survival = 2;
     $test_stat = new Stat($ac, $acrobatics, $animal_handling, $arcana, $athletics, $cha, $con, $deception, $dex, $history, $init, $insight, $intel, $intimidation, $investigation, $max_hp, $medicine, $nature, $perception, $performance, $persuasion, $proficiency, $religion, $speed, $sleight_of_hand, $stealth, $str, $survival, $wis);
     //Act
     $test_stat->save();
     //Assert
     $result = Stat::getAll();
     $this->assertEquals($test_stat, $result[0]);
 }
開發者ID:civilianemail,項目名稱:dnd,代碼行數:39,代碼來源:StatTest.php

示例2: find

 static function find($search_id)
 {
     $found_stat = null;
     $stats = Stat::getAll();
     foreach ($stats as $stat) {
         $stat_id = $stat->getId();
         if ($stat_id == $search_id) {
             $found_stat = $stat;
         }
     }
     return $found_stat;
 }
開發者ID:civilianemail,項目名稱:dnd,代碼行數:12,代碼來源:Stat.php

示例3: array

    $_SESSION['class'] = $_POST['class_id'];
    return $app['twig']->render('background.html.twig', array('backgrounds' => Background::getAll()));
});
//background page
//carry race id, class id, background id to stats page
$app->post('/stats', function () use($app) {
    $_SESSION['background'] = $_POST['background_id'];
    $race_id = $_SESSION['race'];
    $race_find = Race::find($race_id);
    $race = getName($race_find);
    $class_id = $_SESSION['class'];
    $class_find = CharClass::find($class_id);
    $classname = getName($class_find);
    $stats = statRoll();
    $assigned_stats = assignRolls($six_rolls, $classname, $race);
    return $app['twig']->render('stats.html.twig', array('stat' => Stat::getAll()));
});
//stats page
//carry race id, class id, background id, stats id to skills page
$app->post('/bio', function () use($app) {
    $_SESSION['str'] = $_POST['str_id'];
    $_SESSION['dex'] = $_POST['dex_id'];
    $_SESSION['con'] = $_POST['con_id'];
    $_SESSION['int'] = $_POST['int_id'];
    $_SESSION['wis'] = $_POST['wis_id'];
    $_SESSION['cha'] = $_POST['cha_id'];
    return $app['twig']->render('bio.html.twig');
});
//bio page
//render bio page
$app->get('/bio', function () use($app) {
開發者ID:Camolot,項目名稱:dnd,代碼行數:31,代碼來源:app.php


注:本文中的Stat::getAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。