WorldContext.loadEncrypted constructor
WorldContext.loadEncrypted({
- required String encryptionKey,
- String filename = encryptedWorldFilename,
- Game? game,
- CustomCommandsMap customCommands = const {},
- ErrorHandler? errorHandler,
Return an instance with its world loaded from an encrypted file.
Implementation
factory WorldContext.loadEncrypted({
required final String encryptionKey,
final String filename = encryptedWorldFilename,
final Game? game,
final CustomCommandsMap customCommands = const {},
final ErrorHandler? errorHandler,
}) {
final sdl = Sdl();
final world = World.loadEncrypted(
encryptionKey: encryptionKey,
filename: filename,
);
return WorldContext(
sdl: sdl,
game: game ??
Game(
'Worldsmith Game',
triggerMap: world.triggerMap,
),
world: world,
customCommands: customCommands,
errorHandler: errorHandler,
);
}