This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.

31 lines
641 B
Mathematica
Raw Normal View History

2021-04-02 02:24:13 +03:00
#import "REAStyleNode.h"
#import "REANodesManager.h"
@implementation REAStyleNode
{
NSMutableDictionary<NSString *, REANodeID> *_styleConfig;
}
- (instancetype)initWithID:(REANodeID)nodeID
config:(NSDictionary<NSString *, id> *)config;
{
if ((self = [super initWithID:nodeID config:config])) {
_styleConfig = config[@"style"];
}
return self;
}
- (id)evaluate
{
NSMutableDictionary *styles = [NSMutableDictionary new];
for (NSString *prop in _styleConfig) {
REANode *propNode = [self.nodesManager findNodeByID:_styleConfig[prop]];
styles[prop] = [propNode value];
}
return styles;
}
@end