[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /global/cloner.c</h2>
Used for mapping deleted files to new ones when things are changed.
Updated to a more tidy mechanism by Ceres 14/3/96
<p>
Usage: call add_mapping(from, to) /global/cloner
<h2>Inherits</h2>
This class inherits the following classes <a href="std.object.c.shtml">/std/object.c</a><h2>Method index</h2>
<dl><ul>
<li><a href="#add_illegal">add_illegal</a>(string, string, string)<br/>
This method is used to add objects that we don't want to be reloaded.
<li><a href="#add_mapping">add_mapping</a>(string, string)<br/>
Use this function to add a new mapping of one filename to another.
<li><a href="#clone">clone</a>(string)<br/>
Try and clone the passed in object.
<li><a href="#illegal_thing">illegal_thing</a>(string, string)<br/>
Determine if a given object is illegal.
<li><a href="#list_mappings">list_mappings</a>(string)<br/>
This method returns a list of all the current mappings.
<li><a href="#load_file">load_file</a>()<br/>
Loads the current configuration.
<li><a href="#other_file">other_file</a>(string)<br/>
This method returns the mapped name of the object.
<li><a href="#query_changes">query_changes</a>()<br/>
This method returns the list of currently moved objects.
<li><a href="#query_illegal">query_illegal</a>()<br/>
List the illegal objects.
<li><a href="#remove_illegal">remove_illegal</a>(string, string)<br/>
Remove an item from the illegal array
<li><a href="#remove_mapping">remove_mapping</a>(string)<br/>
Removes a mapping from the object.
<li><a href="#save_file">save_file</a>()<br/>
Saves the current configuration.
</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="add_illegal">
add_illegal</a><pre>
int add_illegal(string basename,
                string short,
                string replacement)
</pre></br>
This method is used to add objects that we don't want to be reloaded.
This is for those objects that are clones of /std/object or /obj/armour
or something but which are wrongly configured.

<br/><ul>
<li><b>Parameters:</b>
<br/>basename - the base filename of the object
<br/>short - the short name of the object
<br/>replacement - the replacement object.
<li><b>Returns:</b>
<br/>1 for success, 0 for failure

<li><b>Example:</b>
<br/><pre>add_illegal("/obj/armour", "blue robe", 
                       "/obj/armours/robe.arm);
</pre></dl>

<ul><a name="add_mapping">
add_mapping</a><pre>
int add_mapping(string from,
                string to)
</pre></br>
Use this function to add a new mapping of one filename to another.
Means that if an object of type 'from' is attempted to be cloned
an object of type 'to' will be cloned instead.
<br/><ul>
<li><b>Parameters:</b>
<br/>from - the old object name
<br/>to - the new object name
<li><b>Returns:</b>
<br/>1 on success, 0 on failure
<li><b>See also:</b>
<br/><a href="#remove_mapping">remove_mapping()</a> and <a href="#list_mappings">list_mappings()
</a></dl>

<ul><a name="clone">
clone</a><pre>
object clone(string word)
</pre></br>
Try and clone the passed in object.  If the name exists in the changes
array then the new file name is cloned instead of the old one.
<br/><ul>
<li><b>Parameters:</b>
<br/>word - the name of the file to clone
<li><b>Returns:</b>
<br/>the cloned object
<li><b>See also:</b>
<br/><a href="#other_file">other_file()</a> and <a href="#list_mappings">list_mappings()
</a></dl>

<ul><a name="illegal_thing">
illegal_thing</a><pre>
string illegal_thing(string basename,
                     string short)
</pre></br>
Determine if a given object is illegal.
<br/><ul>
<li><b>Parameters:</b>
<br/>basename - the basename of the object.
<br/>short - the shortname of the object.
<li><b>Returns:</b>
<br/>1 for success, 0 for failure

</dl>

<ul><a name="list_mappings">
list_mappings</a><pre>
string list_mappings(string str)
</pre></br>
This method returns a list of all the current mappings.  If a
pattern is given, then only files which contain that string will
be returned.
<br/><ul>
<li><b>Parameters:</b>
<br/>str - the pattern to search for
<li><b>Returns:</b>
<br/>the list of mappings
<li><b>See also:</b>
<br/><a href="#add_mapping">add_mapping()</a> and <a href="#remove_mapping">remove_mapping()
</a></dl>

<ul><a name="load_file">
load_file</a><pre>
void load_file()
</pre></br>
Loads the current configuration.


<ul><a name="other_file">
other_file</a><pre>
string other_file(string word)
</pre></br>
This method returns the mapped name of the object.  If no mapping
exists the passed in value is returned directly.
<br/><ul>
<li><b>Parameters:</b>
<br/>word - the object name to get a mapping for
<li><b>Returns:</b>
<br/>the file to use
<li><b>See also:</b>
<br/><a href="#clone">clone()</a> and <a href="#list_mappings">list_mappings()
</a></dl>

<ul><a name="query_changes">
query_changes</a><pre>
mapping query_changes()
</pre></br>
This method returns the list of currently moved objects.


<ul><a name="query_illegal">
query_illegal</a><pre>
mapping query_illegal()
</pre></br>
List the illegal objects.


<ul><a name="remove_illegal">
remove_illegal</a><pre>
int remove_illegal(string basename,
                   string short)
</pre></br>
Remove an item from the illegal array
<br/><ul>
<li><b>Parameters:</b>
<br/>basename - the basename of the object.
<br/>short - the shortname of the object.
<li><b>Returns:</b>
<br/>1 for success, 0 for failure

</dl>

<ul><a name="remove_mapping">
remove_mapping</a><pre>
int remove_mapping(string from)
</pre></br>
Removes a mapping from the object.  This looks to see if an mapping
exists for the object and removes it if it does.
<br/><ul>
<li><b>Parameters:</b>
<br/>from - the object to remove the mapping from
<li><b>Returns:</b>
<br/>1 on success and 0 on failure
<li><b>See also:</b>
<br/><a href="#add_mapping">add_mapping()</a> and <a href="#list_mappings">list_mappings()
</a></dl>

<ul><a name="save_file">
save_file</a><pre>
void save_file()
</pre></br>
Saves the current configuration.



[an error occurred while processing this directive]

