public void RemovePiece(PieceController p) { string fname = p.GetFilename(); for (int i = 0; i < fullList.Count; i++) { InventoryRecord ir = fullList[i]; if (fname.Equals(ir.pieceFileName)) { int oldcount = ir.GetCount(); if (oldcount <= 0) { return; } else if (oldcount == 1) { ir.SetCount(ir.GetCount() - 1); RefreshList(); } else { ir.SetCount(ir.GetCount() - 1); } break; } } }
public void AddPiece(PieceController p) { string fname = p.GetFilename(); for (int i = 0; i < fullList.Count; i++) { InventoryRecord ir = fullList[i]; if (fname.Equals(ir.pieceFileName)) { Debug.Log("old count is " + ir.GetCount()); ir.SetCount(ir.GetCount() + 1); Debug.Log("new count is " + ir.GetCount()); if (ir.GetCount() == 1) { Debug.Log("we just tried refreshing"); RefreshList(); } break; } else { Debug.Log(fname + " doesn't equal " + ir.pieceFileName); } } }
public void AddPiece(PieceController p) { string fname = p.GetFilename(); for(int i = 0; i < fullList.Count; i++){ InventoryRecord ir = fullList[i]; if(fname.Equals(ir.pieceFileName)){ //Debug.Log("old count is " + ir.GetCount()); ir.SetCount(ir.GetCount()+1); //Debug.Log ("new count is " + ir.GetCount()); if(ir.GetCount() == 1){ //Debug.Log ("we just tried refreshing"); RefreshList(); } break; }else{ //Debug.Log(fname + " doesn't equal " + ir.pieceFileName); } } }
public void RemovePiece(PieceController p) { string fname = p.GetFilename(); for(int i = 0; i < fullList.Count; i++){ InventoryRecord ir = fullList[i]; if(fname.Equals(ir.pieceFileName)){ int oldcount = ir.GetCount(); if(oldcount <= 0){ return; }else if(oldcount == 1){ ir.SetCount(ir.GetCount()-1); RefreshList(); }else{ ir.SetCount(ir.GetCount()-1); } break; } } }