📄 foodmodel.java
字号:
/********************************************************************************************/
/* */
/* FoodModel.java */
/* */
/* 果实模型,这里只实现了最基本功能,有很大扩展空间 */
/* */
/* Programed by Luo Pengkui on 2004-9 */
/* */
/********************************************************************************************/
import java.awt.Point;
//------------------------------------ BEGIN ------------------------------------------------
public class FoodModel
{
private Point m_where; // 果实位置,参数传递时用Point类比直接用xy方便
private int m_life;
private int m_overTime;
private String m_state;
public FoodModel( )
{
m_life = 7; // 果实生命值
}
public int mb_getLife()
{
return m_life;
}
public void mb_setLife(int foodLife)
{
m_life = foodLife;
}
public int mb_getOverTime()
{
return m_overTime;
}
public void mb_setOverTime(int time)
{
m_overTime = time;
}
public Point mb_getPosition() // 获取果实当前位置
{
return m_where;
}
public void mb_setPosition(Point position) // 设置果实当前位置
{
m_where = position;
}
}
//------------------------------------- END -------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -