Link

A reference to another resource (similar to symbolic links in *nix filesystems).

Suppose we have a game with monsters, let's suppose we have Roles "/monsters/big" and "/monsters/bad". Occasionally, they growl, so we put a sound in each called "growl" (e.g. "/monsters/big/growl"). Now suppose we create a new monster "/monsters/ugly". Its appearance is different, but its growl is the same as "bad's".. Instead of creating another copy, we create a Link (/monsters/ugly/growl) which points to "/monsters/bad/growl".

We will have a Behaviour for all monsters, which can find the appropriate sound like so :

val growl = actor.role!!.find( "growl" ) as Sound

I often use links. YMMV.

Constructors

Link copied to clipboard
constructor(parent: ParentResource, name: String)

Properties

Link copied to clipboard
open override val children: MutableObservableMap<String, Resource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
override var name: String
Link copied to clipboard
override var parent: ParentResource
Link copied to clipboard
open override val resourceType: ResourceType

Functions

Link copied to clipboard
open override fun add(child: Resource)
Link copied to clipboard
open override fun dangerousRename(newName: String)
Link copied to clipboard
open fun find(path: String): Resource?
Link copied to clipboard
Link copied to clipboard
open override fun findChild(name: String): Resource?
Link copied to clipboard
open fun findUnresolved(path: String): Resource?
Link copied to clipboard
override fun game(): Game
Link copied to clipboard
override fun path(): String
Link copied to clipboard

Similar to path, but it also includes a trailing path. This is useful when building descendant paths as there is no special case needed for the root Game.

Link copied to clipboard
open override fun remove(child: Resource)
Link copied to clipboard
open override fun rename(child: Resource, newName: String)
Link copied to clipboard
open override fun resolveReferences(): String?
Link copied to clipboard
open override fun walkTree(onVisit: (Resource) -> Unit)