ScummVM API documentation
Ultima::Shared::TreeItem Class Reference

#include <tree_item.h>

Inheritance diagram for Ultima::Shared::TreeItem:
Ultima::Shared::MessageTarget Ultima::Shared::BaseObject Ultima::Shared::Actions::Action Ultima::Shared::GameBase Ultima::Shared::NamedItem Ultima::Ultima1::U1Gfx::Sprites Ultima::Shared::Actions::Huh Ultima::Shared::Actions::Pass Ultima::Ultima1::Actions::Action Ultima::Shared::Game Ultima::Shared::Gfx::VisualItem Ultima::Shared::Spell Ultima::Ultima1::Actions::AttackFire Ultima::Ultima1::Actions::Cast Ultima::Ultima1::Actions::Move Ultima::Ultima1::Actions::Quit Ultima::Ultima1::Actions::Ready Ultima::Ultima1::Actions::Stats Ultima::Ultima0::Ultima0Game Ultima::Ultima1::Ultima1Game Ultima::Shared::Gfx::Popup Ultima::Shared::Gfx::VisualContainer Ultima::Shared::Info Ultima::Shared::ViewportDungeon Ultima::Shared::ViewportMap Ultima::Ultima1::U1Gfx::Status Ultima::Ultima1::U1Gfx::ViewCharacterGeneration Ultima::Ultima1::U1Gfx::ViewTitle Ultima::Ultima1::Spells::Spell

Public Member Functions

virtual const Common::String getName () const
 
virtual bool isEquals (const Common::String &name, int maxLen=0) const
 
virtual int compareTo (const Common::String &name, int maxLen=0) const
 
virtual void viewChange ()
 
TreeItemgetParent () const
 
GamegetGame ()
 
const GamegetGame () const
 
Gfx::VisualItemgetView ()
 
TreeItemgetNextSibling () const
 
TreeItemgetPriorSibling () const
 
TreeItemgetLastSibling ()
 
TreeItemgetFirstChild () const
 
TreeItemgetLastChild () const
 
TreeItemscan (TreeItem *item) const
 
TreeItemfindChildInstanceOf (const ClassDef &classDef) const
 
TreeItemfindNextInstanceOf (const ClassDef &classDef, TreeItem *startItem) const
 
void addUnder (TreeItem *newParent)
 
void addChild (TreeItem *child)
 
void setParent (TreeItem *newParent)
 
void addSibling (TreeItem *item)
 
void moveUnder (TreeItem *newParent)
 
void destroyAll ()
 
int destroyChildren ()
 
void detach ()
 
void attach (TreeItem *item)
 
NamedItemfindByName (const Common::String &name)
 
- Public Member Functions inherited from Ultima::Shared::BaseObject
virtual ::Ultima::Shared::ClassDef getType () const
 
bool isInstanceOf (const ClassDef &classDef) const
 

Public Attributes

 CLASSDEF
 
- Public Attributes inherited from Ultima::Shared::MessageTarget
 CLASSDEF
 

Additional Inherited Members

- Static Public Member Functions inherited from Ultima::Shared::BaseObject
::Ultima::Shared::ClassDef type ()
 
- Protected Member Functions inherited from Ultima::Shared::MessageTarget
virtual const Ultima::Shared::MSGMAPgetMessageMap () const
 
- Static Protected Member Functions inherited from Ultima::Shared::MessageTarget
static const Ultima::Shared::MSGMAPgetThisMessageMap ()
 

Detailed Description

This implements the base for objects can form a class hierarchy, with parents, children, and siblings that messages can be passed around.

Member Function Documentation

◆ getName()

virtual const Common::String Ultima::Shared::TreeItem::getName ( ) const
inlinevirtual

Gets the name of the item, if any

Reimplemented in Ultima::Shared::NamedItem.

◆ isEquals()

virtual bool Ultima::Shared::TreeItem::isEquals ( const Common::String name,
int  maxLen = 0 
) const
inlinevirtual

Returns true if the item's name matches a passed name

◆ compareTo()

virtual int Ultima::Shared::TreeItem::compareTo ( const Common::String name,
int  maxLen = 0 
) const
inlinevirtual

Compares the name of the item to a passed name

◆ viewChange()

virtual void Ultima::Shared::TreeItem::viewChange ( )
inlinevirtual

Called when the view changes

◆ getParent()

TreeItem* Ultima::Shared::TreeItem::getParent ( ) const
inline

Get the parent for the given item

◆ getGame() [1/2]

Game* Ultima::Shared::TreeItem::getGame ( )

Jumps up through the parents to find the root game

◆ getGame() [2/2]

const Game* Ultima::Shared::TreeItem::getGame ( ) const

Jumps up through the parents to find the root game

◆ getView()

Gfx::VisualItem* Ultima::Shared::TreeItem::getView ( )

Returns the currently active game view

◆ getNextSibling()

TreeItem* Ultima::Shared::TreeItem::getNextSibling ( ) const
inline

Get the next sibling

◆ getPriorSibling()

TreeItem* Ultima::Shared::TreeItem::getPriorSibling ( ) const
inline

Get the prior sibling

◆ getLastSibling()

TreeItem* Ultima::Shared::TreeItem::getLastSibling ( )

Get the last sibling of this sibling

◆ getFirstChild()

TreeItem* Ultima::Shared::TreeItem::getFirstChild ( ) const
inline

Get the first child of the item, if any

◆ getLastChild()

TreeItem* Ultima::Shared::TreeItem::getLastChild ( ) const

Get the last child of the item, if any

◆ scan()

TreeItem* Ultima::Shared::TreeItem::scan ( TreeItem item) const

Given all the recursive children of the tree item, gives the next item in sequence to the passed starting item

◆ findChildInstanceOf()

TreeItem* Ultima::Shared::TreeItem::findChildInstanceOf ( const ClassDef classDef) const

Find the first child item that is of a given type

◆ findNextInstanceOf()

TreeItem* Ultima::Shared::TreeItem::findNextInstanceOf ( const ClassDef classDef,
TreeItem startItem 
) const

Find the next sibling item that is of the given type

◆ addUnder()

void Ultima::Shared::TreeItem::addUnder ( TreeItem newParent)

Adds the item under another tree item

◆ addChild()

void Ultima::Shared::TreeItem::addChild ( TreeItem child)

Adds a new child under this one

◆ setParent()

void Ultima::Shared::TreeItem::setParent ( TreeItem newParent)

Sets the parent for the item

◆ addSibling()

void Ultima::Shared::TreeItem::addSibling ( TreeItem item)

Adds the item as a sibling of another item

◆ moveUnder()

void Ultima::Shared::TreeItem::moveUnder ( TreeItem newParent)

Moves the tree item to be under another parent

◆ destroyAll()

void Ultima::Shared::TreeItem::destroyAll ( )

Destroys both the item as well as any of it's children

◆ destroyChildren()

int Ultima::Shared::TreeItem::destroyChildren ( )

Destroys all child tree items under this one.

Returns
Total number of tree items recursively removed

◆ detach()

void Ultima::Shared::TreeItem::detach ( )

Detach the tree item from any other associated tree items

◆ attach()

void Ultima::Shared::TreeItem::attach ( TreeItem item)

Attaches a tree item to a new node

◆ findByName()

NamedItem* Ultima::Shared::TreeItem::findByName ( const Common::String name)

Finds a tree item by name

Parameters
nameName to find

The documentation for this class was generated from the following file: