public void AddToStack(ResourceItem resourceScript) { int timesToPop = _MAX_COUNT - this._stackSize; if (timesToPop > 0) { for (int i = 0; i < timesToPop; i++) { int poppedID = resourceScript.PopStack(); if (poppedID != -1) { this._resrcStack.Push(poppedID); this._initialStats = false; } else break; } this._stackSize = this._resrcStack.Count; this.StoreSpecificItemInfo(); } }