no message
This commit is contained in:
22
Question13-Inheritance/Ex03.php
Normal file
22
Question13-Inheritance/Ex03.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* [Ex03 オブジェクト指向 - Slimeクラスの利用]
|
||||
*
|
||||
* TODO:
|
||||
* 1. 既に実装済みの "common/Character.php"(namespace inheritance\Common を使用) は変更不要です。
|
||||
* 2. 新しく "common/Slime.php" を作成し、以下の仕様に従って Slime クラスを定義してください。
|
||||
* - クラス名: Slime
|
||||
* - Slime クラスは Common\Character クラスを継承すること。
|
||||
* - コンストラクタ内で、親クラスのコンストラクタを呼び出し、HP, POWER, ENDURANCE に
|
||||
* (50, 5, 2) の初期値を設定してください。
|
||||
*
|
||||
* 3. 本ファイル内で、require_once を使い "common/Slime.php" を読み込んでください。
|
||||
*
|
||||
* 4. namespace を利用して、inheritance\Common\Slime クラスを使用してください。
|
||||
*
|
||||
* 5. Common\Slime クラスのインスタンスを生成し、setName() メソッドを使って名前に "スライム" を設定してください。
|
||||
*
|
||||
* 6. その後、showParameter() メソッドを呼び出して、キャラクター情報を出力してください。
|
||||
*
|
||||
*/
|
||||
Reference in New Issue
Block a user