Posts

Showing posts from January, 2015

Dictionary vs KeyValuePair vs Struct - C#

Dictionary :  //   Declare   Dictionary and assign value Dictionary < string ,  object >  parameter  =  new   Dictionary < string ,  object >(); parameter [ " View " ] =  viewComp ; parameter [ " Play " ] =  true ; FunctionName( parameter ); //   Use   Dictionary private   void   FunctionName ( object   parameter ) {      Dictionary < string ,  object >  dict  = ( Dictionary < string ,  object >) parameter ;      GameObject   viewComp  = ( GameObject ) dict  [ " View " ];      bool   play  = ( bool ) dict [ " Play " ];      UseValuesInFunction ( viewComp ,  play ); } KeyValuePair : KeyValuePair < GameObject ,  bool >  parameter  =  new   KeyValuePair < GameObject ,  bool >( viewComp ,  true ); FunctionName( parameter ); //   Use   KeyValuePair                    private   void   FunctionName ( object   parameter ) {      KeyValuePair < GameObject ,  bool >  param  = ( KeyValuePair < Gam