Example #1
0
        public int AddItemToCaptain(int idxofStash)
        {
            try
            {
                if (idxofStash >= stashList.Count)
                {
                    throw new Exception("Invalid stash item!");
                }

                int result = captain.AddItem(stashList[idxofStash]);
                if (result <= 0)
                {
                    throw new Exception(captain.lastErr);
                }

                stashList.RemoveAt(idxofStash);

                return(1);
            }
            catch (Exception ex)
            {
                lastErr = ex.Message;
                return(0);
            }
        }