public void AddPawIdx(int idx) { Assert.IsFalse(paws.Contains(idx), $"paw idx {idx} already added"); paws.Add(idx); Display(Type.Paw, paws.Count); if (GetThreshold(Type.Paw) > 0 && IsSatisfied(Type.Paw)) { OnPawFilled?.Invoke(false); } }
public void LimitPaw(int threshold) { bool prevSatisfied = IsSatisfied(Type.Paw); Constrain(Type.Paw, threshold); bool nowSatisfied = IsSatisfied(Type.Paw); if (!prevSatisfied && nowSatisfied) { OnPawFilled?.Invoke(false); } else if (prevSatisfied && !nowSatisfied) { OnPawFilled?.Invoke(true); } }
public void RemoveIdx(int idx) { if (leaves.Contains(idx)) { leaves.Remove(idx); if (GetThreshold(Type.Leaf) > 0 && IsSatisfied(Type.Leaf)) { OnLeafFilled?.Invoke(true); } Display(Type.Leaf, leaves.Count); } else { paws.Remove(idx); if (GetThreshold(Type.Paw) > 0 && IsSatisfied(Type.Paw)) { OnPawFilled?.Invoke(true); } Display(Type.Paw, paws.Count); } }