23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
_sdesc = @"";
_address.host = ENET_HOST_ANY;
_address.port = CUBE_SERVINFO_PORT;
return self;
}
- (OFComparisonResult)compare:(id)otherObject
{
if (![otherObject isKindOfClass:ServerInfo.class])
@throw [OFInvalidArgumentException exception];
if (_ping > [otherObject ping])
return OFOrderedDescending;
if (_ping < [otherObject ping])
return OFOrderedAscending;
return [_name compare:[otherObject name]];
}
@end
|
|
|
|
|
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
_sdesc = @"";
_address.host = ENET_HOST_ANY;
_address.port = CUBE_SERVINFO_PORT;
return self;
}
- (OFComparisonResult)compare:(ServerInfo *)otherObject
{
if (![otherObject isKindOfClass:ServerInfo.class])
@throw [OFInvalidArgumentException exception];
if (_ping > otherObject.ping)
return OFOrderedDescending;
if (_ping < otherObject.ping)
return OFOrderedAscending;
return [_name compare:otherObject.name];
}
@end
|