コード例 #1
0
        public void ForeachEntities(GCContainer rGCContainer, Action <GCContainer> rExecuteComponents, params Type[] rTypes)
        {
            if (rTypes.Length == 0)
            {
                return;
            }

            for (int i = 0; i < mEntities.Count; i++)
            {
                var rEntity = mEntities[i];
                rGCContainer.Clear();
                bool bIsIgnore = false;
                for (int k = 0; k < rTypes.Length; k++)
                {
                    var rComp = rEntity.Components.Find((rItem) => { return(rItem.GetType().Equals(rTypes[k])); });
                    if (rComp == null)
                    {
                        bIsIgnore = true;
                        break;
                    }
                    rGCContainer.Add(rComp);
                }
                if (!bIsIgnore)
                {
                    UtilTool.SafeExecute(rExecuteComponents, rGCContainer);
                }
            }
        }
コード例 #2
0
 public void ForeachEntities(GCContainer rGCContainer, Action <GCContainer> rExecuteComponents, params Type[] rTypes)
 {
     rGCContainer.Clear();
     for (int i = 0; i < mEntities.Count; i++)
     {
         var rEntity = mEntities[i];
         for (int k = 0; k < rTypes.Length; k++)
         {
             var rComp = rEntity.Components.Find((rItem) => { return(rItem.GetType().Equals(rTypes[k])); });
             rGCContainer.Add(rComp);
         }
     }
     UtilTool.SafeExecute(rExecuteComponents, rGCContainer);
 }
コード例 #3
0
ファイル: GameSystem.cs プロジェクト: zj831007/knight
 public virtual void Initialize()
 {
     this.IsActive     = true;
     this.mResultComps = new GCContainer();
 }