piece.java

来自「自己写的monopoly 游戏代码」· Java 代码 · 共 39 行

JAVA
39
字号
package com.xmu.typot.domain;

import java.awt.Graphics2D;
import java.awt.image.BufferedImage;

public class Piece {
	
	private Square location;
	private BufferedImage bf;
	public Piece(Square location, BufferedImage bf)
	{
		this.location=location;
		this.bf = bf;
	}
	
	public Square getLocation()
	{
		return location;
	}
	
	public void setLocation(Square location)
	{
		this.location=location;
	}

	public void draw(Graphics2D g2d)
	{
		g2d.drawImage(bf,this.getLocation().getStartX(),this.getLocation().getStartY(),null);
	}

	public BufferedImage getBf() {
		return bf;
	}

	public void setBf(BufferedImage bf) {
		this.bf = bf;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?