private string picture = "";//正常情況照片是object,目前用string是為了展示 public Hero(string name, float x, float y, int pictureType) { this.name = name; this.x = x; this.y = y; this.picture = PictureFactory.getPicture(pictureType);//使用照片工廠 }
public void setPicture(int pictureType) { this.picture = PictureFactory.getPicture(pictureType); }