Class Asset
java.lang.Object
edu.uky.cs.nil.tt.world.Asset
- Direct Known Subclasses:
Entity, SignedAsset
An asset is any named object or concept in a
story world. Every
asset of the same type has a unique, sequential ID number
starting at 0 and a unique name. This means no two entities of
the same type share an ID number. For example, the first Entity in a world has ID 0, and no other entity has ID 0, but the first
Variable in a world also has ID 0.- Author:
- Stephen G. Ware
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns a human-readable natural language description of the object.intgetID()Returns this object's unique, sequential, integer ID number that distinguishes it from other objects of the same type in the same story world.getName()Returns the asset's name, which is unique among other assets of the same type in the story world.inthashCode()abstract AssetsetDescription(String description) Returns a new asset that is the same as this asset, except that itsdescriptionis the given value.protected abstract AssetsetID(int id) Returns a new asset that is the same as this asset, except that its ID number is the given value.abstract Assetsubstitute(Function<Object, Object> substitution) Returns a logical object identical to this one, except that its logical elements have been replaced according to the given substitution.toString()
-
Field Details
-
id
public final int idThis asset's ID number, which is unique among other assets of the same type -
name
This asset's name, which is unique among other assets of the same type
-
-
Constructor Details
-
Asset
-
-
Method Details
-
equals
-
hashCode
-
toString
-
getID
-
setID
Returns a new asset that is the same as this asset, except that its ID number is the given value.- Parameters:
id- the ID number the new asset should have- Returns:
- an asset identical to this asset, except with the given ID number
-
getName
Returns the asset's name, which is unique among other assets of the same type in the story world.- Returns:
- the asset's unique name
-
getDescription
Description copied from interface:DescribedReturns a human-readable natural language description of the object.- Specified by:
getDescriptionin interfaceDescribed- Returns:
- a human-readable natural language description of the object
-
setDescription
Returns a new asset that is the same as this asset, except that itsdescriptionis the given value.- Parameters:
description- the description the new asset should have- Returns:
- an asset identical to this asset, except with the given description
-
substitute
Description copied from interface:LogicalReturns a logical object identical to this one, except that its logical elements have been replaced according to the given substitution. A substitution defines how some logical formula (the input to the function) should be replaced with a different formula (the output of the function).- Specified by:
substitutein interfaceLogical- Parameters:
substitution- a function which maps logical formula that should be replaced to the formula they should be replaced with- Returns:
- an identical object, except that its logical formula have been replaced according to the substitution
-