Construct() 공개 메소드

public Construct ( ) : Item
리턴 Item
예제 #1
0
        public virtual void GenerateContent()
        {
            if (m_Content == null || Deleted)
            {
                return;
            }

            int toSpawn = GetSpawnCount();

            for (int i = 0; i < toSpawn; ++i)
            {
                Item item = m_Content.Construct();

                if (item == null)
                {
                    continue;
                }

                if (!Items.Not(subItem => subItem is Container).Any(subItem => subItem.StackWith(null, item, false)) ||
                    !item.Deleted)
                {
                    DropItem(item);
                }
            }
        }
예제 #2
0
        public virtual void GenerateContent()
        {
            if (m_Content == null || Deleted)
            {
                return;
            }

            int toSpawn = GetSpawnCount();

            for (int i = 0; i < toSpawn; ++i)
            {
                Item item = m_Content.Construct();

                if (item != null)
                {
                    List <Item> list = this.Items;

                    for (int j = 0; j < list.Count; ++j)
                    {
                        Item subItem = list[j];

                        if (!(subItem is Container) && subItem.StackWith(null, item, false))
                        {
                            break;
                        }
                    }

                    if (item != null && !item.Deleted)
                    {
                        DropItem(item);
                    }
                }
            }
        }