예제 #1
0
        public static void RequireFor(this PlayerInvokeOrigin origin, IInvokeSource source,
                                      string errorMessage = "Command is not available here.")
        {
            var playerSource = source as PlayerInvokeSource;

            if (playerSource != null)
            {
                if (playerSource.Origin != origin)
                {
                    throw new InvalidInvokeOriginCommandException(errorMessage);
                }
            }
        }
예제 #2
0
 public PlayerInvokeSource(Player player, PlayerInvokeOrigin origin, ReplyCallback onReply)
     : base(player.ChatName, onReply)
 {
     this.Player = player;
     this.Origin = origin;
 }
예제 #3
0
 public PlayerInvokeSource(Player player, PlayerInvokeOrigin origin, ReplyCallback onReply)
     : base(player.ChatName, onReply)
 {
     this.Player = player;
     this.Origin = origin;
 }