private DeltaMode Mode; // WHETHER TO ADD OR REMOVE THE CARD IN QUESITON public CardListDelta(T list, Card c, int i, DeltaMode m) : base(list) { SendableCard = new SendableTarget <Card>("card", c); // TODO: shouldn't have to know what to name this... Index = i; Mode = m; }
public UnitAbilityDelta(Unit target, Unit source, Ability a, DeltaMode m, GameManager gm) : base(target, source) { //Console.WriteLine($"UnitAbilityDelta Constructor Target Null: {Target == null}"); //Console.WriteLine($"UnitAbilityDelta Constructor Source Null: {Source == null}"); Ability = a; Mode = m; GameManager = gm; }
public DeltaCommand(CacheItem item, DeltaMode mode, ulong delta) { Condition.Requires(item).IsNotNull( "When executing increment/decrement command, cache item should be specified."); Condition.Requires(mode).IsNotEqualTo(DeltaMode.None, "When executing increment/decrement command against item '{0}', delta mode should be specified." .FormatString(item)); _item = item; _deltaMode = mode; _delta = delta; }
public void SetDelta(float valArg, DeltaMode mode = DeltaMode.Const) { float fin = value; switch (mode) { case DeltaMode.Const: fin += valArg; break; case DeltaMode.Percentage: fin *= (1 + valArg); break; } value = MathFunc.Clamp(fin, min, max); }
/// <summary> /// Add one trace /// </summary> /// <param name="name">Name.</param> /// <param name="val">Value.</param> /// <param name="mode">Mode.</param> public void AddTrace(string name, float valArg, DeltaMode mode = DeltaMode.Const) { switch (mode) { case DeltaMode.Const: if (!constTraces.ContainsKey(name)) { constTraces.Add(name, valArg); } break; case DeltaMode.Percentage: if (!percTraces.ContainsKey(name)) { percTraces.Add(name, valArg); } break; } }
public CardListDelta(XmlElement from, IdIssuer <T> issuer, CardLoader cl) : base(from, issuer, cl) { this.Index = Int32.Parse(from.Attributes["index"].Value); this.Mode = from.Attributes["mode"].Value == "add" ? DeltaMode.ADD : DeltaMode.REMOVE; // use remove as default b/c more likely to error if chosen eroniously }