Update README.md
Fix header levels
This commit is contained in:
parent
616daf723a
commit
b13e4499ca
1 changed files with 5 additions and 5 deletions
|
|
@ -2,23 +2,23 @@
|
||||||
|
|
||||||
_Contrib by ChrisLR 2021_
|
_Contrib by ChrisLR 2021_
|
||||||
|
|
||||||
# The Components Contrib
|
## The Components Contrib
|
||||||
|
|
||||||
This contrib introduces Components and Composition to Evennia.
|
This contrib introduces Components and Composition to Evennia.
|
||||||
Each 'Component' class represents a feature that will be 'enabled' on a typeclass instance.
|
Each 'Component' class represents a feature that will be 'enabled' on a typeclass instance.
|
||||||
You can register these components on an entire typeclass or a single object at runtime.
|
You can register these components on an entire typeclass or a single object at runtime.
|
||||||
It supports both persisted attributes and in-memory attributes by using Evennia's AttributeHandler.
|
It supports both persisted attributes and in-memory attributes by using Evennia's AttributeHandler.
|
||||||
|
|
||||||
# Pros
|
## Pros
|
||||||
- You can reuse a feature across multiple typeclasses without inheritance
|
- You can reuse a feature across multiple typeclasses without inheritance
|
||||||
- You can cleanly organize each feature into a self-contained class.
|
- You can cleanly organize each feature into a self-contained class.
|
||||||
- You can check if your object supports a feature without checking its instance.
|
- You can check if your object supports a feature without checking its instance.
|
||||||
|
|
||||||
# Cons
|
## Cons
|
||||||
- It introduces additional complexity.
|
- It introduces additional complexity.
|
||||||
- A host typeclass instance is required.
|
- A host typeclass instance is required.
|
||||||
|
|
||||||
# How to install
|
## How to install
|
||||||
|
|
||||||
To enable component support for a typeclass,
|
To enable component support for a typeclass,
|
||||||
import and inherit the ComponentHolderMixin, similar to this
|
import and inherit the ComponentHolderMixin, similar to this
|
||||||
|
|
@ -126,7 +126,7 @@ from typeclasses.components import health
|
||||||
```
|
```
|
||||||
Both of the above examples will work.
|
Both of the above examples will work.
|
||||||
|
|
||||||
# Full Example
|
## Full Example
|
||||||
```python
|
```python
|
||||||
from evennia.contrib.base_systems import components
|
from evennia.contrib.base_systems import components
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue