diff --git a/docs/1.0/.buildinfo b/docs/1.0/.buildinfo index f0f7c5f185..71ac945df2 100644 --- a/docs/1.0/.buildinfo +++ b/docs/1.0/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: dc5dc3d06fba772ca40e769170ab27fe +config: ca4c2f0bf5c44a7550ab8d7d4720df35 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/1.0/Howtos/Beginner-Tutorial/Beginner-Tutorial-Overview.html b/docs/1.0/Howtos/Beginner-Tutorial/Beginner-Tutorial-Overview.html index 83599b66ee..b6276fb568 100644 --- a/docs/1.0/Howtos/Beginner-Tutorial/Beginner-Tutorial-Overview.html +++ b/docs/1.0/Howtos/Beginner-Tutorial/Beginner-Tutorial-Overview.html @@ -248,6 +248,7 @@ Click here to expand a list of all Beginner-Tutorial sections (all parts).
--Avoid renaming unless it’s to avoid a name-collistion like above - you want to make things as -easy to read as possible, and renaming adds another layer of potential confusion.
+Avoid renaming unless it’s to avoid a name-collistion like above - you want to make things as easy to read as possible, and renaming adds another layer of potential confusion.
In the basic intro to Python we learned how to open the in-game multi-line interpreter.
@@ -219,25 +219,23 @@ Hello World! Closing the Python console.The same goes when writing code in a module - in most Python modules you will see a bunch of -imports at the top, resources that are then used by all code in that module.
+ +The same goes when writing code in a module - in most Python modules you will see a bunch of imports at the top, resources that are then used by all code in that module.
5.2. On classes and objects¶
Now that we know about imports, let look at a real Evennia module and try to understand it.
-Open
-mygame/typeclasses/objects.pyin your text editor of choice.""" +Open
+mygame/typeclasses/scripts.pyin your text editor of choice.# mygame/typeclasses/script.py +""" module docstring """ -from evennia import DefaultObject +from evennia import DefaultScript -class ObjectParent: - """ - class docstring - """ - pass - -class Object(DefaultObject): +class Script(DefaultScript): """ class docstring """ @@ -248,15 +246,12 @@ imports at the top, resources that are then used by all code in that module.A docstring is not the same as a comment (created by
-#). A docstring is not ignored by Python but is an integral part of the thing it is documenting (the module and the class in this case). For example, we read docstrings to help text for API documentation; we could not do that with comments.The real file is much longer but we can ignore the multi-line strings (
-""" ... """). These serve -as documentation-strings, or docstrings for the module (at the top) and theclassbelow.Below the module doc string we have the import. In this case we are importing a resource +
The real file is much longer but we can ignore the multi-line strings (
+""" ... """). These serve as documentation-strings, or docstrings for the module (at the top) and theclassbelow.Below the module doc string we have the import. In this case we are importing a resource from the core
-evennialibrary itself. We will dive into this later, for now we just treat this as a black box.Next we have an empty
-classnamedObjectParent. It doesn’t do anything, its only code (except the docstring) ispasswhich means, well, to pass and don’t do anything. Since it also doesn’t inherit from anything, it’s just an empty container. We will not concern ourselves with it for this tutorial.The
-classnamedObject_ inherits_ fromObjectParentandDefaultObject. Since we see thatObjectParentis empty, what is interesting isDefaultObject. Again, theObjectclass doesn’t -actually do anything on its own right now, but because of it being a child ofDefaultObject, it’s actually providing a lot of functionality! If this is confusing, read on.We will get back to this module in the next lesson. First we need to do a little detour to understand what a ‘class’, an ‘object’ or ‘instance’ is. These are fundamental things to understand before you can use Evennia efficiently.
+The
+classnamedScript_ inherits_ fromDefaultScript. As you can seeScriptis pretty much empty. All the useful code is actually inDefaultScript(Scriptinherits that code unless it overrides it with same-named code of its own).We need to do a little detour to understand what a ‘class’, an ‘object’ or ‘instance’ is. These are fundamental things to understand before you can use Evennia efficiently.