コード例 #1
0
        public void Refresh()
        {
            if (Events.Length > 10000)
            {
                Events.Clear();
            }
            using (var list = ListObjectPool <string> .AllocAutoRelease())
            {
                this.Runner.PopLogs(list);
                foreach (var e in list)
                {
                    Events.AppendLine(e);
                }
            }
            var colums = Runner.Columns;

            for (int i = 1; i < colums.Length; i++)
            {
                if (this.SubItems[i].Text != colums[i])
                {
                    this.SubItems[i].Text = colums[i];
                }
            }
            if (Client.GameClient.IsConnected == false)
            {
                this.ForeColor = Color.Gray;
            }
            else
            {
                this.ForeColor = Color.Black;
            }
        }
コード例 #2
0
        protected EntityManager(int componentCount, int entityPoolSize)
        {
            ComponentCount = componentCount;

            _entityPool =
                new ListObjectPool <TEntity>(() => new TEntity(), entityPoolSize, entityPoolSize, entityPoolSize);
            _componentPools = new IObjectPool[ComponentCount];

            _groupsByComponentId = new List <EntityGroup <TEntity> > [ComponentCount];
        }
コード例 #3
0
 protected virtual void Add <TComponent>(int componentId, int poolSize)
     where TComponent : Component, new() => _componentPools[componentId] =
     new ListObjectPool <TComponent>(() => new TComponent(), poolSize, poolSize, poolSize);