Updated HTML docs.

This commit is contained in:
Evennia docbuilder action 2023-12-19 23:50:38 +00:00
parent 5884f92313
commit 81d3dced1b
672 changed files with 113 additions and 178 deletions

View file

@ -639,7 +639,7 @@ set a random value from 3 to 18 to each stat. Simple, but for some classical RPG
</aside>
<p>Hm, this is the same values we set before. They are not random. The reason for this is of course that, as said, <code class="docutils literal notranslate"><span class="pre">at_object_creation</span></code> only runs <em>once</em>, the very first time a character is created. Our character object was already created long before, so it will not be called again.</p>
<p>Its simple enough to run it manually though:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&gt; self.at_object_creation()
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&gt; py self.at_object_creation()
&gt; py self.get_stats()
(5, 4, 8)
</pre></div>

View file

@ -334,11 +334,11 @@ testing <code class="docutils literal notranslate"><span class="pre">get_obj_sta
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># mygame/evadventure/tests/test_utils.py</span>
<span class="kn">from</span> <span class="nn">evennia.utils</span> <span class="kn">import</span> <span class="n">create</span>
<span class="kn">from</span> <span class="nn">evennia.utils.test_resources</span> <span class="kn">import</span> <span class="n">BaseEvenniaTest</span>
<span class="kn">from</span> <span class="nn">evennia.utils.test_resources</span> <span class="kn">import</span> <span class="n">EvenniaTest</span>
<span class="kn">from</span> <span class="nn">..import</span> <span class="n">utils</span>
<span class="k">class</span> <span class="nc">TestUtils</span><span class="p">(</span><span class="n">BaseEvenniaTest</span><span class="p">):</span>
<span class="k">class</span> <span class="nc">TestUtils</span><span class="p">(</span><span class="n">EvenniaTest</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">test_get_obj_stats</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="c1"># make a simple object to test with </span>
<span class="n">obj</span> <span class="o">=</span> <span class="n">create</span><span class="o">.</span><span class="n">create_object</span><span class="p">(</span>
@ -365,7 +365,7 @@ testing <code class="docutils literal notranslate"><span class="pre">get_obj_sta
</pre></div>
</div>
<p>What happens here is that we create a new test-class <code class="docutils literal notranslate"><span class="pre">TestUtils</span></code> that inherits from <code class="docutils literal notranslate"><span class="pre">BaseEvenniaTest</span></code>. This inheritance is what makes this a testing class.</p>
<p>What happens here is that we create a new test-class <code class="docutils literal notranslate"><span class="pre">TestUtils</span></code> that inherits from <code class="docutils literal notranslate"><span class="pre">EvenniaTest</span></code>. This inheritance is what makes this a testing class.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Its useful for any game dev to know how to effectively test their code. So well try to include a <em>Testing</em> section at the end of each of the implementation lessons to follow. Writing tests for your code is optional but highly recommended. It can feel a little cumbersome or time-consuming at first … but youll thank yourself later.</p>