GTAdhocAPI
Gran Turismo (6) Adhoc API Documentation
Loading...
Searching...
No Matches
gtengine::MSpecDB Class Reference

Wrapper over a SQLite database file for SpecDB operations. More...

Inheritance diagram for gtengine::MSpecDB:
System::Object

Static Public Member Functions

static UInt getVersion ()
 Gets the supported version. More...
 
static String getDBFileName ()
 Gets the DB File Name i.e "DB0106.dat". More...
 
static void initialize (MSqlite sqlite_instance, String carname_filename, Bool unk=false)
 
static void finalize ()
 
static Bool isUnderDevelopmentCar (String label)
 Returns whether a car is under development - unfinished. More...
 
static Bool isUnderDevelopmentCar (UInt car_code)
 Returns whether a car is under development - unfinished. More...
 
static String getCarLabel (UInt car_code)
 Returns a car's label for a car code. More...
 
static String getCarCode (String label)
 Returns a car's code for a car label. More...
 
static String getCarCode (UInt car_code)
 Returns a car's code for a car code. (Pointless) More...
 
static String getCarName (String label)
 Returns a car's name for a car label. More...
 
static String getCarName (UInt car_code)
 Returns a car's name for a car code. More...
 
static String getShortCarName (String label)
 Returns a car's short name for a car label. More...
 
static String getShortCarName (UInt car_code)
 Returns a car's short name for a car code. More...
 
static Int getCarVariation (String label)
 Returns a car's count of colors for a car label. More...
 
static Int getCarColorName (String label, Int variation_index)
 Returns a car's color name for a label and color index. More...
 
static Int getCarColorName (UInt car_code, Int variation_index)
 Returns a car's color name for a car code and color index. More...
 
static String getCarDriveTrain (String label)
 Returns a car's color name for a label and color index. More...
 
static String getCarDriveTrain (UInt car_code)
 Returns a car's color name for a car code and color index. More...
 
static Bool getCarDriveTrain (String label)
 Returns whether a car is a standard model. More...
 
static Bool getCarDriveTrain (UInt car_code)
 Returns whether a car is a standard model. More...
 
static Int getCarVariationFlag (String label)
 Returns the main color/variation index for a car label. More...
 
static Int getCarVariationFlag (UInt car_code)
 Returns the main color/variation index for a car code. More...
 
static Int getCarCountry (String label)
 Returns the country for a car label. More...
 
static Int getCarCountry (UInt car_code)
 Returns the country for a car code. More...
 
static Int getCarYear (String label)
 Returns the year for a car label. More...
 
static Int getCarYear (UInt car_code)
 Returns the year for a car code. More...
 
static Int getCarPrice (String label)
 Returns the price for a car label. More...
 
static Int getCarPrice (UInt car_code)
 Returns the price for a car code. More...
 
static Int getCarCategory (String label)
 Returns the category for a car label. More...
 
static Int getCarCategory (UInt car_code)
 Returns the category for a car code. More...
 
static Int getCourseLabel (String label)
 Returns the label for a course label (Pointless). More...
 
static Int getCourseLabel (UInt course_code)
 Returns the label for a course code. More...
 
static UInt getCourseCode (String label)
 Returns the code for a course label. More...
 
static UInt getCourseCode (UInt course_code)
 Returns the code for a course code (Pointless). More...
 
static UInt getCourseCodeFromSceneryCode (UInt scenery_code)
 Returns the code for a course label. More...
 
static UInt getCourseCondition (String label)
 Returns the condition for a course label. More...
 
static UInt getCourseCondition (UInt course_code)
 Returns the condition for a course code. More...
 
static CourseCondition getCourseConditionFromTire (PARTS_TIRE tire)
 Returns the CourseCondition for a set of tires. More...
 
static String getTunerLabel (String label)
 Returns the tuner label for a car label. More...
 
static String getTunerLabel (UInt car_code)
 Returns the category for a car code. More...
 
static String getTunerString (UInt tuner_id)
 Returns the tuner string for a tuner ID. More...
 
static String getCountryString (UInt country_id)
 Returns the tuner string for a country ID. More...
 
static Bool checkFlag (String label, SpecifyFlags flag)
 Checks for whether a specify flag is toggled for a car label. More...
 
static Bool checkFlag (UInt car_code, SpecifyFlags flag)
 Checks for whether a specify flag is toggled for a car code. More...
 
static Int getCourseEntryMax (String label)
 Returns max allowed entries for a course label. More...
 
static Int getCourseEntryMax (UInt course_code)
 Returns max allowed entries for a course code. More...
 
