-
Notifications
You must be signed in to change notification settings - Fork 0
Chunk
Gentilhomme edited this page Jul 26, 2016
·
10 revisions
Chunks are used to manage global variables and reseatable variables in the most case. Chunks also offer object-oriented automatic & intelligent implementation with others components.
Warning : Do not use Chunk to replace behavior properties (this is a wrong solution).
interface IPlayer {
name: string;
exp: number;
level: number;
}
const Player : United.Collections.Chunk<IPlayer> = new United.Collections.Chunk<IPlayer>({
name: "fraxken",
exp: 0,
level: 0
});
Sup.log(Player.$.name); // log fraxken
Player.$.level = 10; // Set level to 10
Player.resetVar("level"); // Reset level to the original value : 0
Player.resetAll(); // Reset all variables of player chunk.
Constructor with no argument.
constructor()
Unstable method. Do not use !
public set authentification(value: boolean)
Clear the entiere chunk.
clear() : boolean
Clone the chunk.
clone() : United.Collections.Chunk<T>
declare new variables (any or linked to the interface).
declare(Object: I) : boolean
remove one or multiple variables from the chunk.
remove(varName: string | string[])
know if the chunk have a variable
has(varName: string) : boolean
Reset specific variable.
resetVar(varName: string) : boolean
Reset all variables
resetAll() : void
Rename a variable !
rename(varName: string,newName: string) : boolean
- Observable & intelligent mapping functions integration.
Contributor :
- Fraxken
- Purexo