[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 /obj/handlers/random_names.c</h2>
Generates random names for whatever reason.
<p>
Werd - a perl script that generates random words according to some
           simple rules (inspired by phrase structure trees in Syntax).
<p>
Based on a program by Mark Rosenfelder (markrose@spss.com)
           called psrGrammar
<p>
Rewritten in perl by Chris Pound (pound@rice.edu)
<p>
Rewritten in lpc by Pinkfish@Discworld MUD.
           10th of January 1996.
<p>
Added a new form of randomised names based on a start bit, middle bit
and end bit.
<h2>Includes</h2>
This class includes the following files /include/player_handler.h and /include/random_names.h<h2>Class Index</h2>
<ul><li><a href="#class_sylable_language">sylable_language</a>
</ul><h2>Method index</h2>
<ul>
<li><a href="#add_test_language">add_test_language</a>(string)<br/>
This method adds in a language as a test language.
<li><a href="#open_file">open_file</a>(string)<br/>
Read in a random name grammer from the data dir.
<li><a href="#open_sylable_file">open_sylable_file</a>(string)<br/>
This method reads in a sylable file definition.
<li><a href="#query_languages">query_languages</a>()<br/>
The list of all the current languages known.
<li><a href="#query_test_languages">query_test_languages</a>()<br/>
This is the list of test rules in the handler.
<li><a href="#random_name">random_name</a>(string)<br/>
Returns a random name depending on the type of language.
<li><a href="#random_name_sylable">random_name_sylable</a>(string)<br/>
This returns a random name based on the sylable language type.
<li><a href="#random_name_werd">random_name_werd</a>(string)<br/>
Generate a random name in the given language.
<li><a href="#remove_test_language">remove_test_language</a>(string)<br/>
This method removes a language as a test language.
<li><a href="#unique_name">unique_name</a>(string)<br/>
Return a name that is not banished or a player name already.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="add_test_language">
add_test_language</a><pre class="autodocfuncdef">
void add_test_language(string lang)
</pre><dd><br />
This method adds in a language as a test language.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
lang - the test language to add
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="open_file">
open_file</a><pre class="autodocfuncdef">
void open_file(string f)
</pre><dd><br />
Read in a random name grammer from the data dir.   Any line with
# at the start is considered a comment, and anything after
a # on a line is ignored.   Every line in the file will have
3 fields seperated by a :.   The first field is the name
the second is a one letter expansion string, the third is a
a space separeted list of things to expand it to.
<p>
The word starts off as a "W", this is looked up in the expansion
first string list.   If it is found then that is expanded to
a random selection of the space seperated data elements.   This
process is repeated until there are no bits in the word that can
be expanded.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
f - the name of the file to read
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="open_sylable_file">
open_sylable_file</a><pre class="autodocfuncdef">
int open_sylable_file(string fname)
</pre><dd><br />
This method reads in a sylable file definition.  The format of this
file is [startstav] marks the start of the first bits.  [mittstav]
marks the middle bits and [slutstav] marks the end bits.  Every line
between the sections is included as part of a name.  [stop] marks
the end of the file, anything else in the file is ignored.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
file - the filename to parse<br />
<br />
<dd><b>Returns:</b>
<br />1 on success, 0 on failure
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_languages">
query_languages</a><pre class="autodocfuncdef">
string * query_languages()
</pre><dd><br />
The list of all the current languages known.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />an array of the language names.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_test_languages">
query_test_languages</a><pre class="autodocfuncdef">
string * query_test_languages()
</pre><dd><br />
This is the list of test rules in the handler.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the list of test rules
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="random_name">
random_name</a><pre class="autodocfuncdef">
string random_name(string lang)
</pre><dd><br />
Returns a random name depending on the type of language.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
lang - the language to use
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="random_name_sylable">
random_name_sylable</a><pre class="autodocfuncdef">
string random_name_sylable(string lang)
</pre><dd><br />
This returns a random name based on the sylable language type.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
lang - the language to use
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="random_name_werd">
random_name_werd</a><pre class="autodocfuncdef">
string random_name_werd(string lang)
</pre><dd><br />
Generate a random name in the given language.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
lang - the language to generate teh name int<br />
<br />
<dd><b>Returns:</b>
<br />the random name
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="remove_test_language">
remove_test_language</a><pre class="autodocfuncdef">
void remove_test_language(string lang)
</pre><dd><br />
This method removes a language as a test language.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
lang - the test language to remove
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="unique_name">
unique_name</a><pre class="autodocfuncdef">
string unique_name(string lang)
</pre><dd><br />
Return a name that is not banished or a player name already.
It is > 2 and < 11 chars, it is not banished, a player or
in the game.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
lang - the language to generat ethe name in<br />
<br />
<dd><b>Returns:</b>
<br />the generated name
<br /><br />
<br /></dl>

</dl>
<h2>Classes</h2>
These are nice data types for dealing with...  Data!<p>
<ul>
<li><a name="class_sylable_language">
sylable_language</a><pre>
class sylable_language {
                         string * start;
                         string * middle;
                         string * end;
}

</pre>
</ul>
[an error occurred while processing this directive]

