fCraft.IRC.AssignBotForInputParsing C# (CSharp) Method

AssignBotForInputParsing() private static method

private static AssignBotForInputParsing ( ) : void
return void
        private static void AssignBotForInputParsing() {
            bool needReassignment = false;
            for ( int i = 0; i < threads.Length; i++ ) {
                if ( threads[i].ResponsibleForInputParsing && !threads[i].IsReady ) {
                    threads[i].ResponsibleForInputParsing = false;
                    needReassignment = true;
                }
            }
            if ( needReassignment ) {
                for ( int i = 0; i < threads.Length; i++ ) {
                    if ( threads[i].IsReady ) {
                        threads[i].ResponsibleForInputParsing = true;
                        Logger.Log( LogType.IRC,
                                    "Bot \"{0}\" is now responsible for parsing input.",
                                    threads[i].ActualBotNick );
                        return;
                    }
                }
                Logger.Log( LogType.IRC, "All IRC bots have disconnected." );
            }
        }