Jump to: navigation, search

Changes


Internal:Coding Practices

194 bytes added, 11:30, 16 October 2015
/* Distinguish objects based on their MetaClass type? */
</syntaxhighlight>
=== Distinguish Actions should be executed for objects based on their of a certain MetaClass type? ===If certain actions should only be executed for objects having a specific type, use the <code>is</code> keyword. This check also considers the inheritance.
<syntaxhighlight lang="csharp">
if (obj is UBIK.Runtime.AC_DOUBLE)
{
//do something
}
</syntaxhighlight>
 
Also inheritance (C# classes) is considered, for example lets AC_DOUBLE be a child MetaClass from AC_BASE.
<syntaxhighlight lang="csharp">
if (obj is UBIK.Runtime.AC_BASE)
{
//do something
10,686
edits