/** * When sent from client to server, form input fields are calculated a new identifier, made by appending the * dollar character, followed by the player identifier if defined, followed by another dollar sign, to the * initial field name. So, with a field called “name” and player identifier of 3, the field identifier will * be “name$3$”, and for a global field called “count” (player identifier is -Infinity), the final field * identifier will be “count$$”. * * This class manages the conversions between the two ways of identifing the fields. */ export default class FormFieldIdentifier { /** * Indicate if the given identifier was valid. Other values may not be used if false. */ readonly valid: boolean; /** * The identifier of the player, the NPC or global (-Infinity). */ readonly player: number; /** * The field name. */ readonly name: string; /** * The field identifier. */ readonly identifier: string; /** * Create a new form field identifier from a field identifier. * * @param identifier - The field identifier (containing both player identifier and field name). */ constructor(identifier: string); /** * Create a new form field identifier from both player identifier and field name. * * @param player - The player identifier, or undefined for global field. * @param field - The field name. */ constructor(player: number, field: string); }