Advertisement
Guest User

Untitled

a guest
Jan 19th, 2014
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1.  
  2. private Dictionary<int, Definition> m_typeDefinitions = new Dictionary<int, Definition>()
  3.  
  4. public Definition GetDefinition( EntityType type )
  5. {
  6.     Definition def = null;
  7.     int typeIndex = (int) type;
  8.    
  9.     m_typeDefinitions.TryGetValue( typeIndex, out def );
  10.    
  11.     // return "null" can be considered as a valid value,
  12.     // and you handle the lack of stuff found in later code
  13.     return def;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement