Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
MapSearch Class Reference

A chainable filter ("finder") over the maps – the heart of map randomization. More...

#include <mapsearch.h>

Inheritance diagram for MapSearch:
Collaboration diagram for MapSearch:

Public Member Functions

 MapSearch ()
 Start with all maps in the result set.
MapDBEntrypickRandom ()
 A random map from the current results (backs pickRandom).
MapSearchstartOver ()
 Reset to all maps. Returns this.
MapSearchnotNamed (QString val)
 Drop the map named val.
MapSearchindexLt (int val)
 Keep maps with index < val.
MapSearchindexGt (int val)
 Keep maps with index > val.
MapSearchwidthGt (int val)
 Keep maps wider than val.
MapSearchwidthLt (int val)
 Keep maps narrower than val.
MapSearchheightGt (int val)
 Keep maps taller than val.
MapSearchheightLt (int val)
 Keep maps shorter than val.
MapSearchareaGt (int val)
 Keep maps with area > val.
MapSearchareaLt (int val)
 Keep maps with area < val.
MapSearchhasTileset (QString val)
 Keep maps using tileset val.
MapSearchnotTileset (QString val)
 Drop maps using tileset val.
MapSearchisType (QString val)
 Keep maps of tileset-type val.
MapSearchnotType (QString val)
 Drop maps of tileset-type val.
MapSearchhasConnections ()
MapSearchnoConnections ()
MapSearchhasWarpsOut ()
MapSearchnoWarpsOut ()
MapSearchhasWarpsIn ()
MapSearchnoWarpsIn ()
MapSearchhasSigns ()
MapSearchnoSigns ()
MapSearchhasSprites ()
MapSearchnoSprites ()
MapSearchhasSpriteSet ()
MapSearchnoSpriteSet ()
MapSearchhasDynamicSpriteSet ()
MapSearchnoDynamicSpriteSet ()
MapSearchhasMons ()
MapSearchnoMons ()
MapSearchisIncomplete ()
MapSearchnotIncomplete ()
MapSearchisGlitch ()
MapSearchnotGlitch ()
MapSearchisSpsecial ()
MapSearchnotSpecial ()
MapSearchisGood ()
 Keep only "good" maps (criteria listed above).
MapSearchisNotBad ()
 The complement helper used by isGood().
MapSearchisCity ()
MapSearchnotCity ()
const QVector< MapDBEntry * > getMaps () const
 The current result set.
int getMapCount () const
 Result count (backs mapCount).
const MapDBEntrymapAt (const int ind) const
 Result ind (for QML).
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.

Detailed Description

A chainable filter ("finder") over the maps – the heart of map randomization.

Obtained from MapsDB (search()/searchRaw()). Starts with every map in results and narrows them with chainable predicates; each returns this for fluent chaining. Two flavours of predicate:

  • the no-argument filters are exposed as Q_PROPERTY (so QML can chain them as property reads, e.g. search.hasWarpsOut.hasWarpsIn);
  • the parameterised ones (indexGt, hasTileset, ...) are Q_INVOKABLE.

pickRandom() returns a random map from the current results – the primary tool the "place player on any valid map" feature uses (typically after isGood()).

See also
MapsDB, MapDBEntry, FontSearch (the analogous font finder).

Definition at line 41 of file mapsearch.h.

Constructor & Destructor Documentation

◆ MapSearch()

Member Function Documentation

◆ areaGt()

MapSearch * MapSearch::areaGt ( int val)

Keep maps with area > val.

Definition at line 126 of file mapsearch.cpp.

References MapSearch().

◆ areaLt()

MapSearch * MapSearch::areaLt ( int val)

Keep maps with area < val.

Definition at line 136 of file mapsearch.cpp.

References MapSearch().

◆ getMapCount()

int MapSearch::getMapCount ( ) const

Result count (backs mapCount).

Definition at line 430 of file mapsearch.cpp.

Referenced by isNotBad().

◆ getMaps()

const QVector< MapDBEntry * > MapSearch::getMaps ( ) const

The current result set.

Definition at line 425 of file mapsearch.cpp.

