Hi there.. I'm new to coding and was under the impression that this is a good place to ask noob c# questions, as working form a book can leave some questions unanswered!
is there a short and way in C# to write a array?
For example... say I have a class that takes a btye[3] arrry to store Red, Green, Blue (lets forget about alpha for ease sake). So you would have a constructor that takes a array as its variable.
In LUA I could do this very easily with something like Ball({1,2,3}) this Ball constructor would read {1,2,3} as array[1] = 1. array[2]=2 and array[3]=3. Which would then use those values to set r=1, g=2, b=3. I know in C# how I could make the constructor look like this... Ball ball = new Ball(1,2,3); to get the same thing.. but what I liked about LUA is that using arrays directly in the constructor meant I could keep everything grouped. so Ball.GetColour() returns array[3] for example.. I I could do things like.. ball2.colour = ball.getColour(); or w/e.
Am I making sense? lol.
So for my real world exercise example I would like to have a constructor that I init kinda like this.. Ball ball = new Ball({1,2,3},255) so there is a 3 values I can easily read as the RGB and 1 as the ALPHA. The class would need an array[3] for the {1,2,3} to fill.. but I do now know how to write an array in C# with out doing byte[] array = new byte[3] or w/e...
Thoughts?