public static ObjectBuilder<Item> Build(ItemState state, ILocation location = null, Corporation owner = null) { var objRef = state.Type.ToObjectReference(state.Code); var item = new Item { Id = state.ObjectId, Quantity = state.Quantity, Location = location, Owner = owner, }; var builder = new ObjectBuilder<Item>(item); builder .Resolve((resolver, target) => item.ItemInfo = resolver.Get<ItemInfo>(objRef)); return builder; }
private void BuildQuanta(BluePrintInfo bluePrint) { var firstLoad = new List<ItemState>(); var subsequentLoads = new List<ItemState>(); var quantaFactor = (double)TimeRemaining; foreach (var item in bluePrint.Materials) { var quanta = new ItemState() {Code = item.Code, Quantity = (uint) System.Math.Floor(item.Quantity/quantaFactor)}; subsequentLoads.Add(quanta); firstLoad.Add(new ItemState { Code = item.Code, Quantity = item.Quantity - (uint )System.Math.Floor(quanta.Quantity * (quantaFactor - 1)) } ); } _firstLoad = firstLoad.ToArray(); _subsequentLoad = subsequentLoads.ToArray(); }
public WrappedObjectState(ItemState value) { Value = value; }