62,636
社区成员




class MAP {
private Set<ROLE> roleSet = new HashSet<ROLE>();
private int width; //地图宽
private int height; //地图高
MAP(int width, int height);
public int getWidth();
public int getHeight();
public void addRole(ROLE role);
public boolean removeRole(ROLE role);
....
}
class ROLE {
private MAP map; //这个属性看具体情况,可以不要
private int x; //x坐标
private int y; //y坐标 也可以用Point类来做位置属性
public int getX();
public int getY();
public setLocation(int x, int y); //移动到某个位置
...
}
class Role{
Map m=null;
}
class Map{
Role r=null;