fCraft.SecurityController.GetDescription C# (CSharp) Method

GetDescription() public method

Creates a description string of the controller.
public GetDescription ( [ target, [ noun, [ verb ) : string
target [ Name of the object that owns this controller.
noun [ The type of target (e.g. "world" or "zone").
verb [ The action, in past tense, that this /// controller manages (e.g. "accessed" or "modified").
return string
        public string GetDescription( [NotNull] IClassy target, [NotNull] string noun, [NotNull] string verb )
        {
            if ( target == null )
                throw new ArgumentNullException( "target" );
            if ( noun == null )
                throw new ArgumentNullException( "noun" );
            if ( verb == null )
                throw new ArgumentNullException( "verb" );
            PlayerExceptions list = ExceptionList;

            StringBuilder message = new StringBuilder( noun );
            message[0] = Char.ToUpper( message[0] ); // capitalize first letter.

            if ( HasRankRestriction ) {
                message.AppendFormat( " {0}&S can only be {1} by {2}+&S",
                                      target.ClassyName,
                                      verb,
                                      MinRank.ClassyName );
            } else {
                message.AppendFormat( " {0}&S can be {1} by anyone",
                                      target.ClassyName,
                                      verb );
            }

            if ( list.Included.Length > 0 ) {
                message.AppendFormat( " and {0}&S", list.Included.JoinToClassyString() );
            }

            if ( list.Excluded.Length > 0 ) {
                message.AppendFormat( ", except {0}&S", list.Excluded.JoinToClassyString() );
            }

            message.Append( '.' );
            return message.ToString();
        }