質問

C# XNA Xbox, in this case optional parameters are not optional

Thanks to help from the above question optional parameters are now working, or at least appear as if they should work.

However I'm now stuck on HashSets and Tuples, that don't appear to be available either.

I could write my own version of both classes. Tuple from scratch and HashSet using a Dictonary (possibly). However I'd rather keep to using the standard ones.

If these classes exist in the PC verstion of the library, then can I copy and paste them from the PC C# library into my own code?

Using "Go To Definition" results in "HashSet [from metadata]" and is C++ header file like in that it shows the classes interface but no implementation.

Continued here: stackoverflow.com/questions/10246572/c-sharp-hashset2-to-work-exactly-like-the-standard-c-sharp-hashset-not-compilin

役に立ちましたか?

解決

There both very basic data structures you can just make your own.

Here is a HashSet.

And Here is a Tuple just add more items as needed.

public class Tuple<T1, T2> 
{ 
   public T1 Item1 { get; set; } 
   public T2 Item2 { get; set; } 

   public Tuple(T1 item1, T2 item2) 
   { 
      Item1 = item1; 
      Item2 = item2; 
   } 
} 

他のヒント

No, you cannot get the PC binaries and use them on the Xbox. They are compiled for different hardware and an XNA X360 project will refuse to use PC dlls.

There are probably several implementations of those classes around. I'm pretty sure many physics and engine projects in CodePlex have them already, and picking them is perfectly legal (although showing recognition is always recommended).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top