public static class SceneToGame{
public static GameParentServer Server(int scene, Server server){
switch (scene){
case 1:
return new SnapGameServer(server);
default:
return null;
}
}
}
I'm currently using this to map ints to classes with a common parent. Is there a cleaner way to do this? From what I've read you can't because C# is type safe despite this being type safe.
CodePudding user response: