Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using VoidwalkerEngine.Framework.Logic;
- using VoidwalkerEngine.Framework.Maths;
- using VoidwalkerEngine.Framework.Systems.GameProperties;
- namespace VoidwalkerEngine.Framework.Systems.Enchanting
- {
- public class Enchantment
- {
- public string Identifier { get; set; }
- public string Name { get; set; }
- public string Description { get; set; }
- public string Family { get; set; }
- public Range LevelBracket { get; set; }
- public int Frequency { get; set; }
- public bool IsLearnable { get; set; }
- public bool IsRemovable { get; set; }
- public bool IsSpawnable { get; set; }
- /// <summary>
- /// The Sorting Priority of this enchantment.
- /// </summary>
- public EnchantmentPriority Priority { get; set; }
- public List<ItemType> Constraints { get; set; }
- public List<GameProperty> Properties { get; set; }
- public Enchantment()
- {
- this.Constraints = new List<ItemType>();
- this.Properties = new List<GameProperty>();
- }
- public Enchantment MakeCopy()
- {
- Enchantment copy = new Enchantment();
- copy.Copy(this);
- return copy;
- }
- public void Copy(Enchantment other)
- {
- this.Identifier = other.Identifier;
- this.Name = other.Name;
- this.Description = other.Description;
- this.LevelBracket = other.LevelBracket;
- this.Frequency = other.Frequency;
- this.IsLearnable = other.IsLearnable;
- this.IsSpawnable = other.IsSpawnable;
- this.Priority = other.Priority;
- this.IsRemovable = other.IsRemovable;
- this.Constraints = other.Constraints.ToList();
- this.Properties ??= new List<GameProperty>();
- this.Properties.Clear();
- foreach (GameProperty effect in other.Properties)
- {
- this.Properties.Add(effect.MakeCopy());
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement