Updated README.md
This commit is contained in:
parent
02d63cc703
commit
087aa580a4
11
README.md
11
README.md
@ -38,8 +38,17 @@ https://python-tcod.readthedocs.io/en/latest/
|
||||
## Setup and Notes
|
||||
|
||||
```bash
|
||||
#make the virtual environment
|
||||
python3 -m venv venv
|
||||
./venv/bin/tcod
|
||||
|
||||
#useful pre-commit hook
|
||||
lint_results=$(echo "$(grep -Pro '[\t]+$' */*.py)")
|
||||
lint_errors=$(echo "$lint_results" | wc -w)
|
||||
if [ $lint_errors -gt 0 ]; then
|
||||
echo "pre-commit lint errors found: $lint_errors"
|
||||
echo "$lint_results"
|
||||
fi
|
||||
exit $lint_errors
|
||||
```
|
||||
|
||||
heapq is a thing for the speed sorting
|
||||
|
@ -62,7 +62,7 @@ class Engine:
|
||||
if entity.ai:
|
||||
action = entity.ai.process()
|
||||
result |= action.apply()
|
||||
|
||||
|
||||
return result
|
||||
|
||||
def handle_rendering(self, context: Context, console: Console) -> None:
|
||||
|
@ -32,7 +32,7 @@ class Entity:
|
||||
#monster-specific stuff
|
||||
if ai_class:
|
||||
self.ai: Optional[BaseAI] = ai_class(self)
|
||||
|
||||
|
||||
if stats:
|
||||
self.stats = stats
|
||||
self.stats.entity = self
|
||||
@ -49,7 +49,7 @@ class Entity:
|
||||
def set_pos(self, x: int, y: int) -> None:
|
||||
self.x = x
|
||||
self.y = y
|
||||
|
||||
|
||||
#monster-specific stuff
|
||||
def is_alive(self) -> bool:
|
||||
return bool(self.ai)
|
||||
|
Loading…
x
Reference in New Issue
Block a user