static Int isDirtSnow (String label)
 Returns whether a course is snow or dirt for a course label. More...
 
static Int isDirtSnow (UInt course_code)
 Returns whether a course is snow or dirt for a course code. More...
 
static Int getPaintColorCount ()
 Gets the total amount of paints in the database. More...
 
static Bool isOrderedType (CarPartsType type)
 Returns whether a database table type is "ordered". More...
 
static STStructure getCourseRow (String label)
 Returns a full course row for a course label. More...
 
static STStructure getCourseRow (UInt course_code)
 Returns a full course row for a course code. More...
 
static STStructure getCatalogSpec (String label)
 
static STStructure getCatalogSpec (UInt car_code)
 

Static Public Attributes

static const UInt NO_CODE = -1
 
static STStructure COURSE
 

Additional Inherited Members

- Public Member Functions inherited from System::Object
 Object ()
 constructor taking no param More...
 
Bool isInstanceOf (Class classType)
 Returns whether an object is of a specific class/type. More...
 
Object getDeepCopy ()
 Gets a deep copy of this object. More...
 
void setDeepCopy (Object obj)
 Unk. More...
 
String dump ()
 Dumps all info about an object. More...
 
Object getObjectAttribute (string path)
 
void setObjectAttribute (string path, Object value)
 
Bool hasPrimitiveInterface ()
 Returns whether this object has a primitive interface. More...
 
Bool toBool ()
 Casts this object to Bool. More...
 
Byte toByte ()
 Casts this object to Byte. More...
 
Short toShort ()
 Casts this object to Short. More...
 
Int toInt ()
 Casts this object to Int. More...
 
Long toLong ()
 Casts this object to Long. More...
 
UByte toUByte ()
 Casts this object to UByte. More...
 
UShort toUShort ()
 Casts this object to UShort. More...
 
UInt toUInt ()
 Casts this object to UInt. More...
 
ULong toULong ()
 Casts this object to ULong. More...
 
Float toFloat ()
 Casts this object to Float. More...
 
Double toDouble ()
 Casts this object to Double. More...
 
String toString ()
 Casts this object to String. More...
 
Symbol toSymbol ()
 Casts this object to Symbol. More...
 
Bool hasArrayInterface ()
 Returns whether this object has an Array interface. More...
 
Int getArrayCount ()
 Gets the Array item count for this object. More...
 
void setArrayCount ()
 Sets the Array item count for this object. More...
 
Object getArrayElement (Object arg0)
 Gets an Array item for this object. More...
 
void setArrayElement (Object arg0, Object arg1)
 Sets the Array item for this object. More...
 
Bool hasMapInterface ()
 Returns whether this object has a Map interface. More...
 
int getMapCount ()
 Returns the count of items in the map. More...
 
void setMapElement (Object arg0, Object arg1)
 Returns whether the Map has a specific object key. Bool hasMapElement(Object arg0);. More...
 
Object getMapElement (Object arg0)
 Gets a Map element by key. More...
 
void hasGeneratorInterface ()
 Returns whether this object has a generator interface. More...
 
Iterator generator ()
 Returns generator (?) More...
 
void hasIteratorInterface ()
 Returns whether this object has an iterator. More...
 
Iterator iterator ()
 Gets the iterator for this object. More...
 
void hasVariableInterface ()
 Returns whether this object is a variable. More...
 
void hasFunctionInterface ()
 Returns whether this object has a function interface. More...
 
Object call ()
 Calls this object as a function. More...
 
Bool hasByteDataInterface ()
 Returns whether this object has a byte data interface. More...
 
Int getByteDataCount ()
 Returns the ByteData size for this object. More...
 
void setByteDataCount (Int count)
 Sets the ByteData size for this object. More...
 
Int getByteDataCapacity ()
 Returns the ByteData capacity for this object. More...
 
void setByteDataCapacity (Int capacity)
 Sets the ByteData capacity for this object. More...
 
ByteData getByteData ()
 Gets the underlaying ByteData. More...
 
void setByteData (ByteData bytedata)
 Sets the underlaying ByteData. More...
 
void hasObjectSelectorInterface ()
 Returns whether this object has an object selector interface. More...
 
void self ()
 Gets the get for this object if it has a get interface. More...
 
void getArchiveTree ()
 
void setArchiveTree ()
 
ByteData serialize ()
 Serializes this object. More...
 
void deserialize (ByteData serializedData)
 Deserializes this object. More...
 
void defined (Object obj)
 Returns whether a certain object is defined within this object. More...
 
