696 :(NSString *)property withValue:(id)value
697{
698 if ([property isEqualToString:@"coordinates"])
699 {
700
701
702 if (![value isKindOfClass:[NSString class]])
703 {
704 OOLog(
@"system.description.error",
@"'%@' is not a valid format for coordinates",value);
706 }
708 if ([tokens
count] != 2)
709 {
710 OOLog(
@"system.description.error",
@"'%@' is not a valid format for coordinates (must have exactly two numbers)",value);
712 }
713 }
714 else if ([property isEqualToString:@"radius"] || [property isEqualToString:@"government"])
715 {
716
717 if (![value isKindOfClass:[NSString class]])
718 {
719 if ([value isKindOfClass:[NSNumber class]])
720 {
721 return [value stringValue];
722 }
723 else
724 {
725 OOLog(
@"system.description.error",
@"'%@' is not a valid value for '%@' (string required)",value,property);
727 }
728 }
729 }
730 else if ([property isEqualToString:@"inhabitant"] || [property isEqualToString:@"inhabitants"] || [property isEqualToString:@"name"] )
731 {
732
733 if (![value isKindOfClass:[NSString class]])
734 {
735 OOLog(
@"system.description.error",
@"'%@' is not a valid value for '%@' (string required)",value,property);
737 }
738 }
739
740 return value;
741}
#define OOLog(class, format,...)
NSMutableArray * ScanTokensFromString(NSString *values)