1

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#?

1 Answer 1

2

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>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.