Array find_all (FunctionObject func)
 Finds all the elements in this object that matches the predicates. More...
 
void each_all (FunctionObject func)
 Applies callback to all elements in this object. More...
 
Array map_all (FunctionObject< Object > func)
 Maps all the elements in this object. More...
 
Bool operator!= ()
 Returns whether this object is not equal to another. More...
 
Bool operator== ()
 Returns whether this object is equal to another. More...
 
- Public Attributes inherited from System::Object
Int rc_size
 Getter-only. Reference counter size of this object. More...
 
Object rc_class
 Getter-only. Type name of the object. More...
 
Int rc_count
 Getter-only. Reference count of this object. More...
 
Int weak_count
 Getter-only. Weak reference count of this object. More...
 
Class class_id
 Class (type) object for this object. More...
 

Detailed Description

Wrapper over a SQLite database file for SpecDB operations.

Most of the car_code versions of the functions will first fetch the label, preferably always provide a label if possible.

Definition at line 9 of file MSpecDB.cpp.

Member Function Documentation

◆ checkFlag() [1/2]

static Bool gtengine::MSpecDB::checkFlag ( String  label,
SpecifyFlags  flag 
)
static

Checks for whether a specify flag is toggled for a car label.

Checks against GENERIC_CAR->SpecifyFlags

◆ checkFlag() [2/2]

static Bool gtengine::MSpecDB::checkFlag ( UInt  car_code,
SpecifyFlags  flag 
)
static

Checks for whether a specify flag is toggled for a car code.

Checks against GENERIC_CAR->SpecifyFlags

◆ finalize()

static void gtengine::MSpecDB::finalize ( )
static

◆ getCarCategory() [1/2]

static Int gtengine::MSpecDB::getCarCategory ( String  label)
static

Returns the category for a car label.

Label can be from GENERIC_CAR or TUNED_CARS. Depends on GENERIC_CAR->Category.

◆ getCarCategory() [2/2]

static Int gtengine::MSpecDB::getCarCategory ( UInt  car_code)
static

Returns the category for a car code.

Depends on GENERIC_CAR->Category.

◆ getCarCode() [1/2]

static String gtengine::MSpecDB::getCarCode ( String  label)
static

Returns a car's code for a car label.

CarCode from GENERIC_CAR, OR Code from TUNED_CARS.

◆ getCarCode() [2/2]

static String gtengine::MSpecDB::getCarCode ( UInt  car_code)
static

Returns a car's code for a car code. (Pointless)

◆ getCarColorName() [1/2]

static Int gtengine::MSpecDB::getCarColorName ( String  label,
Int  variation_index 
)
static

Returns a car's color name for a label and color index.

Label can be from GENERIC_CAR or TUNED_CARS. Depends on VARIATION->NameEng/NameJpn, depending on the global region set. Index is matched against Depends on VARIATION->VarOrder.

◆ getCarColorName() [2/2]

static Int gtengine::MSpecDB::getCarColorName ( UInt  car_code,
Int  variation_index 
)
static

Returns a car's color name for a car code and color index.

Depends on VARIATION->NameEng/NameJpn, depending on the global region set. Index is matched against Depends on VARIATION->VarOrder.

◆ getCarCountry() [1/2]

static Int gtengine::MSpecDB::getCarCountry ( String  label)
static

Returns the country for a car label.

Label can be from GENERIC_CAR or TUNED_CARS. Depends on GENERIC_CAR->Country.

◆ getCarCountry() [2/2]

static Int gtengine::MSpecDB::getCarCountry ( UInt  car_code)
static

Returns the country for a car code.

Depends on GENERIC_CAR->Country.

◆ getCarDriveTrain() [1/4]

static String gtengine::MSpecDB::getCarDriveTrain ( String  label)
static

Returns a car's color name for a label and color index.

Label can be from GENERIC_CAR or TUNED_CARS. Depends on DRIVETRAIN->DriveTypeName, where it must be one of the following: FR, FF, 4WD, MR, RR.

Returns
"---" if invalid type.

◆ getCarDriveTrain() [2/4]

static Bool gtengine::MSpecDB::getCarDriveTrain ( String  label)
static

Returns whether a car is a standard model.

Label can be from GENERIC_CAR or TUNED_CARS. Depends on GENERIC_CAR->SpecifyFlags where SpecifyFlags >> 2 & 1 != 0.

◆ getCarDriveTrain() [3/4]

static String gtengine::MSpecDB::getCarDriveTrain ( UInt  car_code)
static

Returns a car's color name for a car code and color index.

Depends on DRIVETRAIN->DriveTypeName, where it must be one of the following: FR, FF, 4WD, MR, RR.

