void Awake()
 {
     if (Instance == null)
     {
         DontDestroyOnLoad(gameObject);
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
Example #2
0
        internal KeepNode(KeepType keepType, DiceAST amount)
        {
            KeepType   = keepType;
            Expression = null;
            _values    = new List <DieResult>();

            if (keepType == KeepType.Advantage || keepType == KeepType.Disadvantage)
            {
                if (amount != null)
                {
                    throw new ArgumentException("amount must be null if keep type is advantage or disadvantage");
                }

                Amount = null;
            }
            else
            {
                Amount = amount ?? throw new ArgumentNullException(nameof(amount));
            }
        }
Example #3
0
 protected override void Initialize(XElement extensionElement, GamePack package)
 {
     Keep = (KeepType)package.GetBuildingType(KeepType.TypeID).Plugin;
 }
Example #4
0
 protected PlayerWithKeep(ILevelManager level, IPlayer player, KeepType keepType)
     : base(level, player)
 {
     this.keepType = keepType;
 }