Dentosal / python-sc2

A StarCraft II bot api client library for Python 3
MIT License
586 stars 182 forks source link

Wiki development #135

Open Vakorg opened 6 years ago

Vakorg commented 6 years ago

I think that need to use code samples in the wiki, such as here https://docs.screeps.com/api/

BurnySc2 commented 6 years ago

That's a great idea! In my opinion, the wiki needs a huge rework anyway. Lots of Units filters and Unit properties were added. I suppose small code samples should be added to the wiki, but adding all filters and properties would be too much. I will try to edit the wiki when I have spare time.

Do you know a good way to do type annotation in python code samples? For example:

for my_structure in self.units.structure.not_ready:
    print("This structure {} is still in construction: {}%".format(my_structure, round(my_structure.build_progress * 100, 1)))

Here, my_structure is of type Unit which would be good to know.

PS: Screeps is an awesome game, too bad I dislike javascript :(