Referenced by isNotBad().

◆ hasConnections()

MapSearch * MapSearch::hasConnections ( )
See also
hasConnections property.

Definition at line 199 of file mapsearch.cpp.

References MapSearch().

◆ hasDynamicSpriteSet()

MapSearch * MapSearch::hasDynamicSpriteSet ( )
See also
hasDynamicSpriteSet property.

Definition at line 310 of file mapsearch.cpp.

References MapSearch().

◆ hasMons()

MapSearch * MapSearch::hasMons ( )
See also
hasMons property.

Definition at line 336 of file mapsearch.cpp.

References MapSearch().

◆ hasSigns()

MapSearch * MapSearch::hasSigns ( )
See also
hasSigns property.

Definition at line 253 of file mapsearch.cpp.

References MapSearch().

◆ hasSprites()

MapSearch * MapSearch::hasSprites ( )
See also
hasSprites property.

Definition at line 271 of file mapsearch.cpp.

References MapSearch().

◆ hasSpriteSet()

MapSearch * MapSearch::hasSpriteSet ( )
See also
hasSpriteSet property.

Definition at line 289 of file mapsearch.cpp.

References MapSearch().

◆ hasTileset()

MapSearch * MapSearch::hasTileset ( QString val)

Keep maps using tileset val.

Definition at line 146 of file mapsearch.cpp.

References MapSearch().

◆ hasWarpsIn()

MapSearch * MapSearch::hasWarpsIn ( )
See also
hasWarpsIn property.

Definition at line 235 of file mapsearch.cpp.

References MapSearch().

Referenced by isGood().

◆ hasWarpsOut()

MapSearch * MapSearch::hasWarpsOut ( )
See also
hasWarpsOut property.

Definition at line 217 of file mapsearch.cpp.

References MapSearch().

Referenced by isGood().

◆ heightGt()

MapSearch * MapSearch::heightGt ( int val)

Keep maps taller than val.

Definition at line 108 of file mapsearch.cpp.

References MapSearch().

◆ heightLt()

MapSearch * MapSearch::heightLt ( int val)

Keep maps shorter than val.

Definition at line 117 of file mapsearch.cpp.

References MapSearch().

◆ indexGt()

MapSearch * MapSearch::indexGt ( int val)

Keep maps with index > val.

Definition at line 81 of file mapsearch.cpp.

References MapSearch().

Referenced by notCity().

◆ indexLt()

MapSearch * MapSearch::indexLt ( int val)

Keep maps with index < val.

Definition at line 72 of file mapsearch.cpp.

References MapSearch().

Referenced by isCity().

◆ isCity()

MapSearch * MapSearch::isCity ( )
See also
isCity property.

Definition at line 415 of file mapsearch.cpp.

References indexLt(), and MapSearch().

Referenced by isNotBad().

◆ isGlitch()

MapSearch * MapSearch::isGlitch ( )
See also
isGlitch property.

Definition at line 372 of file mapsearch.cpp.

References MapSearch().

◆ isGood()

MapSearch * MapSearch::isGood ( )

Keep only "good" maps (criteria listed above).

Definition at line 409 of file mapsearch.cpp.

References hasWarpsIn(), hasWarpsOut(), MapSearch(), notGlitch(), notIncomplete(), notNamed(), and notSpecial().

◆ isIncomplete()

MapSearch * MapSearch::isIncomplete ( )
See also
isIncomplete property.

Definition at line 354 of file mapsearch.cpp.

References MapSearch().

◆ isNotBad()

MapSearch * MapSearch::isNotBad ( )

The complement helper used by isGood().

References getMapCount(), getMaps(), isCity(), mapAt(), MapSearch(), notCity(), and qmlProtect().

◆ isSpsecial()

MapSearch * MapSearch::isSpsecial ( )
See also
isSpsecial property (sic).

Definition at line 391 of file mapsearch.cpp.

References MapSearch().

◆ isType()

MapSearch * MapSearch::isType ( QString val)

Keep maps of tileset-type val.

Definition at line 168 of file mapsearch.cpp.

References MapSearch().

◆ mapAt()

