parent
d09a6719d7
commit
ef41cce8ed
@ -0,0 +1,48 @@
|
||||
package com.msb.model;/**
|
||||
* @Author bingor
|
||||
* @Date 2022/10/12 14:50
|
||||
* @Description: com.msb.model
|
||||
* @Version: 1.0
|
||||
*/
|
||||
|
||||
import com.msb.model.abstracts.GameObject;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
*@ClassName Wall
|
||||
*@Description TODO
|
||||
*@Author bingor
|
||||
*@Date 2022/10/12 14:50
|
||||
*@Version 3.0
|
||||
*/
|
||||
public class Wall extends GameObject {
|
||||
|
||||
private int width, height;
|
||||
private Rectangle rectangle;
|
||||
|
||||
public Wall(int x, int y, int width, int height) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.rectangle = new Rectangle(x, y, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
GameModel.getInstance().paint(g);
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public Rectangle getRectangle() {
|
||||
return rectangle;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue