cocos2d-x には NSValue のビルトイン アナログがないようです。そのため、次のメソッドの変換に問題があります。
- (BOOL)isEmpty:(id)target :(CGPoint)position {
BOOL result = YES;
// objectForKey receives "id" parameter, not "const &string"
Trail *trail = [_objects objectForKey:[NSValue valueWithCGPoint:position]];
if(trail && [trail.target isEqual:target]) {
result = NO;
}
return result;
}
cocos2d-x には、同じロジックを持つ CCDictionary と呼ばれる NSDictionary の独自の実装があります。したがって、Objective-C で行うのと同じ方法でオブジェクトを格納できますが、キーが 'id' のような型を持つキーでオブジェクトを抽出することはできません。CCDictionary は、キーの型が std::string または int の場合にのみ値を抽出できます。上で述べたように、cocos2d-x には NSValue の類似物はありません。