Walls And Holes  1
TileTemplateSetsManager Class Reference

The TileTemplateSetsManager class Handles the active tileTemplateSets of the application. Can create dialogs to interact with the user. May modify the attached TileMap when removing templateSets. More...

#include <tiletemplatesetsmanager.h>

Inheritance diagram for TileTemplateSetsManager:
Collaboration diagram for TileTemplateSetsManager:

Signals

void tileTemplateSetAdded (SavableTileTemplateSet *tileTemplateSet)
 tileTemplateSetAdded Emitted whenever a new TileTemplateSet is added to the manager: Either by loading, new dialog, or somewhere in code. More...
 
void tileTemplateSetAboutToBeRemoved (SavableTileTemplateSet *tileTemplateSet)
 tileTemplateSetAboutToBeRemoved emitted right before the given tileTemplateSet is removed and deleted. More...
 

Public Member Functions

 TileTemplateSetsManager (QUndoStack *undoStack, TileMap *tileMap=nullptr, QObject *parent=nullptr)
 
void newTileTemplateSet ()
 newTileTemplateSet Opens dialogs to create a new tileTemplateSet More...
 
void addTileTemplateSet (SavableTileTemplateSet *tileTemplateSet)
 addTileTemplateSet Adds the given tileTemplateSet to the application More...
 
bool removeTileTemplateSet (SavableTileTemplateSet *tileTemplateSet)
 removeTileTemplateSet Attempts to remove the given templateSet from the application. If any of the templates of the set are in use, the user will be presented with a dialog, if they confirm the removal, then any tiles using templates from the set will be erased. If the set is not saved, the user will be prompted to save the set before it is removed. More...
 
bool removeTileTemplateSet (int index)
 removeTileTemplateSet Attempt to remove a templateSet at the given index. More...
 
bool removeTileTemplate (int templateSetIndex, int templateIndex)
 removeTileTemplate Attempts to remove the template specified at this index. If mTileMap uses that template, the user will be prompted that removal will alter the map. True is returned if the template is removed (the user doesn't cancel). More...
 
void addTileTemplate (int templateSetIndex, TileTemplate *newTemplate)
 addTileTemplate Adds a new tile template to the given template set. More...
 
void saveAllTileTemplateSets ()
 saveAllTileTemplateSets Saves all unsaved tileTemplateSets More...
 
SavableTileTemplateSetloadTileTemplateSet (bool tryToRelocateOnFail=false)
 loadTileTemplateSet Opens dialogs to locate the templateSet to load, then loads it More...
 
SavableTileTemplateSetloadTileTemplateSet (QString path, bool tryToRelocateOnFail=false)
 loadTileTemplateSet Loads a tileTemplateSet at the given path. If the file can't be loaded for any reason, the user will be given dialogs to relocate the file. More...
 
SavableTileTemplateSettileTemplateSetAt (int i)
 
const QList< SavableTileTemplateSet * > & tileTemplateSets ()
 
void setTileMap (TileMap *tileMap)
 

Detailed Description

The TileTemplateSetsManager class Handles the active tileTemplateSets of the application. Can create dialogs to interact with the user. May modify the attached TileMap when removing templateSets.

Constructor & Destructor Documentation

◆ TileTemplateSetsManager()

TileTemplateSetsManager::TileTemplateSetsManager ( QUndoStack *  undoStack,
TileMap tileMap = nullptr,
QObject *  parent = nullptr 
)
explicit

Member Function Documentation

◆ addTileTemplate()

void TileTemplateSetsManager::addTileTemplate ( int  templateSetIndex,
TileTemplate newTemplate 
)

addTileTemplate Adds a new tile template to the given template set.

Parameters
templateSetIndexThe index of the template set that should be modified.
newTemplateThe TileTemplate that should be added.
Here is the call graph for this function:

◆ addTileTemplateSet()

void TileTemplateSetsManager::addTileTemplateSet ( SavableTileTemplateSet tileTemplateSet)

addTileTemplateSet Adds the given tileTemplateSet to the application

Parameters
tileTemplateSet
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadTileTemplateSet() [1/2]

SavableTileTemplateSet * TileTemplateSetsManager::loadTileTemplateSet ( bool  tryToRelocateOnFail = false)

loadTileTemplateSet Opens dialogs to locate the templateSet to load, then loads it

Returns
Here is the caller graph for this function:

◆ loadTileTemplateSet() [2/2]

SavableTileTemplateSet * TileTemplateSetsManager::loadTileTemplateSet ( QString  path,
bool  tryToRelocateOnFail = false 
)

loadTileTemplateSet Loads a tileTemplateSet at the given path. If the file can't be loaded for any reason, the user will be given dialogs to relocate the file.

Parameters
path
Here is the call graph for this function:

◆ newTileTemplateSet()

void TileTemplateSetsManager::newTileTemplateSet ( )

newTileTemplateSet Opens dialogs to create a new tileTemplateSet

Here is the call graph for this function:

◆ removeTileTemplate()

bool TileTemplateSetsManager::removeTileTemplate ( int  templateSetIndex,
int  templateIndex 
)

removeTileTemplate Attempts to remove the template specified at this index. If mTileMap uses that template, the user will be prompted that removal will alter the map. True is returned if the template is removed (the user doesn't cancel).

Parameters
templateSetIndex
templateIndex
Returns
Here is the call graph for this function:

◆ removeTileTemplateSet() [1/2]

bool TileTemplateSetsManager::removeTileTemplateSet ( SavableTileTemplateSet tileTemplateSet)

removeTileTemplateSet Attempts to remove the given templateSet from the application. If any of the templates of the set are in use, the user will be presented with a dialog, if they confirm the removal, then any tiles using templates from the set will be erased. If the set is not saved, the user will be prompted to save the set before it is removed.

Parameters
TileTemplateSet
Returns

◆ removeTileTemplateSet() [2/2]

bool TileTemplateSetsManager::removeTileTemplateSet ( int  index)

removeTileTemplateSet Attempt to remove a templateSet at the given index.

Parameters
index
Returns
Here is the call graph for this function:

◆ saveAllTileTemplateSets()

void TileTemplateSetsManager::saveAllTileTemplateSets ( )

saveAllTileTemplateSets Saves all unsaved tileTemplateSets

Here is the caller graph for this function:

◆ setTileMap()

void TileTemplateSetsManager::setTileMap ( TileMap tileMap)
inline

◆ tileTemplateSetAboutToBeRemoved

void TileTemplateSetsManager::tileTemplateSetAboutToBeRemoved ( SavableTileTemplateSet tileTemplateSet)
signal

tileTemplateSetAboutToBeRemoved emitted right before the given tileTemplateSet is removed and deleted.

Parameters
tileTemplateSet
Here is the caller graph for this function:

◆ tileTemplateSetAdded

void TileTemplateSetsManager::tileTemplateSetAdded ( SavableTileTemplateSet tileTemplateSet)
signal

tileTemplateSetAdded Emitted whenever a new TileTemplateSet is added to the manager: Either by loading, new dialog, or somewhere in code.

Parameters
tileTemplateSet
Here is the caller graph for this function:

◆ tileTemplateSetAt()

SavableTileTemplateSet* TileTemplateSetsManager::tileTemplateSetAt ( int  i)
inline
Here is the caller graph for this function:

◆ tileTemplateSets()

const QList<SavableTileTemplateSet *>& TileTemplateSetsManager::tileTemplateSets ( )
inline
Here is the caller graph for this function:

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