예제 #1
0
 public FlagEffect(TFlagEffectsEnum flag, byte level, string description)
 {
     this.Flag        = flag;
     this.Level       = level;
     this.Description = description
                        ?? (flag as Enum).GetAttribute <DescriptionAttribute>()?.Description
                        ?? throw new Exception("There is no [Description] attribute for " + flag);
 }
예제 #2
0
            public void AddFlagEffect(TFlagEffectsEnum flag, /*string description, */ byte level)
            {
                foreach (var flagEffect in this.flagEffects)
                {
                    if (flag.Equals(flagEffect.Flag))
                    {
                        throw new Exception("Flag " + flag + "is already registered");
                    }
                }

                this.flagEffects.Add(new FlagEffect(flag, level, description: null));
            }