Example #1
0
 public BackpackItem(BackpackItem other)
     : base(other)
 {
     this.Quantity = other.Quantity;
     this.Equipped = other.Equipped;
     this.Mark     = other.Mark;
 }
        public BackpackItemViewModel(BackpackItem item)
            : base(item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            this._Item = item;
        }
 public void NewItem()
 {
     var item = new BackpackItem()
     {
         UniqueId = new Random().Next(int.MinValue, int.MaxValue),
         // TODO: check other item unique IDs to prevent rare collisions
         AssetLibrarySetId = 0,
     };
     var viewModel = new BackpackItemViewModel(item);
     this.Slots.Add(viewModel);
     this.SelectedSlot = viewModel;
 }