⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 card.java

📁 用JAVA实现蜘蛛纸牌
💻 JAVA
字号:
package dujid.araneid;

import java.awt.*;


public class Card {
	private Pools pool;
	private Image front;
	private Image rear;
	private Image current;

	private String code;

	public Card(String code) {
		this.code = code;
		Toolkit tk = Toolkit.getDefaultToolkit();
		this.front = tk.getImage("images/"+code+".gif");
		this.rear = tk.getImage("images/rear.gif");
		this.turn2rear();
	}

	public void turn() {
		if (this.current==this.front)
			this.current=this.rear;
		else
			this.current=this.front;
	}

	public void turn2rear() {
		this.current=this.rear;
	}

	public void turn2front() {
		this.current=this.front;
	}

	public Image getCurrent() {
		return this.current;
	}

	public Image getFront() {
		return this.front;
	}

	public Image getRear() {
		return this.rear;
	}

	public String getCode() {
		return this.code;
	}

	public void setPool(Pools pool) {
		this.pool=pool;
	}

	public Pools getPool() {
		return this.pool;
	}
}

⌨️ 快捷键说明

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