Пример #1
0
    // ========================================================================== //

    /* public - [Do] Function
     * 외부 객체가 호출(For External class call)*/

    public SimplePool(OnCreateItem OnCreateItem, OnDestroyItem OnDestroyItem, int iPrePoolCount)
    {
        DoDestroyPool(false);

        _bIsInit       = true;
        _OnCreateItem  = OnCreateItem;
        _OnDestoryItem = OnDestroyItem;

        for (int i = 0; i < iPrePoolCount; i++)
        {
            _list_Unused.Add(CreateItem());
        }
    }
 public void Run(GimmickValue value, DateTime current)
 {
     OnDestroyItem?.Invoke(new DestroyItemEventArgs {
         Item = item, TimestampDiffSeconds = (current - value.TimeStamp).TotalSeconds
     });
 }