Exemple #1
0
            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;
            }
Exemple #2
0
        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();
        }
Exemple #3
0
 public WrappedObjectState(ItemState value)
 {
     Value = value;
 }