Fusion.Core.Shell.Invoker.Initialize C# (CSharp) Method

Initialize() public method

public Initialize ( Game game, Type types ) : void
game Game
types System.Type
return void
		void Initialize ( Game game, Type[] types )
		{
			Context		=	null;
			Game		=	game;
			commands	=	types
						.Where( t1 => t1.IsSubclassOf(typeof(Command)) )
						.Where( t2 => t2.HasAttribute<CommandAttribute>() )
						.ToDictionary( t3 => t3.GetCustomAttribute<CommandAttribute>().Name );

			CommandList	=	commands.Select( cmd => cmd.Key ).OrderBy( name => name ).ToArray();
						
			Log.Message("Invoker: {0} commands found", commands.Count);
		}