コード例 #1
0
        /// <summary>
        /// Handle message informations contained in a decompilation session.
        /// </summary>
        /// <param name="Session">The decompilation session containing the informations.</param>
        /// <returns>Returns a Game.Build</returns>
        private static Build Handle(Decompilation.Session Session)
        {
            Game.Commands.Manager Commands = null;
            Game.Handlers.Manager Handlers = null;

            List <Game.Command> Events = new List <Command>();

            Console.WriteLine("Parsing commands...");

            foreach (var Command in Session.Classes.Where(x => x.Directory.Name == "netbigpointdarkorbitnetnettycommands"))
            {
                var Interface = Session.ParseCommand(Command);

                if (Interface is Game.Commands.Manager)
                {
                    Commands = Interface as Game.Commands.Manager;
                }
                else
                {
                    Events.Add(Interface as Game.Command);
                }
            }

            Commands.SetCommands(Events);

            Console.WriteLine("Parsing handlers...");

            foreach (var Handler in Session.Classes.Where(x => x.Directory.Name == "netbigpointdarkorbitnetnetty"))
            {
                var Interface = Session.ParseHandler(Handler);

                if (Interface is Game.Handlers.Manager)
                {
                    Handlers = Interface as Game.Handlers.Manager;

                    break;
                }
            }

            Console.WriteLine(string.Format("Successfully loaded: {0} commands and {1} handlers!", Commands.Commands.Count, Handlers.Handlers.Count));
            Console.WriteLine();

            return(new Build(Commands, Handlers));
        }
コード例 #2
0
ファイル: Build.cs プロジェクト: rajeshwarn/Hadar
 internal Build(Commands.Manager Commands, Handlers.Manager Handlers)
 {
     this.Commands = Commands;
     this.Handlers = Handlers;
 }