Class Ending
java.lang.Object
edu.uky.cs.nil.tt.world.Asset
edu.uky.cs.nil.tt.world.SignedAsset
edu.uky.cs.nil.tt.world.Ending
An ending is a
signed asset that represents one of
several possible ways a story can end.- Author:
- Stephen G. Ware
-
Field Summary
Fields inherited from class SignedAsset
signature -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetCode()Returns a string of1's and0's that uniquely represents this object among other objects of the same type in the same story world.protected EndingReturns a new ending that is the same as this ending, except this itscodeis the given value.setDescription(String description) Returns a new asset that is the same as this asset, except that itsdescriptionis the given value.protected EndingsetID(int id) Returns a new asset that is the same as this asset, except that its ID number is the given value.protected EndingsetSignature(Signature signature) Returns a new signed asset that is the same as this asset, except that its signature and name are the given value.substitute(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.
-
Constructor Details
-
Ending
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<Ending>
-
setID
Description copied from class:AssetReturns a new asset that is the same as this asset, except that its ID number is the given value. -
setSignature
Description copied from class:SignedAssetReturns a new signed asset that is the same as this asset, except that its signature and name are the given value.- Specified by:
setSignaturein classSignedAsset- Parameters:
signature- the signature and name the new asset should have- Returns:
- a signed asset identical to this asset, except with the given signature and name
-
setDescription
Description copied from class:AssetReturns a new asset that is the same as this asset, except that itsdescriptionis the given value.- Specified by:
setDescriptionin classAsset- Parameters:
description- the description the new asset should have- Returns:
- an asset identical to this asset, except with the given description
-
getCode
Description copied from interface:EncodedReturns a string of1's and0's that uniquely represents this object among other objects of the same type in the same story world. Every encoded object of the same type should return a string of the same length, even if it must be padded with0's. -
setCode
-
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- Specified by:
substitutein classSignedAsset- 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
-