fCraft.PlayerOpException.ThrowPermissionLimit C# (CSharp) Method

ThrowPermissionLimit() static private method

static private ThrowPermissionLimit ( [ player, [ targetInfo, [ action, Permission permission ) : void
player [
targetInfo [
action [
permission Permission
return void
        internal static void ThrowPermissionLimit( [NotNull] Player player, [NotNull] PlayerInfo targetInfo, [NotNull] string action, Permission permission )
        {
            if ( player == null )
                throw new ArgumentNullException( "player" );
            if ( targetInfo == null )
                throw new ArgumentNullException( "targetInfo" );
            if ( action == null )
                throw new ArgumentNullException( "action" );
            string msg = String.Format( "Cannot {0} {1} (ranked {2}): you may only {0} players ranked {3} and below.",
                                        action, targetInfo.Name, targetInfo.Rank.Name,
                                        player.Info.Rank.GetLimit( permission ).Name );
            string colorMsg = String.Format( "&SCannot {0} {1}&S (ranked {2}&S): you may only {0} players ranked {3}&S and below.",
                                             action, targetInfo.ClassyName, targetInfo.Rank.ClassyName,
                                             player.Info.Rank.GetLimit( permission ).ClassyName );
            throw new PlayerOpException( player, targetInfo, PlayerOpExceptionCode.PermissionLimitTooLow,
                                         msg, colorMsg );
        }