Reputation: 51
I have PHP array code like this:
$waypoint = [
10 => [
[80, 432],
[320, 432],
[1160, 432],
],
20 => [
[80, 432],
[320, 432],
[1160, 432],
],
];
How can I do in C#?
Upvotes: 1
Views: 50
Reputation: 38094
Maybe you want a Dicitionary<TKey, TValue>
:
var keyValues = new Dictionary<int, int[,]>
{
{ 10, new int[,]{ { 80, 432 }, { 320, 432 }, { 1160, 432 } } },
{ 20, new int[,]{ { 80, 432 }, { 320, 432 }, { 1160, 432 } } },
{ 30, new int[,]{ { 80, 432 }, { 320, 432 }, { 1160, 432 } } }
};
Read more about Dictionary<TKey, TValue>
Upvotes: 2