void Awake() { if (Instance == null) { DontDestroyOnLoad(gameObject); Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
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)); } }
protected override void Initialize(XElement extensionElement, GamePack package) { Keep = (KeepType)package.GetBuildingType(KeepType.TypeID).Plugin; }
protected PlayerWithKeep(ILevelManager level, IPlayer player, KeepType keepType) : base(level, player) { this.keepType = keepType; }