-
Notifications
You must be signed in to change notification settings - Fork 0
/
OpcodeAttribute.cs
72 lines (57 loc) · 1.33 KB
/
OpcodeAttribute.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* Copyright © Kahath 2015
* Licensed under MIT license.
*/
using KNetFramework.Attributes.Base;
using KNetFramework.Enums;
using System;
namespace KNetFramework.Attributes.Core
{
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Assembly, AllowMultiple = true)]
public sealed class OpcodeAttribute : Attribute, ICustomAttribute
{
#region Fields
private ushort _opcode;
private string _author;
private int _version;
private OpcodeTypes _type;
#endregion
#region Properties
public ushort Opcode
{
get { return _opcode; }
}
public string Author
{
get { return _author; }
}
public int Version
{
get { return _version; }
}
public OpcodeTypes Type
{
get { return _type; }
}
#endregion
#region Constructors
/// <summary>
/// Creates new instance of <see cref="KNetFramework.Constants.Attributes.OpcodeAttribute"/> type.
/// </summary>
/// <param name="opcode">Client packet opcode</param>
/// <param name="author">Author of method</param>
/// <param name="version">Version of method</param>
/// <param name="type">Opcode type</param>
public OpcodeAttribute(ushort opcode, string author, int version, OpcodeTypes type)
{
_opcode = opcode;
_author = author;
_version = version;
_type = type;
}
public OpcodeAttribute()
{
}
#endregion
}
}