public DropItemsList Add( DropItemsList nestedList, double weight = 1, double probability = 1, DropItemConditionDelegate condition = null) { if (nestedList == this) { throw new ArgumentException("Other droplist passed to this method is the same as this droplist", nameof(nestedList)); } if (this.ContainsDroplist(nestedList)) { throw new Exception("Already included dropitems list."); } if (nestedList.ContainsDroplist(this)) { throw new Exception("Recursive reference between droplists found!"); } this.entries.Add(new ValueWithWeight <Entry>( new Entry(nestedList, condition, probability), weight)); return(this); }
public Entry(DropItemsList entryNestedList, DropItemConditionDelegate condition, double probability) : this(condition, probability) { this.EntryNestedList = entryNestedList; }