クラス Tetromino

java.lang.Object
  |
  +--Model
        |
        +--Movable
              |
              +--Tetromino
すべての実装インタフェース:
java.lang.Cloneable
直系の既知のサブクラス:
Tetromino1, Tetromino2, Tetromino3, Tetromino4, Tetromino5, Tetromino6, Tetromino7

public class Tetromino
extends Movable
implements java.lang.Cloneable

テトロミノを表すクラス。4つのブロックによって構成される。

作成者:
新田直也

フィールドの概要
protected  Block[] blocks
          自分を構成するブロック
private  int cx
          中心点のx座標
private  int cy
          中心点のy座標
(パッケージプライベート) static int NUM_BLOCKS
           
 
コンストラクタの概要
(パッケージプライベート) Tetromino()
           
(パッケージプライベート) Tetromino(int px, int py)
           
 
メソッドの概要
(パッケージプライベート)  void clear(java.awt.Graphics gr)
          画面上で消す。
(パッケージプライベート)  void clear(java.awt.Graphics gr, int ofsX, int ofsY)
           
 java.lang.Object clone()
           
(パッケージプライベート)  void draw(java.awt.Graphics gr)
          描画する。
(パッケージプライベート)  Block[] getBlocks()
           
(パッケージプライベート)  int getX()
           
(パッケージプライベート)  int getY()
           
(パッケージプライベート)  void move(int mx, int my)
          ゲームの世界上で移動する。
(パッケージプライベート)  void rotateL()
           
(パッケージプライベート)  void rotateL(java.awt.Graphics gr)
           
(パッケージプライベート)  void rotateR()
           
(パッケージプライベート)  void rotateR(java.awt.Graphics gr)
           
(パッケージプライベート)  void setBlocks(Block[] blks)
           
(パッケージプライベート)  void setX(int x)
           
(パッケージプライベート)  void setY(int y)
           
(パッケージプライベート)  void view(java.awt.Graphics gr, int ofsX, int ofsY)
           
 
クラス Movable から継承したメソッド
move
 
クラス java.lang.Object から継承したメソッド
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

NUM_BLOCKS

static final int NUM_BLOCKS
関連項目:
定数フィールド値

cx

private int cx
中心点のx座標


cy

private int cy
中心点のy座標


blocks

protected Block[] blocks
自分を構成するブロック

コンストラクタの詳細

Tetromino

Tetromino()

Tetromino

Tetromino(int px,
          int py)
メソッドの詳細

clone

public java.lang.Object clone()
オーバーライド:
クラス Movable 内の clone

setX

void setX(int x)

getX

int getX()

setY

void setY(int y)

getY

int getY()

setBlocks

void setBlocks(Block[] blks)

getBlocks

Block[] getBlocks()

move

void move(int mx,
          int my)
クラス Movable の記述:
ゲームの世界上で移動する。

定義:
クラス Movable 内の move
パラメータ:
mx - x方向の移動量
my - y方向の移動量

draw

void draw(java.awt.Graphics gr)
クラス Model の記述:
描画する。

定義:
クラス Model 内の draw
パラメータ:
gr - 描画対象

view

void view(java.awt.Graphics gr,
          int ofsX,
          int ofsY)

clear

void clear(java.awt.Graphics gr)
クラス Model の記述:
画面上で消す。

定義:
クラス Model 内の clear
パラメータ:
gr - 描画対象

clear

void clear(java.awt.Graphics gr,
           int ofsX,
           int ofsY)

rotateR

void rotateR()

rotateR

void rotateR(java.awt.Graphics gr)

rotateL

void rotateL()

rotateL

void rotateL(java.awt.Graphics gr)