AbstractParentResource

Commonality shared by Folder and other ParentResources.

An Resource which has children (which are also Resources). As the name suggests, it also represents a folder on the file-system. For example, if we have a game file MyGame/MyGame.kyd, the project has a child Folder with name="example", then this represents the folder MyGame/example.

Folders can of course be nested to any depth you want.

In practice the Game's tree structure of Resources mirrors the filesystem's tree structure (of directories and files). Most Resources (such Pose) do not have a corresponding file or directory in our filesystem (as they only contain data, and not resources such as images or sounds).

Resources of type FileResource have a corresponding file in the filesystem (such as Graphic). However, Graphic can have children, so it extends Folder too. In most cases there is no need for a Graphic or any of its children to contain other resources, so the directory isn't created. But in the cases that the folder is required, we end up with example.png as well as a directory called example.

Inheritors

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
override var name: String
Link copied to clipboard
override var parent: ParentResource
Link copied to clipboard

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 walkTree(onVisit: (Resource) -> Unit)