D
Daniel
My previous thread got very large so here is my point again, but a better
example of my problem:
SceneChair chair = (SceneChair)_objMan.GetObject((int)ObjectID.Seats);
chair.Position = GetSeatPosition(1);
chair.FrameNum = 1;
_objMan.AddToRenderStack(chair);
SceneChair chair2 = new SceneChair();
chair2 = chair;
chair2.Position = GetSeatPosition(3);
chair2.FrameNum = 2;
_objMan.AddToRenderStack(chair2);
Ok in the above code when i debug, at the line chair2.Position both
instances are equal in data as you would expect.
Now when i go to the final _objMan.AddToRenderStack line both the chair
instance and the chair2 instance framenumbers become 2. But i only changed
chair2's one so chair being a differenct instance shouldnt be effected
right?
The SceneChair chair2 = new SceneChair(); should have created a new memory
space and then when i changed chair2's framenum the memory allocated for
chair2 shoudl change while chair's remains the same. Am i right? So why do
they both change later on??? This is why when i add it to my stack they are
equal, as it is changing them as i said before while on the stack as if it
were the same instance.
example of my problem:
SceneChair chair = (SceneChair)_objMan.GetObject((int)ObjectID.Seats);
chair.Position = GetSeatPosition(1);
chair.FrameNum = 1;
_objMan.AddToRenderStack(chair);
SceneChair chair2 = new SceneChair();
chair2 = chair;
chair2.Position = GetSeatPosition(3);
chair2.FrameNum = 2;
_objMan.AddToRenderStack(chair2);
Ok in the above code when i debug, at the line chair2.Position both
instances are equal in data as you would expect.
Now when i go to the final _objMan.AddToRenderStack line both the chair
instance and the chair2 instance framenumbers become 2. But i only changed
chair2's one so chair being a differenct instance shouldnt be effected
right?
The SceneChair chair2 = new SceneChair(); should have created a new memory
space and then when i changed chair2's framenum the memory allocated for
chair2 shoudl change while chair's remains the same. Am i right? So why do
they both change later on??? This is why when i add it to my stack they are
equal, as it is changing them as i said before while on the stack as if it
were the same instance.