This is a documentation for Board Game Arena: play board games online !
Game material description: material.inc.php: 두 판 사이의 차이
둘러보기로 이동
검색으로 이동
Sourisdudesert (토론 | 기여) (Created page with "This PHP file describes all the material of your game. This file is include by the constructor of your main game logic (yourgame.game.php), and then the variables defined her...") |
Sourisdudesert (토론 | 기여) 편집 요약 없음 |
||
2번째 줄: | 2번째 줄: | ||
This file is include by the constructor of your main game logic (yourgame.game.php), and then the variables defined here are accessible everywhere in your game logic file. | This file is include by the constructor of your main game logic (yourgame.game.php), and then the variables defined here are accessible everywhere in your game logic file. | ||
Using material.inc.php makes your PHP logic file smaller and clean. | |||
Example from "Hearts": if you define this in material.inc.php: | Example from "Hearts": if you define this in material.inc.php: |
2013년 1월 11일 (금) 16:23 기준 최신판
This PHP file describes all the material of your game.
This file is include by the constructor of your main game logic (yourgame.game.php), and then the variables defined here are accessible everywhere in your game logic file.
Using material.inc.php makes your PHP logic file smaller and clean.
Example from "Hearts": if you define this in material.inc.php:
$this->colors = array( 1 => array( 'name' => clienttranslate('spade'), 'nametr' => self::_('spade') ), 2 => array( 'name' => clienttranslate('heart'), 'nametr' => self::_('heart') ), 3 => array( 'name' => clienttranslate('club'), 'nametr' => self::_('club') ), 4 => array( 'name' => clienttranslate('diamond'), 'nametr' => self::_('diamond') ) );
... you can access "$this->colors" everywhere in your PHP game logic file.