Open ciajoe opened 8 years ago
We should implement different detection options for the differnt versions
Ein erweiterbares Pattern wie dieses hier vielleicht? (Interface implementieren + Dictionary) http://stackoverflow.com/questions/33878216/factory-pattern-without-a-switch-or-if-then
Looks a bit tricky to me... :|
Wir müssen keine Raketenwissenschaft betreiben. Grundsätzlich brauchen wir ja nur ein flexibles System, das für ein Merkmal x einen Detektor y zuordnen kann. Ob es sich lohnt für jedes Spiel eine eigene Klasse auf Basis einer Basisklasse / Interfaces anzulegen und dann ein Dictionary mit IGame => IGameDetector zu betreiben oder doch "nur" einen String ("em5-steam", "em5", ...) durch ein switch-Statement zu jagen, den jeweiligen Detektor aufzurufen und dann direkt den Pfad zu returnen, ist mir gleich. Grundsätzlich bin ich für Interfaces, dann können wir bessere Tests schreiben :joy:
Information is avablible in registry HKEY_LOCAL_MACHINE\SOFTWARE\Sixteen Tons Entertainment\EMERGENCY 5 If the Path-Key is set it should be avalible. Path is also usefull to get the mod dir in the Emergency5 installation dir. If Emergency is installed we can check the known appdata dir for mods too...