5 // Created by Sam McCall on 6/05/09.
8 #import "NJOutputMapping.h"
10 #import "EnjoyableApplicationDelegate.h"
12 #import "NJMappingsController.h"
14 @implementation NJOutputMapping
16 + (NSString *)serializationCode {
20 - (NSDictionary *)serialize {
22 ? @{ @"type": self.class.serializationCode, @"name": _mapping.name }
26 + (NJOutputMapping *)outputDeserialize:(NSDictionary *)serialization
27 withMappings:(NSArray *)mappings {
28 NSString *name = serialization[@"name"];
29 NJOutputMapping *output = [[NJOutputMapping alloc] init];
30 for (NJMapping *mapping in mappings) {
31 if ([mapping.name isEqualToString:name]) {
32 output.mapping = mapping;
40 EnjoyableApplicationDelegate *ctrl = (EnjoyableApplicationDelegate *)NSApplication.sharedApplication.delegate;
41 [ctrl.mappingsController activateMapping:_mapping];