|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.util.ManagedReferenceHolder
org.starhope.appius.util.BaseDatum
org.starhope.appius.game.intangible.AvatarBase
public class AvatarBase
| Field Summary | |
|---|---|
private com.sun.sgs.app.ManagedReference<Domain> |
domain
The domain in which this type of avatar can exist |
private String |
filename
The filename of the model (e.g. |
private HashSet<ItemTemplate> |
itemsApply
This is a set of items which apply to this type of avatar, regardless of other limitations. |
private static long |
serialVersionUID
|
private boolean |
specialEquipmentRequired
Most avatars in a domain are assumed to have common equipment. |
| Fields inherited from class org.starhope.appius.util.BaseDatum |
|---|
database_id |
| Constructor Summary | |
|---|---|
AvatarBase()
Create a neutral, empty object. |
|
AvatarBase(org.json.JSONObject object)
Instantiate this object based upon a JSON object |
|
| Method Summary | |
|---|---|
boolean |
canEquip(SpecificItem which)
Identify whether an item could potentially be worn by avatars with this AvatarBase. |
static AvatarBase |
get(String id)
|
Domain |
getDomain()
Gets the domain in which this avatar base model can be instantiated (e.g. |
String |
getFilename()
|
protected String[] |
getUniqueBoundName()
|
boolean |
isSpecialEquipmentRequired()
-- avatar_bases.special_equip means: This avatar base does not follow the usual pattern for other avatars in this domain, so items that are otherwise capable of being universally equipped, cannot be. |
void |
set(org.json.JSONObject o)
This method will attempt to set the data contents of this object to the values derived from the JSON object being passed-in. |
void |
setDomain(Domain domain)
Sets the domain in which this avatar base model can be instantiated. |
void |
setFilename(String filename)
|
void |
setItemEquippable(ItemTemplate item)
Inform the AvatarBase that it is now allowed to equip items following the given template. |
void |
setSpecialEquipmentRequired(boolean specialEquipmentRequired)
-- avatar_bases.special_equip means: This avatar base does not follow the usual pattern for other avatars in this domain, so items that are otherwise capable of being universally equipped, cannot be. |
org.json.JSONObject |
toJSON()
This returns a copy of the object's data cast into a JSON form. |
| Methods inherited from class org.starhope.appius.util.BaseDatum |
|---|
changed, commitToDatabase, delete, equals, flush, get, get, getID, readExternal, refJSON, setID, sqlDateTime, writeExternal |
| Methods inherited from class org.starhope.appius.util.ManagedReferenceHolder |
|---|
deref, setRef |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private com.sun.sgs.app.ManagedReference<Domain> domain
private String filename
private HashSet<ItemTemplate> itemsApply
private boolean specialEquipmentRequired
| Constructor Detail |
|---|
public AvatarBase()
public AvatarBase(org.json.JSONObject object)
object - the JSON data to useset(JSONObject)| Method Detail |
|---|
public static AvatarBase get(String id)
throws RuntimeException,
NotFoundException
id - database ID
NotFoundException - if the object couldn't be loaded
RuntimeException - if something strange and bad happens
public boolean canEquip(SpecificItem which)
throws GameLogicException
which - the item which we want to know whether it can be worn
GameLogicException - if the item comes from another Domainpublic Domain getDomain()
public String getFilename()
protected String[] getUniqueBoundName()
getUniqueBoundName in class BaseDatumBaseDatum.getUniqueBoundName()public boolean isSpecialEquipmentRequired()
public void set(org.json.JSONObject o)
CastsToJSON
set in interface CastsToJSONset in class BaseDatumo - The JSON object containing a the new data for this
object.BaseDatum.set(org.json.JSONObject)public void setDomain(Domain domain)
domain - the server domain (e.g. Tootsville)
public void setFilename(String filename)
throws DataException
filename - the filename (URL part) of the avatar base model
DataException - if the filename is over 50 characterspublic void setItemEquippable(ItemTemplate item)
item - The item templatepublic void setSpecialEquipmentRequired(boolean specialEquipmentRequired)
specialEquipmentRequired - whether this avatar requires special
items/costumes/&c. in order to equip them.public org.json.JSONObject toJSON()
CastsToJSON
toJSON in interface CastsToJSONtoJSON in class BaseDatumCastsToJSON.toJSON()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||