/// <summary>Removes the item.</summary> /// <param name="name">The name.</param> public void RemoveItem(string name) { items.ToObservable() .Where(x => x.Name == name) .Subscribe(x => { var posInInventoryGrid = x.Position; var emptyGrid = new InventoryGridData(posInInventoryGrid, "", 0, true); model.set[posInInventoryGrid] = emptyGrid; }); }
public void Init() { //创建核心数据 //断言 //初始创建9个数据格 for (int i = 0; i < gridCapacity; i++) { var _gridData = new InventoryGridData(i, "", 0, true); model.set.Add(_gridData); } }