Construct() public method

public Construct ( ) : Item
return Item
示例#1
0
        public virtual Item Construct()
        {
            int index = Utility.Random(m_Weight);

            for (int i = 0; i < m_Entries.Length; ++i)
            {
                FillableEntry entry = m_Entries[i];

                if (index < entry.Weight)
                {
                    return(entry.Construct());
                }

                index -= entry.Weight;
            }

            return(null);
        }