Returns
"---" if invalid type.

◆ getCarDriveTrain() [4/4]

static Bool gtengine::MSpecDB::getCarDriveTrain ( UInt  car_code)
static

Returns whether a car is a standard model.

Depends on GENERIC_CAR->SpecifyFlags where SpecifyFlags >> 2 & 1 != 0.

◆ getCarLabel()

static String gtengine::MSpecDB::getCarLabel ( UInt  car_code)
static

Returns a car's label for a car code.

CarLabel from GENERIC_CAR.

◆ getCarName() [1/2]

static String gtengine::MSpecDB::getCarName ( String  label)
static

Returns a car's name for a car label.

Depends on the CarName.dat file.

Returns
If not found, "--" is returned.

◆ getCarName() [2/2]

static String gtengine::MSpecDB::getCarName ( UInt  car_code)
static

Returns a car's name for a car code.

Depends on the CarName.dat file.

Returns
If not found, "--" is returned.

◆ getCarPrice() [1/2]

static Int gtengine::MSpecDB::getCarPrice ( String  label)
static

Returns the price for a car label.

Label can be from GENERIC_CAR or TUNED_CARS. Depends on GENERIC_CAR->Price.

◆ getCarPrice() [2/2]

static Int gtengine::MSpecDB::getCarPrice ( UInt  car_code)
static

Returns the price for a car code.

Depends on GENERIC_CAR->Price.

◆ getCarVariation()

static Int gtengine::MSpecDB::getCarVariation ( String  label)
static

Returns a car's count of colors for a car label.

Depends on GENERIC_CAR->NumColor

◆ getCarVariationFlag() [1/2]

static Int gtengine::MSpecDB::getCarVariationFlag ( String  label)
static

Returns the main color/variation index for a car label.

Label can be from GENERIC_CAR or TUNED_CARS. Depends on GENERIC_CAR->MainColor.

◆ getCarVariationFlag() [2/2]

static Int gtengine::MSpecDB::getCarVariationFlag ( UInt  car_code)
static

Returns the main color/variation index for a car code.

Depends on GENERIC_CAR->MainColor.

◆ getCarYear() [1/2]

static Int gtengine::MSpecDB::getCarYear ( String  label)
static

Returns the year for a car label.

Label can be from GENERIC_CAR or TUNED_CARS. Depends on GENERIC_CAR->Year.

◆ getCarYear() [2/2]

static Int gtengine::MSpecDB::getCarYear ( UInt  car_code)
static

Returns the year for a car code.

Depends on GENERIC_CAR->Year.

◆ getCatalogSpec() [1/2]

static STStructure gtengine::MSpecDB::getCatalogSpec ( String  label)
static

◆ getCatalogSpec() [2/2]

static STStructure gtengine::MSpecDB::getCatalogSpec ( UInt  car_code)
static

◆ getCountryString()

static String gtengine::MSpecDB::getCountryString ( UInt  country_id)
static

Returns the tuner string for a country ID.

No DB operation performed, may be hardcoded cached engine map

◆ getCourseCode() [1/2]

static UInt gtengine::MSpecDB::getCourseCode ( String  label)
static

Returns the code for a course label.

◆ getCourseCode() [2/2]

static UInt gtengine::MSpecDB::getCourseCode ( UInt  course_code)
static

Returns the code for a course code (Pointless).

Uses COURSE->Label, return COURSE->ID.

◆ getCourseCodeFromSceneryCode()

static UInt gtengine::MSpecDB::getCourseCodeFromSceneryCode ( UInt  scenery_code)
static

Returns the code for a course label.

Uses COURSE->ModelName where "snprintf(name, 8,"s%03d",scenery_code)", returns COURSE->ID.

◆ getCourseCondition() [1/2]

static UInt gtengine::MSpecDB::getCourseCondition ( String  label)
static

Returns the condition for a course label.

returns COURSE->Condition.

◆ getCourseCondition() [2/2]

static UInt gtengine::MSpecDB::getCourseCondition ( UInt  course_code)
static

Returns the condition for a course code.

returns COURSE->Condition.

◆ getCourseConditionFromTire()

static CourseCondition gtengine::MSpecDB::getCourseConditionFromTire ( PARTS_TIRE  tire)
static

Returns the CourseCondition for a set of tires.

No DB operation is performed, just an enum convertion

◆ getCourseEntryMax() [1/2]

static Int gtengine::MSpecDB::getCourseEntryMax ( String  label)
static

Returns max allowed entries for a course label.

returns COURSE->EntryMax.

