Esempio n. 1
0
    def create(cls, data: Data, config: Dict[str, Any], model: Model, parentmodel: Optional[Model]=None) -> Optional[Base]:

        def version_from_date(date: int) -> Optional[int]:
            if date <= 2016072600:
                return VersionConstants.MUSECA
            if date > 2016072600:
                return VersionConstants.MUSECA_1_PLUS
            return None

        if model.game == 'PIX':
            version = version_from_date(model.version)
            if version == VersionConstants.MUSECA:
                return Museca1(data, config, model)
            if version == VersionConstants.MUSECA_1_PLUS:
                return Museca1Plus(data, config, model)

        # Unknown game version
        return None
Esempio n. 2
0
 def previous_version(self) -> Optional[MusecaBase]:
     return Museca1(self.data, self.config, self.model)