forked from notnoahj/Votifier
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCommandReward.cs
39 lines (35 loc) · 1.04 KB
/
CommandReward.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using Rocket.API;
using Rocket.Unturned.Commands;
using Rocket.Unturned.Player;
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Linq;
using Rocket.API.Commands;
using Rocket.API.Plugins;
namespace fr34kyn01535.Votifier
{
public class CommandReward : ICommand
{
public string Name => "reward";
public string Summary => "Gets the rewards for voting";
public string Description => null;
public string Permission => null;
public string Syntax => "";
public IChildCommand[] ChildCommands => null;
public string[] Aliases => new[] { "vote" };
private readonly Votifier _votifier;
public CommandReward(IPlugin plugin)
{
_votifier = (Votifier) plugin;
}
public bool SupportsUser(Type user)
{
return typeof(UnturnedUser).IsAssignableFrom(user);
}
public void Execute(ICommandContext context)
{
_votifier.Vote(((UnturnedUser)context.User).Player);
}
}
}