qualifiers |
Discworld creator help |
qualifiers |
Description
The very types you assign variables and functions can have qualifiers changing the way they work. Most work differently when applied to variables rather than functions, and this help file will try to explain the various qualifiers in existence.
The 'nosave' variable qualifier
nosave int count;
nosave mapping sheep;
The efun save_object() saves the values of all global variables in the current object to a specified save file. However, if a global variable is declared nosave, that variable will not be saved by save_object(), and so not restored again by restore_object().
The 'protected' function qualifier
protected int do_save();
protected void query_valid( object ob );
A function that is declared protected can not be called using external calls, only internal. This makes the function 'invisible' and inaccessable for other objects.
The 'private' function/variable qualifier
private int cmd();
private string query_real_name( object ob );
private object fluff;
private class list a_list;
A global variable or function that has been declared as private will not be inherited down to another object. They can only be accessed within the object that defines it.
The 'nomask' function/variable qualifier
nomask int query_death_xp();
nomask int print_history( string arg );
nomask mixed var;
nomask string unique;
Functions and variables that are declared as nomask can not be masked in any way, neither by shadowing nor inheriting. If you try you will be given an error message.
The 'public' function/variable qualifier
public void convert_allow_list();
public void set_hunger( int new_amount );
public string short;
public object best_friend;
This is the default qualifier. It means there is no limits other than those which the language imposes on accessing, saving and masking.
Different qualifiers can be combined to provide the security level you need for a specific function/variable.