Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ResolveObjectReference()

bool System.Runtime.Serialization.ObjectManager.ResolveObjectReference ( ObjectHolder holder)
inlineprivate

Definition at line 168 of file ObjectManager.cs.

169 {
170 int num = 0;
171 try
172 {
173 object objectValue;
174 do
175 {
176 objectValue = holder.ObjectValue;
177 holder.SetObjectValue(((IObjectReference)holder.ObjectValue).GetRealObject(_context), this);
178 if (holder.ObjectValue == null)
179 {
180 holder.SetObjectValue(objectValue, this);
181 return false;
182 }
183 if (num++ == 100)
184 {
185 throw new SerializationException(System.SR.Serialization_TooManyReferences);
186 }
187 }
188 while (holder.ObjectValue is IObjectReference && objectValue != holder.ObjectValue);
189 }
190 catch (NullReferenceException)
191 {
192 return false;
193 }
196 return true;
197 }
void DoNewlyRegisteredObjectFixups(ObjectHolder holder)
static string Serialization_TooManyReferences
Definition SR.cs:38
Definition SR.cs:7

References System.Runtime.Serialization.ObjectManager._context, System.Runtime.Serialization.Dictionary, System.Runtime.Serialization.ObjectManager.DoNewlyRegisteredObjectFixups(), and System.SR.Serialization_TooManyReferences.

Referenced by System.Runtime.Serialization.ObjectManager.DoFixups().