mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-02 15:56:21 +00:00
55 lines
1.2 KiB
Objective-C
55 lines
1.2 KiB
Objective-C
//
|
|
// TemporaryApp.m
|
|
// Moonlight
|
|
//
|
|
// Created by Cameron Gutman on 9/30/15.
|
|
// Copyright © 2015 Moonlight Stream. All rights reserved.
|
|
//
|
|
|
|
#import "TemporaryApp.h"
|
|
|
|
@implementation TemporaryApp
|
|
|
|
- (id) initFromApp:(App*)app withTempHost:(TemporaryHost*)tempHost {
|
|
self = [self init];
|
|
|
|
self.id = app.id;
|
|
self.name = app.name;
|
|
self.hdrSupported = app.hdrSupported;
|
|
self.hidden = app.hidden;
|
|
self.host = tempHost;
|
|
|
|
return self;
|
|
}
|
|
|
|
- (void) propagateChangesToParent:(App*)parent withHost:(Host*)host {
|
|
parent.id = self.id;
|
|
parent.name = self.name;
|
|
parent.hdrSupported = self.hdrSupported;
|
|
parent.hidden = self.hidden;
|
|
parent.host = host;
|
|
}
|
|
|
|
- (NSComparisonResult)compareName:(TemporaryApp *)other {
|
|
return [self.name caseInsensitiveCompare:other.name];
|
|
}
|
|
|
|
- (NSUInteger)hash {
|
|
return [self.host.uuid hash] * 31 + [self.id intValue];
|
|
}
|
|
|
|
- (BOOL)isEqual:(id)object {
|
|
if (self == object) {
|
|
return YES;
|
|
}
|
|
|
|
if (![object isKindOfClass:[self class]]) {
|
|
return NO;
|
|
}
|
|
|
|
return [self.host.uuid isEqualToString:((App*)object).host.uuid] &&
|
|
[self.id isEqualToString:((App*)object).id];
|
|
}
|
|
|
|
@end
|