const MapDBEntry * MapSearch::mapAt ( const int ind) const

Result ind (for QML).

Definition at line 435 of file mapsearch.cpp.

Referenced by isNotBad().

◆ noConnections()

MapSearch * MapSearch::noConnections ( )
See also
noConnections property.

Definition at line 208 of file mapsearch.cpp.

References MapSearch().

◆ noDynamicSpriteSet()

MapSearch * MapSearch::noDynamicSpriteSet ( )
See also
noDynamicSpriteSet property.

Definition at line 323 of file mapsearch.cpp.

References MapSearch().

◆ noMons()

MapSearch * MapSearch::noMons ( )
See also
noMons property.

Definition at line 345 of file mapsearch.cpp.

References MapSearch().

◆ noSigns()

MapSearch * MapSearch::noSigns ( )
See also
noSigns property.

Definition at line 262 of file mapsearch.cpp.

References MapSearch().

◆ noSprites()

MapSearch * MapSearch::noSprites ( )
See also
noSprites property.

Definition at line 280 of file mapsearch.cpp.

References MapSearch().

◆ noSpriteSet()

MapSearch * MapSearch::noSpriteSet ( )
See also
noSpriteSet property.

Definition at line 301 of file mapsearch.cpp.

References MapSearch().

◆ notCity()

MapSearch * MapSearch::notCity ( )
See also
notCity property.

Definition at line 420 of file mapsearch.cpp.

References indexGt(), and MapSearch().

Referenced by isNotBad().

◆ notGlitch()

MapSearch * MapSearch::notGlitch ( )
See also
notGlitch property.

Definition at line 381 of file mapsearch.cpp.

References MapSearch().

Referenced by isGood().

◆ notIncomplete()

MapSearch * MapSearch::notIncomplete ( )
See also
notIncomplete property.

Definition at line 363 of file mapsearch.cpp.

References MapSearch().

Referenced by isGood().

◆ notNamed()

MapSearch * MapSearch::notNamed ( QString val)

Drop the map named val.

Definition at line 62 of file mapsearch.cpp.

References MapSearch().

Referenced by isGood().

◆ notSpecial()

MapSearch * MapSearch::notSpecial ( )
See also
notSpecial property.

Definition at line 400 of file mapsearch.cpp.

References MapSearch().

Referenced by isGood().

◆ notTileset()

MapSearch * MapSearch::notTileset ( QString val)

Drop maps using tileset val.

Definition at line 157 of file mapsearch.cpp.

References MapSearch().

◆ notType()

MapSearch * MapSearch::notType ( QString val)

Drop maps of tileset-type val.

Definition at line 186 of file mapsearch.cpp.

References MapSearch().

◆ noWarpsIn()

MapSearch * MapSearch::noWarpsIn ( )
See also
noWarpsIn property.

Definition at line 244 of file mapsearch.cpp.

References MapSearch().

◆ noWarpsOut()

MapSearch * MapSearch::noWarpsOut ( )
See also
noWarpsOut property.

Definition at line 226 of file mapsearch.cpp.

References MapSearch().

◆ pickRandom()

MapDBEntry * MapSearch::pickRandom ( )

A random map from the current results (backs pickRandom).

Definition at line 41 of file mapsearch.cpp.

References Random::inst().

◆ qmlProtect()

void MapSearch::qmlProtect ( const QQmlEngine *const engine) const

Pin to C++ ownership.

Definition at line 443 of file mapsearch.cpp.

References Utility::qmlProtectUtil().

Referenced by isNotBad().

◆ startOver()

MapSearch * MapSearch::startOver ( )

Reset to all maps. Returns this.

Definition at line 49 of file mapsearch.cpp.

References MapsDB::inst(), and MapSearch().

Referenced by MapSearch().

◆ widthGt()

MapSearch * MapSearch::widthGt ( int val)

Keep maps wider than val.

Definition at line 90 of file mapsearch.cpp.

References MapSearch().

◆ widthLt()

MapSearch * MapSearch::widthLt ( int val)

Keep maps narrower than val.

Definition at line 99 of file mapsearch.cpp.

References MapSearch().


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