public ItemCountsAggregate(ItemCountAggregateDefinition definition) { foreach (var countDef in definition.Counts) { var a = new PhysicalItemType(countDef.TypeName, countDef.SubtypeName); this.Set(a.DefinitionId, (MyFixedPoint)countDef.Count); } }
public ItemCountAggregateDefinition GetDefinition() { var result = new ItemCountAggregateDefinition(); foreach (var kvp in Counts) { if (kvp.Value <= 0) { continue; } var item = new PhysicalItemType(kvp.Key); var countDef = new ItemCountDefinition() { TypeName = item.TypeName, SubtypeName = item.SubtypeName, Count = (double)kvp.Value, }; result.Counts.Add(countDef); } return(result); }
public ItemCount(ItemCountDefinition definition) { Amount = (MyFixedPoint)definition.Count; Item = new PhysicalItemType(definition.TypeName, definition.SubtypeName); }
public ItemCount(MyFixedPoint amount, PhysicalItemType item) { Amount = amount; Item = item; }
public ItemCountAggregateDefinition GetDefinition() { var result = new ItemCountAggregateDefinition(); foreach (var kvp in Counts) { if (kvp.Value <= 0) continue; var item = new PhysicalItemType(kvp.Key); var countDef = new ItemCountDefinition() { TypeName = item.TypeName, SubtypeName = item.SubtypeName, Count = (double)kvp.Value, }; result.Counts.Add(countDef); } return result; }