public CombatantWrapper(Combatant combatant)
 {
     this.Combatant = combatant;
     this.Count = 1;
 }
Exemplo n.º 2
0
        public void RemoveCombatant(Combatant combatant)
        {
            if (combatant == null) {
                throw new ArgumentNullException("combatant");
            }

            CombatantWrapper wrapper;
            if (this.Combatants.TryGetValue(combatant.Handle, out wrapper) && (wrapper.RenderType != RenderType.Character)) {
                if (wrapper.Count <= 1) {
                    this.Combatants.Remove(combatant.Handle);
                }
                else {
                    wrapper.Count--;
                }
            }
            else if (wrapper.RenderType == RenderType.Character) {
                this.Combatants.Remove(combatant.Handle);
            }
        }
 public CombatParticipant(Combatant combatant)
 {
     this.Combatant = combatant;
     this.Effects = new ObservableKeyedCollection<int, Effect>(e => e.Key);
 }
Exemplo n.º 4
0
        public void AddCombatant(Combatant combatant)
        {
            if (combatant == null) {
                throw new ArgumentNullException("combatant");
            }

            CombatantWrapper wrapper;
            if (this.Combatants.TryGetValue(combatant.Handle, out wrapper)) {
                if (wrapper.RenderType != RenderType.Character) {
                    wrapper.Count++;
                }
            }
            else {
                this.Combatants.Add(new CombatantWrapper(combatant));
            }
        }