バックエンドAPI
This commit is contained in:
23
research_dip.py
Normal file
23
research_dip.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from diplomacy import Game
|
||||
|
||||
def research():
|
||||
game = Game()
|
||||
print(f"Current Phase: {game.phase}")
|
||||
print(f"Powers: {list(game.powers.keys())}")
|
||||
|
||||
# Check powers and units
|
||||
for power_name, power in game.powers.items():
|
||||
print(f"Power: {power_name}, Centers: {power.centers}, Units: {power.units}")
|
||||
|
||||
# Check serialization
|
||||
# Game objects have a to_dict method or similar?
|
||||
# Let's inspect the object
|
||||
print("\nAttributes of Game object:")
|
||||
print([attr for attr in dir(game) if not attr.startswith('_')])
|
||||
|
||||
# Example of setting orders
|
||||
# game.set_orders('FRANCE', ['A MAR H', 'A PAR - BUR', 'F BRE - MAO'])
|
||||
# game.process()
|
||||
|
||||
if __name__ == "__main__":
|
||||
research()
|
||||
Reference in New Issue
Block a user