|
리비전 24, 0.6 kB
(mefour에 의해 체크인됨, 16 년 전)
|
우태경
|
| Line | |
|---|
| 1 |
package com.androidside.demo.tetris; |
|---|
| 2 |
|
|---|
| 3 |
public class Square { |
|---|
| 4 |
|
|---|
| 5 |
int x, y; // X 醫��, Y 醫�� |
|---|
| 6 |
byte color; // ��� |
|---|
| 7 |
|
|---|
| 8 |
Square(int x, int y, byte color) { |
|---|
| 9 |
|
|---|
| 10 |
this.x = x; |
|---|
| 11 |
this.y = y; |
|---|
| 12 |
this.color = color; |
|---|
| 13 |
} |
|---|
| 14 |
|
|---|
| 15 |
int getX() { |
|---|
| 16 |
return x; |
|---|
| 17 |
} |
|---|
| 18 |
|
|---|
| 19 |
int getY() { |
|---|
| 20 |
return y; |
|---|
| 21 |
} |
|---|
| 22 |
|
|---|
| 23 |
byte getColor() { |
|---|
| 24 |
return color; |
|---|
| 25 |
} |
|---|
| 26 |
|
|---|
| 27 |
// ������ш���� ����� 議댁���� 寃��吏���� |
|---|
| 28 |
boolean isInBounds() { |
|---|
| 29 |
return (x >= 0 && x < Tetris4Android.COLS && y >= 0 && y < Tetris4Android.ROWS); |
|---|
| 30 |
} |
|---|
| 31 |
|
|---|
| 32 |
boolean isEqual(Square s) { |
|---|
| 33 |
|
|---|
| 34 |
return x == s.x && y == s.y && color == s.color; |
|---|
| 35 |
} |
|---|
| 36 |
} |
|---|