OK, so I have a hard time coming up with a 'good' way to do the following:
< P> group 4 objects so that I can object e without object objecting through Object A; C to know that the object is related to D object A along with any other combination of reference.I am currently using the sorted list to link between A and B to C and C two. The sloppy job of the cross refers to them. It works, but its actually, really ugly. I do not like the ugly code unless there is no other way to do it.
I am thinking of using a class to store objects. But what would be the best way to give them references?
More information in advance
More information:
Objects are control over a form. 4 different controls are all related to each other, in which they correspond to the same settings, which they are used to configure, there are several settings that are modified on the form, each using 4 controls Are there.
Set me up to 4 controllable bills. Check or setting 022ControlD.text needs to be easily referenced without calling, thus the linked list. I am using generic events for some controls to reuse code, they all do the same thing Except that they refer to different objects.
The ugly part first, setting the link, and secondly, referencing A to A or C to C. I wanted to be able to do something like this:
GetSettingControls (Referencing Control). Checked
The sender, control is a control in the reference control event that is related to the refensing control.
First of all, if you have a relationship like A-> B-> C-> D, it The only way to see that A is to be related to D, to go from A to D in every way. You can also apply some of the energy.
It will keep track of every indirect context present in the program itself, that is, you will be in charge of connecting the A-D reference in two dimensions, which Can be useful with, for example "le" objects in a game
Yo Yo needs to use a dictionary of theweek context, so that you can not keep things alive through the object ...
public class MyObject {Public listing & lt; WeakReference & gt; Context = new list & lt; WeakReference & gt; (); // my class properties and methods} MyObject obj = new MyObject (); Obj.refence.Add (new WeakReference (gun));
This way, if the gun is cleaned with object pools (for example, the user object collection from your level, collection of objects) will be vulnerable.
You can do the Obj.references
Check the object by refusing the foreach if ref.IsAlive object tool = ref.Target;
This is just an example, you know, apply good receiver, assets, etc. ...
Comments
Post a Comment