예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pt"></param>
        /// <returns></returns>
        private int Find(PowderType pt)
        {
            for (int i = 0; i < Powders.Count; ++i)
            {
                if (Powders[i] == pt)
                {
                    return(i);
                }
            }

            return(Program.NOINDEX);
        }
예제 #2
0
        /******************************************************************************************
        * Public Methods
        ******************************************************************************************/
        #region Public Methods
        public void AddPowder(PowderType pt)
        {
            int index = Find(pt);

            // Check if bullet type exists in the List, if so then append data
            // else add the whole data structure to the list of bullet types
            if (index < 0)
            {
                Powders.Add(pt);
            }
            else
            {
                // TODO
            }
        }