2021-09-07 19:56:15 +02:00
|
|
|
from typing import List, Optional, Type
|
2019-12-08 22:43:49 +01:00
|
|
|
|
|
|
|
from bemani.backend.base import Base, Factory
|
|
|
|
from bemani.backend.jubeat.stubs import (
|
|
|
|
Jubeat,
|
|
|
|
JubeatRipples,
|
|
|
|
JubeatRipplesAppend,
|
|
|
|
JubeatKnit,
|
|
|
|
JubeatKnitAppend,
|
|
|
|
JubeatCopious,
|
|
|
|
JubeatCopiousAppend,
|
|
|
|
)
|
|
|
|
from bemani.backend.jubeat.saucer import JubeatSaucer
|
|
|
|
from bemani.backend.jubeat.saucerfulfill import JubeatSaucerFulfill
|
|
|
|
from bemani.backend.jubeat.prop import JubeatProp
|
|
|
|
from bemani.backend.jubeat.qubell import JubeatQubell
|
|
|
|
from bemani.backend.jubeat.clan import JubeatClan
|
|
|
|
from bemani.backend.jubeat.festo import JubeatFesto
|
|
|
|
from bemani.common import Model
|
2021-08-20 06:43:59 +02:00
|
|
|
from bemani.data import Config, Data
|
2019-12-08 22:43:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
class JubeatFactory(Factory):
|
|
|
|
|
2021-09-07 19:56:15 +02:00
|
|
|
MANAGED_CLASSES: List[Type[Base]] = [
|
2019-12-08 22:43:49 +01:00
|
|
|
Jubeat,
|
|
|
|
JubeatRipples,
|
|
|
|
JubeatRipplesAppend,
|
|
|
|
JubeatKnit,
|
|
|
|
JubeatKnitAppend,
|
|
|
|
JubeatCopious,
|
|
|
|
JubeatCopiousAppend,
|
|
|
|
JubeatSaucer,
|
|
|
|
JubeatSaucerFulfill,
|
|
|
|
JubeatProp,
|
|
|
|
JubeatQubell,
|
|
|
|
JubeatClan,
|
|
|
|
JubeatFesto,
|
|
|
|
]
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def register_all(cls) -> None:
|
2021-08-19 21:20:31 +02:00
|
|
|
for gamecode in ['H44', 'I44', 'J44', 'K44', 'L44']:
|
|
|
|
Base.register(gamecode, JubeatFactory)
|
2019-12-08 22:43:49 +01:00
|
|
|
|
|
|
|
@classmethod
|
2021-08-20 06:43:59 +02:00
|
|
|
def create(cls, data: Data, config: Config, model: Model, parentmodel: Optional[Model]=None) -> Optional[Base]:
|
2021-08-19 21:20:31 +02:00
|
|
|
if model.gamecode == 'H44':
|
2019-12-08 22:43:49 +01:00
|
|
|
return Jubeat(data, config, model)
|
2021-08-19 21:20:31 +02:00
|
|
|
if model.gamecode == 'I44':
|
2019-12-08 22:43:49 +01:00
|
|
|
if model.version >= 2010031800:
|
|
|
|
return JubeatRipplesAppend(data, config, model)
|
|
|
|
else:
|
|
|
|
return JubeatRipples(data, config, model)
|
2021-08-19 21:20:31 +02:00
|
|
|
if model.gamecode == 'J44':
|
2019-12-08 22:43:49 +01:00
|
|
|
if model.version >= 2011032300:
|
|
|
|
return JubeatKnitAppend(data, config, model)
|
|
|
|
else:
|
|
|
|
return JubeatKnit(data, config, model)
|
2021-08-19 21:20:31 +02:00
|
|
|
if model.gamecode == 'K44':
|
2019-12-08 22:43:49 +01:00
|
|
|
if model.version >= 2012031400:
|
|
|
|
return JubeatCopiousAppend(data, config, model)
|
|
|
|
else:
|
|
|
|
return JubeatCopious(data, config, model)
|
2021-08-19 21:20:31 +02:00
|
|
|
if model.gamecode == 'L44':
|
2019-12-08 22:43:49 +01:00
|
|
|
if model.version <= 2014022400:
|
|
|
|
return JubeatSaucer(data, config, model)
|
|
|
|
if model.version >= 2014030300 and model.version < 2015022000:
|
|
|
|
return JubeatSaucerFulfill(data, config, model)
|
|
|
|
if model.version >= 2015022000 and model.version < 2016033000:
|
|
|
|
return JubeatProp(data, config, model)
|
|
|
|
if model.version >= 2016033000 and model.version < 2017062600:
|
|
|
|
return JubeatQubell(data, config, model)
|
|
|
|
if model.version >= 2017062600 and model.version < 2018090500:
|
|
|
|
return JubeatClan(data, config, model)
|
|
|
|
if model.version >= 2018090500:
|
|
|
|
return JubeatFesto(data, config, model)
|
|
|
|
|
|
|
|
# Unknown game version
|
|
|
|
return None
|