A game framework written with osu! in mind.
at master 30 lines 1.1 kB view raw
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. 2// See the LICENCE file in the repository root for full licence text. 3 4using System; 5using osu.Framework.Extensions.EnumExtensions; 6 7namespace osu.Framework.Utils 8{ 9 /// <summary> 10 /// Allows specifying ordering of <see cref="Enum"/> members, separate from the actual enum values. 11 /// Only has an effect on members of <see cref="Enum"/> classes annotated with <see cref="HasOrderedElementsAttribute"/>. 12 /// </summary> 13 /// <remarks> 14 /// Usually used for pretty-printing purposes. 15 /// Methods from the <see cref="EnumExtensions"/> static class can be used to leverage the order defined with these attributes. 16 /// </remarks> 17 [AttributeUsage(AttributeTargets.Field)] 18 public class OrderAttribute : Attribute 19 { 20 /// <summary> 21 /// The sorting order of the annotated enum member. 22 /// </summary> 23 public readonly int Order; 24 25 public OrderAttribute(int order) 26 { 27 Order = order; 28 } 29 } 30}