Create MapProcessorRegistry to add more maps

This commit is contained in:
Pragyansh Chaturvedi
2025-09-30 19:08:56 +05:30
parent cbc6b93cd8
commit 2e005f6eb5
2 changed files with 21 additions and 6 deletions

View File

@ -0,0 +1,16 @@
class MapProcessorRegistry:
"""Registry for map processor functions"""
_processors = {}
@classmethod
def register(cls, map_type_name):
"""Decorator to register a processor function for a map type"""
def decorator(func):
cls._processors[map_type_name] = func
return func
return decorator
@classmethod
def get_processor(cls, map_type_name):
"""Get the processor function for a map type"""
return cls._processors.get(map_type_name)