名前

Games::Nintendo::Mario -- 飛び跳ねるイタリアの配管工クラス


概要

  use Games::Nintendo::Mario;
  my $hero = Games::Nintendo::Mario->new(name => 'Luigi');
  $hero->damage; # おっちんだときの音楽スタート


説明

This module provides a base class for representing the Mario Brothers from Nintendo's long-running Mario franchise of games. Each Mario object keeps track of the plumber's current state and can be damaged or given powerups to change his state.

このモジュールは、任天堂の長期ヒットゲームであるマリオシリーズに登場する マリオ兄弟を表す基底クラスを提供する。それぞれのマリオオブジェクトは この配管工の現在の状態を追跡し、ダメージを与えたり、パワーアップさせたり することで、その状態を変更できる。


メソッド

new
  my $hero = Games::Nintendo::Mario->new(name => 'Luigi');

The constructor for Mario objects takes two named parameters, name and state. name must be either ``Mario'' or ``Luigi'' and state must be ``normal''

マリオオブジェクトのコンストラクタは二つの名前付きパラメータ、namestateをとる。nameは``Mario''か``Luigi''のどちらかでなければならない。 stateは``normal''でなければならない。

If left undefined, name and state will default to ``Mario'' and ``normal'' respectively.

未定義のままの場合、namestateはデフォルトでそれぞれ ``Mario''と``normal''になる。

powerup
  $hero->powerup('hammer'); # これは動作しない

As the base Games::Nintendo::Mario class represents Mario from the original Mario Bros., there is no valid way to call this method. Subclasses representing Mario in other games may allow various powerup names to be passed.

基底となるGames::Nintendo::Marioクラスは、オリジナルのマリオブラザーズに 登場するマリオを表すので、このメソッドを呼び出すのは正しくない。別のゲームの マリオを表すサブクラスなら、様々なパワーアップの名前を渡すことが可能だ。

damage
  $hero->damage;

This method causes the object to react as if Mario has been attacked or damaged. In the base Games::Nintendo::Mario class, this will always result in his death.

このメソッドを使うとオブジェクトは、マリオが攻撃されたかダメージを受けた かのような反応を引き起こす。基底となるGames::Nintendo::Marioクラスに おいては、常にマリオの死を意味する。

state
  print $hero->state;
        
This method accesses the name of Mario's current state.

このメソッドは、マリオの現在の状態に対するアクセサである。

name
  print $hero->name;

This method returns the name of the plumber's current form. (In the base class, this is always the same as the name passed to the constructor.)

このメソッドは、配管工の現在の形態を返す(基底クラスにおいては、常に コンストラクタに渡した名前と同じになる)。

games
  if (grep /World/, $hero->games) { ... }

This returns a list of the games in which Mario behaved according to the model provided by this class.

このメソッドは、このクラスによって提供されるモデルに基づいてマリオが 活躍したゲームのリストを返す。


TODO

Games::Nintendo::Mario::Hearts base class for representing Marios that have hearts, like Mario from SMB2 or Wario. After that, of course, SMB2 and Wario classes.

ハートを持ったマリオ(スーパーマリオブラザーズ2やワリオに登場するマリオの ような)を表すGames::Nintendo::Mario::Hearts基底クラスをつくる。その後で、 もちろん、SMB2とWarioクラスをつくる。


作者

Ricardo SIGNES <rjbs@cpan.org>


著作権

Copyright 2003 by Ricardo Signes <rjbs@cpan.org>

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html