Converting Sharpy bot from before 2.0 version - DrInfy/sharpy-sc2 GitHub Wiki
The big difference between KnowledgeBot before 2.0 version and after 2.0 version is that Knowledge now hardly contains any functionality and is there to just hold the managers that do the actual work. Only forced managers in Knowledge are VersionManager, ActionManager and LogManager. When the refactor is fully completed, there will not be any references to any other manager in Knowledge or Component.
- Managers like
self.zone_managerandself.rolesare inKnowledgeBotinstead ofKnowledge. Knowledgeno longer containsself.known_enemy_unitsand you should instead use the similar functionality inBotAIinstead: python-sc2 instructions- Prefiltered properties like
.enemy_townhallsand.known_enemy_workersno longer exist inKnowledgeand are instead available inIUnitCache. RequireCustomnow takes in theSkeletonBotclass instead ofKnowledge. This is in line with the change to keep the manager home in the bot instead.Componentclasses (basically almost everything in sharpy) no longer contain direct links to every single manager in Sharpy. Instead you should request managers for the current component withself.get_required_manager(ManagerType)instead.- In order to reduce the forced bloat from sharpy, some of the managers have been removed from the default
KnowledgeBot:ChatManagerandBuildDetector. You can add them back by overridingconfigure_managersmethod inKnowledgeBot - Shortcut
knowledge.possible_rush_detectedis no longer available and BuildDetector.rush_detected should be used instead. - All shortcuts to
ZoneManagerproperties inKnowledgehave been removed and references toIZoneManagerproperties should be used instead.