entity.java

来自「j2me实现的一款小游戏」· Java 代码 · 共 69 行

JAVA
69
字号
package istarion.core;

public abstract class Entity
{
	public static int IS_MOBILE		= 0;
	public static int IS_ITEM 		= 1;

	protected String __name;
	private char __symbol;
	private int __color;


	public Entity(String n, char s, int c)
	{
		setName(n);
		setSymbol(s);
		setColor(c);
	}


	public String getName()
	{
		return __name;
	}


	public void setName(String s)
	{
		__name = s;
		if (__name.length() > 16)
			__name = __name.substring(0,16);
	}


	public char getSymbol()
	{
		return __symbol;
	}


	public void setSymbol(char s)
	{
		__symbol = s;
	}


	public int getColor()
	{
		return __color;
	}


	public void setColor(int c)
	{
		__color = c;
		if ((__color > 0xFFFFFF) || (__color < 0)) __color = 0;
	}

	/**
	 * Identifies the type of the Entity.
	 * Implementations must return IS_ITEM or
	 * IS_MOBILE.
	 */
	public abstract int getEntityType();



}

⌨️ 快捷键说明

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