public bool Contains(int index, ContextValueType type) { switch (type) { case ContextValueType.INT: return(IntVars.ContainsKey(index)); case ContextValueType.FLOAT: return(FloatVars.ContainsKey(index)); case ContextValueType.VECTOR: return(VectorVars.ContainsKey(index)); } return(false); }
/// <summary>AbilityRankType is only relevant for ContextValueType.Rank</summary> public static ContextDiceValue CreateContextDiceValue(DiceType Dx, ContextValueType diceType = ContextValueType.Simple, AbilityRankType diceRank = AbilityRankType.Default, int diceValue = 0, ContextValueType bonusType = ContextValueType.Simple, AbilityRankType bonusRank = AbilityRankType.Default, int bonusValue = 0) { var result = new ContextDiceValue(); result.DiceType = Dx; result.DiceCountValue = new ContextValue(); result.DiceCountValue.ValueType = diceType; result.DiceCountValue.ValueRank = diceRank; result.DiceCountValue.Value = diceValue; result.BonusValue = new ContextValue(); result.BonusValue.ValueType = bonusType; result.BonusValue.ValueRank = bonusRank; result.BonusValue.Value = bonusValue; return(result); }