class constructor/order/initialization confusion

sorry if this sounds noobish (i’m not a professional programmer), but i have the following problem:
I’m about to implement a recipe system. I have two classes:

Item {
int id,
string name
and so on


recipe {
int id,
item ingredients

then i have a static array:
item itemPresets = {
new item(X, xx,…),
new item(Y, yy,…)

now i need something like these itempresets for the recipes too. But the constructor for the recipe class is:
Recipe(int _id, int item1, int item2){
id = _id;
ingredients[0] = itemPresets.GetItemByID(item1);
and so on…

i need these as ints because i have to be able to send them via RPC too. But:
how can i be sure, that “itemPresets” is initialized first so “GetItemByID” returns the right item?
Or am i doing something really wrong here? Are there some “best practices” for this?

Thank you for your time. (and sorry, if i misspelled something, english is not my native tongue)

You can be sure that statics arrays are initialized before the constructor code.

Blockquote Static field initialization The static field variable initializers of a class correspond to a sequence of assignments that are executed in the textual order in which they appear in the class declaration.

Hope this helps