pos.java

来自「一个吃豆子的游戏」· Java 代码 · 共 39 行

JAVA
39
字号
/** * Title:        吃豆子<p> * Description:  小游戏<p> * Copyright:    Copyright (c) Nothing<p> * Company:      Raindrop<p> * @author Nothing * @version 1.0 */package eatbean.util;public class Pos implements Cloneable {	public int x = 0;	public int y = 0;	public Pos() {}	public Pos(int x, int y) {		this.x = x;		this.y = y;	}	public boolean equals(Pos pos) {		return equals(pos.x, pos.y);	}	public boolean equals(int x, int y) {	    return (this.x == x) && (this.y == y);	}	public String toString() {		return "x=" + x + ",y=" + y;	}	public Object clone() {		Object o = null;		try {			o = super.clone();		}catch (CloneNotSupportedException ex) {			System.out.println(">>fail to clone Pos");		}		return o;	}}

⌨️ 快捷键说明

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