x


typedefing in unity

I want to typedef a 2-dimensional Dictionary to a more readable type. Normally you would use

using MySQLDataTable= Dictionary<string, Dictionary<string, string>>;

but it seems that Unity doesn't support namespaces, causing the compile to fail with the following errors:

Assets/System/MySQL.cs(79,23): error CS0246: The type or namespace name `MySQLDataTable' could not be found. Are you missing a using directive or an assembly reference?

Assets/System/MySQL.cs(8,19): error CS0246: The type or namespace name Dictionary2' could not be found. Are you missing a using directive or an assembly reference?

Is there any work around so I don't have to use variables types like

SortedDictionary<int, SortedDictionary<string, object>>

?

more ▼

asked Mar 17 '11 at 08:28 AM

Sharsnik gravatar image

Sharsnik
12 3 3 5

yes unity do not support namespaces. everything is defined in global namespace

Mar 17 '11 at 08:40 AM Ashkan_gc

Not even remotely true

Mar 17 '11 at 10:30 AM Mike 3
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You're missing the namespace for Dictionary (it won't parse it from another using statement, you have to add it manually when you're doing it the way you're trying)

This compiles fine for me:

using MySQLDataTable= System.Collections.Generic.Dictionary<string, System.Collections.Generic.Dictionary<string, string>>;
more ▼

answered Mar 17 '11 at 10:32 AM

Mike 3 gravatar image

Mike 3
30.5k 10 65 252

Ah, so it does.

Mar 25 '11 at 07:32 AM Sharsnik
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1944
x132
x53
x41

asked: Mar 17 '11 at 08:28 AM

Seen: 2127 times

Last Updated: Mar 17 '11 at 08:57 AM