Beispiel #1
0
 public Item(Item item, uint quantity, Corporation newOwner)
 {
     ItemInfo = item.ItemInfo;
     Quantity = quantity;
     Location = item.Location;
     Owner = newOwner;
 }
Beispiel #2
0
        public void ItemNameIsItemInfoName()
        {
            var itemInfo = new ItemInfo {Name = "Name of item"};
            var item = new Item(itemInfo);

            Assert.That(item.Name, Is.EqualTo(itemInfo.Name));
        }
Beispiel #3
0
 public static ItemState Save(Item item)
 {
     return new ItemState
     {
         ObjectId = item.Id,
         Type = item.ItemInfo.Type,
         Code = item.ItemInfo.Code,
         Quantity = item.Quantity,
     };
 }
Beispiel #4
0
        public void Add(Auction auction, long settlementPrice, Item item)
        {
            long price;
            _spendByOwner.TryGetValue(auction.Owner, out price);
            _spendByOwner[auction.Owner] = price + settlementPrice;

            if (_item == null)
            {
                _item = item;
            }
            else
            {
                _item.Quantity += item.Quantity;
            }
        }
Beispiel #5
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;
            }
Beispiel #6
0
 private ManufacturingResult Success(Item item = null)
 {
     return new ManufacturingResult { Success = true, Item = item };
 }
        public void CopyTo()
        {
            var item = Item();
            var collection = new ItemCollection {item};

            var items = new Item[1];
            collection.CopyTo(items, 0);

            Assert.That(items[0], Is.EqualTo(item));
        }
Beispiel #8
0
 public void Item()
 {
     var item = new Item(new ItemInfo());
     item.ObjectType.ShouldBe(ObjectType.Item);
 }
Beispiel #9
0
        public void CopyTo()
        {
            var item = _itemFactory.Build(ItemCode.LightFrigate, 1);

            var collection = new ItemCollection();
            collection.Add(item);

            var array = new Item[2];
            collection.CopyTo(array, 1);

            Assert.That(array, Is.EqualTo(new[] { null, item }));
        }