Esempio n. 1
0
 public EntityData(string name, int id, EntityBlock entityBlock)
 {
     this.name        = name;
     this.id          = id;
     this.entityBlock = entityBlock;
     this.localId     = id & (DataBlockInfo.BlockSize - 1);
 }
Esempio n. 2
0
 internal void Execute(EntityBlock entityBlock)
 {
     for (int i = 0; i < actionCount; i++)
     {
         groupActions[i].Update(entityBlock);
     }
 }
Esempio n. 3
0
        public static int AddBlock(EntityType entityType)
        {
            int         id          = entities.AddId();
            EntityBlock entityBlock = new EntityBlock(id, entityType);

            entities[id] = entityBlock;
            return(id);
        }
Esempio n. 4
0
 public void Update(EntityBlock entityBlock)
 {
     if (nowCycle == cycle)
     {
         Execute(entityBlock);
         nowCycle = 0;
     }
     else
     {
         nowCycle++;
     }
 }
Esempio n. 5
0
        public override void Execute(EntityBlock entityBlock)
        {
            int bid = entityBlock.BlockId << DataBlockInfo.BlockSizePow;

            int[] mark = entityBlock.DataBlockInfo.Marks;
            for (int i = 0; i < DataBlockInfo.BlockSize; i++)
            {
                if (mark[i] == -1)
                {
                    actions?.Invoke(bid + i);
                }
            }
        }
Esempio n. 6
0
 public abstract void Execute(EntityBlock entityBlock);
Esempio n. 7
0
 internal Entity(int id, EntityBlock entityBlock)
 {
     entityData = entityBlock.GetData <EntityData>(id & (DataBlockInfo.BlockSize - 1));
 }