Changes

Jump to navigation Jump to search
m
Replace deprecated <source> tags with <syntaxhighlight> tags
Line 69: Line 69:  
<ul>
 
<ul>
 
<li>For a reference type (i.e. one that can contain <tt>null</tt>), you can use the <tt>.Value</tt> property (or <tt>.FieldDict</tt> for a <tt>NetDictionary</tt>):
 
<li>For a reference type (i.e. one that can contain <tt>null</tt>), you can use the <tt>.Value</tt> property (or <tt>.FieldDict</tt> for a <tt>NetDictionary</tt>):
<source lang="c#">
+
<syntaxhighlight lang="c#">
 
if (building.indoors.Value == null)
 
if (building.indoors.Value == null)
</source>
+
</syntaxhighlight>
    
Or convert the value before comparison:
 
Or convert the value before comparison:
<source lang="c#">
+
<syntaxhighlight lang="c#">
 
GameLocation indoors = building.indoors.Value;
 
GameLocation indoors = building.indoors.Value;
 
if(indoors == null)
 
if(indoors == null)
 
   // ...
 
   // ...
</source></li>
+
</syntaxhighlight></li>
 
<li>For a value type (i.e. one that can't contain <tt>null</tt>), check if the parent is null (if needed) and compare with <tt>.Value</tt>:
 
<li>For a value type (i.e. one that can't contain <tt>null</tt>), check if the parent is null (if needed) and compare with <tt>.Value</tt>:
<source lang="c#">
+
<syntaxhighlight lang="c#">
 
if (item != null && item.category.Value == 0)
 
if (item != null && item.category.Value == 0)
</source></li>
+
</syntaxhighlight></li>
 
</ul>
 
</ul>
  
114

edits

Navigation menu