How can I create a list or array where each element uses the ref keyword, so that if the value changes the list will still point to the new location in memory pointed to by the original reference?
Edit: I'm trying to create many objects whose only purpose is to hold references to other objects of different categories. look at this code from my static constructor:
normal = new Type("Normal", new Type[]{ghost}, new Type[]{rock, steel}, new Type[]{});
fighting = new Type ("Fighting", new Type[]{ghost}, new Type[]{flying, poison, bug, psychic, fairy}, new Type[]{normal, rock, steel, ice, dark});
flying = new Type ("Flying", new Type[]{}, new Type[]{rock, steel, electric}, new Type[]{bug, grass, fairy});
ground = new Type ("Ground", new Type[]{flying}, new Type[]{bug, grass}, new Type[]{poison, rock, steel, fire, electric});
rock = new Type ("Rock", new Type[]{}, new Type[]{fighting, ground, steel}, new Type[]{flying, bug, fire, ice});
bug = new Type ("Bug", new Type[]{}, new Type[]{fighting, flying, poison, ghost, steel, fire, fairy}, new Type[]{grass, psychic, dark});
ghost = new Type ("Ghost", new Type[]{normal}, new Type[]{dark}, new Type[]{ghost, psychic});
steel = new Type ("Steel", new Type[]{}, new Type[]{steel, fire, water, electric}, new Type[]{rock, ice, fairy});
fire = new Type ("Fire", new Type[]{}, new Type[]{ref Rock, ref Fire, ref Water, ref Dragon}, new Type[]{Bug, Ice, Steel, Grass});//TODO: move Ice back to the end
water = new Type ("Water", new Type[]{}, new Type[]{water, grass, dragon}, new Type[]{ground, rock, fire});
grass = new Type ("Grass", new Type[]{}, new Type[]{flying, poison, bug, steel, fire, grass, dragon}, new Type[]{ground, rock, water});
electric = new Type ("Electric", new Type[]{ground}, new Type[]{grass, electric, dragon}, new Type[]{flying, water});
psychic = new Type ("Psychic", new Type[]{dark}, new Type[]{steel, psychic}, new Type[]{fighting, poison});
ice = new Type ("Ice", new Type[]{}, new Type[]{steel, fire, water, ice}, new Type[]{flying, ground, grass, dragon});
dragon = new Type ("Dragon", new Type[]{fairy}, new Type[]{steel}, new Type[]{dragon});
dark = new Type ("Dark", new Type[]{}, new Type[]{fighting, dark, fairy}, new Type[]{ghost, psychic});
fairy = new Type ("Fairy", new Type[]{}, new Type[]{poison, steel, fire}, new Type[]{fighting, ice, dragon});
The problem is that the values in the arrays only work for objects that were created before the object currently being created. So, I'd like to pass the members of each array by ref so that they will point to the correct location in memory after being assigned.