Constructs a PIdol instance from an optional IPIdol object, at a specified training & potential level.
If obj, or any of its required fields are undefined, the default value of each property's type
will be used to construct the object.
If upgradeState is undefined, the constructed instance will have a currentTrainingLevel and
currentPotentialLevel of 0.
Optionalobj: Partial<IPIdol>
Data to construct the object from.
OptionalupgradeState: Partial<PIdolUpgradeState>
The training / potential level to set for the constructed instance.
// Default instance
new PIdol()
// From partial data
new PIdol({ name: { ja: "Hello" } })
// From JSON data returned by an API
const res = await fetch(...)
const data = new PIdol(await res.json())
// From JSON data returned by an API, at specific upgrade levels
const res = await fetch(...)
const data = new PIdol(await res.json(), { trainingLevel: 6, potentialLevel: 4 })
StaticfromConstructs a PIdol instance from a DBPIdol object by rehydrating missing fields using populate methods, at a specified training & potential level.
If upgradeState is undefined, the constructed instance will have a currentTrainingLevel and
currentPotentialLevel of 0.
Data to construct the object from.
Methods used to rehydrate fields overridden by DBPIdol.
OptionalupgradeState: Partial<PIdolUpgradeState>
The training / potential level to set for the constructed instance.
// From JSON data returned by a document store repository
const res = await collection.findOne({ ... })
const data = await PIdol.fromDB(res, { ... })
// From JSON data returned by a document store repository, at specific upgrade levels
const res = await collection.findOne({ ... })
const data = await PIdol.fromDB(res, { ... }, { trainingLevel: 6, potentialLevel: 4 })
Returns a deep copy of this instance.
StaticdecodeStaticencodeTODO
TODO
Returns the document-store representation of this object.
Unlike toJSON(), the resulting document-store representation may be in a significantly different
shape to that of its implementing class, and it cannot be passed back into the constructor to
reconstruct an equivalent instance.
Use fromDB() instead, which reconstructs the instance and rehydrates any fields truncated by the conversion.
Returns the JSON-serializable representation of this object.
The result can be passed back into the constructor to reconstruct an equivalent instance.
ProtectedtoSerializes the properties of this base class to an object.
Concrete subclasses should spread the result into their own toDB() implementations.
ProtectedtoSerializes the properties of this base class to an object.
Concrete subclasses should spread the result into their own toJSON() implementations.
The unique reference to this object in persistent storage.
The character behind the produce idol unit.
The time the object was created, as an ISO 8601 (RFC 3339) timestamp.
The parameter growth stats of this PIdol instance (including any level upgrades).
The base / flat parameters of this PIdol instance (including any level upgrades).
The current potential / bloom (才能開花) level of this PIdol instance.
The maximum stamina of this PIdol instance (including any level upgrades).
The current training (特訓) level of this PIdol instance.
An ID associated with the object.
Protected StaticindexAn auto-incremented index to keep object IDs unique during runtime.
The list of abilities the produce idol unit has, at training & potential levels 0. Use PIdol.currentAbilities for the list of abilities including any level upgrades.
The parameter growth stats of the produce idol unit, at training & potential levels 0. Use PIdol.currentGrowth for the parameter growth stats including any level upgrades.
The base / flat parameters of the produce idol unit, at training & potential levels 0. Use PIdol.currentParameter for the base / flat parameters including any level upgrades.
The maximum stamina of the produce idol unit, at training & potential levels 0. Use PIdol.currentStamina for the maximum stamina including any level upgrades.
Whether the produce idol unit was distributed for free (i.e. as event reward, login bonus, etc.).
The name of the produce idol unit.
The gameplay plan of the produce idol unit. For a more specific classification, see IPIdol.subplan.
A list of potential / bloom level upgrade effects for the produce idol unit. Use potentialLevels.length for its
maximum potential / bloom level.
The contents of the upgrade if the produce idol unit is able to be upgraded to Prima Stella, otherwise null.
The rarity of the produce idol unit.
The P-Item (produce item) that belongs to the produce idol unit.
The skill(s) that belong(s) to the produce idol unit.
Some produce idol units, like ガラクタロード units, have two signature skills.
Static ReadonlysortableThe recommended gameplay sub-plan of the produce idol unit.
A list of training level upgrade effects for the produce idol unit. Use trainingLevels.length for its maximum
training level.
The time the object was last updated, as an ISO 8601 (RFC 3339) timestamp.
The visuals (card artworks) of the produce idol unit.
A produce idol / P-Idol (プロデュースアイドル / Pアイドル).
These are units available for use in produce scenarios. For example, "極光" / "Kyokkou", "世界一可愛い私" / "Sekaiichi Kawaii Watashi", "サンフェーデッド" / "SUNFADED" are produce idol units of their respective characters.
See PIdolFilter for the list of filtering options.
See IPIdol for the list of fields that can be used for sorting.