◆ getCourseEntryMax() [2/2]

static Int gtengine::MSpecDB::getCourseEntryMax ( UInt  course_code)
static

Returns max allowed entries for a course code.

returns COURSE->EntryMax.

◆ getCourseLabel() [1/2]

static Int gtengine::MSpecDB::getCourseLabel ( String  label)
static

Returns the label for a course label (Pointless).

◆ getCourseLabel() [2/2]

static Int gtengine::MSpecDB::getCourseLabel ( UInt  course_code)
static

Returns the label for a course code.

Depends on COURSE->Label.

◆ getCourseRow() [1/2]

static STStructure gtengine::MSpecDB::getCourseRow ( String  label)
static

Returns a full course row for a course label.

◆ getCourseRow() [2/2]

static STStructure gtengine::MSpecDB::getCourseRow ( UInt  course_code)
static

Returns a full course row for a course code.

◆ getDBFileName()

static String gtengine::MSpecDB::getDBFileName ( )
static

Gets the DB File Name i.e "DB0106.dat".

Result from snprintf(name,flags,"DB%04d.dat", VERSION) - Can't be more than 32 chars

◆ getPaintColorCount()

static Int gtengine::MSpecDB::getPaintColorCount ( )
static

Gets the total amount of paints in the database.

SELECT COUNT(*) FROM PAINT_COLOR_INFO

◆ getShortCarName() [1/2]

static String gtengine::MSpecDB::getShortCarName ( String  label)
static

Returns a car's short name for a car label.

Depends on the CarName.dat file.

Returns
If not found, "--" is returned.

◆ getShortCarName() [2/2]

static String gtengine::MSpecDB::getShortCarName ( UInt  car_code)
static

Returns a car's short name for a car code.

Depends on the CarName.dat file.

Returns
If not found, "--" is returned.

◆ getTunerLabel() [1/2]

static String gtengine::MSpecDB::getTunerLabel ( String  label)
static

Returns the tuner label for a car label.

GENERIC_CAR row must exist, then GENERIC_CAR->Tuner is used against TUNER->ID. Returns TUNER->TunerString.

◆ getTunerLabel() [2/2]

static String gtengine::MSpecDB::getTunerLabel ( UInt  car_code)
static

Returns the category for a car code.

GENERIC_CAR row must exist, then GENERIC_CAR->Tuner is used against TUNER->ID. Returns TUNER->TunerString.

◆ getTunerString()

static String gtengine::MSpecDB::getTunerString ( UInt  tuner_id)
static

Returns the tuner string for a tuner ID.

No DB operation performed, may be hardcoded cached engine map

◆ getVersion()

static UInt gtengine::MSpecDB::getVersion ( )
static

Gets the supported version.

◆ initialize()

static void gtengine::MSpecDB::initialize ( MSqlite  sqlite_instance,
String  carname_filename,
Bool  unk = false 
)
static

◆ isDirtSnow() [1/2]

static Int gtengine::MSpecDB::isDirtSnow ( String  label)
static

Returns whether a course is snow or dirt for a course label.

returns whether COURSE->Condition >= 2

See also
CourseCondition

◆ isDirtSnow() [2/2]

static Int gtengine::MSpecDB::isDirtSnow ( UInt  course_code)
static

Returns whether a course is snow or dirt for a course code.

returns whether COURSE->Condition >= 2

See also
CourseCondition

◆ isOrderedType()

static Bool gtengine::MSpecDB::isOrderedType ( CarPartsType  type)
static

Returns whether a database table type is "ordered".

This returns true for ENGINE and LIGHTWEIGHT

◆ isUnderDevelopmentCar() [1/2]

static Bool gtengine::MSpecDB::isUnderDevelopmentCar ( String  label)
static

Returns whether a car is under development - unfinished.

Depends on GENERIC_CAR->ModelCode == -1, DEFAULT_PARTS->(Any Tire) == -1, WHEEL row exists

◆ isUnderDevelopmentCar() [2/2]

static Bool gtengine::MSpecDB::isUnderDevelopmentCar ( UInt  car_code)
static

Returns whether a car is under development - unfinished.

Depends on GENERIC_CAR->ModelCode == -1, DEFAULT_PARTS->(Any Tire) == -1, WHEEL row exists

Member Data Documentation

◆ COURSE

STStructure gtengine::MSpecDB::COURSE
static

Definition at line 23 of file MSpecDB.cpp.

◆ NO_CODE

const UInt gtengine::MSpecDB::NO_CODE = -1
static

Definition at line 12 of file MSpecDB.cpp.


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