pyttd 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyttd might be problematic. Click here for more details.
- pyttd/__init__.py +44 -0
- pyttd/client.py +1356 -0
- pyttd/commands.py +415 -0
- pyttd/game_state.py +344 -0
- pyttd/protocol.py +341 -0
- pyttd/py.typed +0 -0
- pyttd-1.0.0.dist-info/METADATA +253 -0
- pyttd-1.0.0.dist-info/RECORD +12 -0
- pyttd-1.0.0.dist-info/WHEEL +5 -0
- pyttd-1.0.0.dist-info/entry_points.txt +2 -0
- pyttd-1.0.0.dist-info/licenses/LICENSE +21 -0
- pyttd-1.0.0.dist-info/top_level.txt +1 -0
pyttd/__init__.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""
|
|
2
|
+
PyTTD - Python OpenTTD Client Library
|
|
3
|
+
=====================================
|
|
4
|
+
|
|
5
|
+
A modern Python client library for connecting to and playing on OpenTTD servers.
|
|
6
|
+
Create AI bots, manage companies, and interact with OpenTTD games programmatically
|
|
7
|
+
with real-time data.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
from pyttd import OpenTTDClient
|
|
11
|
+
|
|
12
|
+
client = OpenTTDClient("127.0.0.1", 3979)
|
|
13
|
+
client.connect()
|
|
14
|
+
|
|
15
|
+
# Get real-time game data
|
|
16
|
+
game_info = client.get_game_info()
|
|
17
|
+
print(f"Game year: {game_info['current_year']}")
|
|
18
|
+
print(f"Companies: {game_info['companies']}")
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from .client import OpenTTDClient
|
|
22
|
+
from .protocol import Packet, PacketType
|
|
23
|
+
from .game_state import GameState, CompanyInfo, ClientInfo, VehicleInfo, MapInfo
|
|
24
|
+
from .commands import Commands, CommandBuilder, CommandPacket, CompanyID
|
|
25
|
+
|
|
26
|
+
__version__ = "1.0.0"
|
|
27
|
+
__author__ = "mssc89"
|
|
28
|
+
__description__ = "Python OpenTTD Client Library"
|
|
29
|
+
__url__ = "https://github.com/mssc89/pyttd"
|
|
30
|
+
|
|
31
|
+
__all__ = [
|
|
32
|
+
"OpenTTDClient",
|
|
33
|
+
"Packet",
|
|
34
|
+
"PacketType",
|
|
35
|
+
"GameState",
|
|
36
|
+
"CompanyInfo",
|
|
37
|
+
"ClientInfo",
|
|
38
|
+
"VehicleInfo",
|
|
39
|
+
"MapInfo",
|
|
40
|
+
"Commands",
|
|
41
|
+
"CommandBuilder",
|
|
42
|
+
"CommandPacket",
|
|
43
|
+
"CompanyID",
|
|
44
|
+
]
|