public ASyncScheduleItem ReplaceOrFollowWith(ASyncScheduleItem item) { lock (Locker) { if (FollowUp != null) { return FollowUp.ReplaceOrFollowWith(item); } if (Started) { if (Done) { item.RunMe(); return item; } else { FollowUp = item; return item; } } else { MyAction = item.MyAction; FollowUp = item.FollowUp; return this; } } }
public ASyncScheduleItem ReplaceOrFollowWith(ASyncScheduleItem item) { lock (Locker) { if (FollowUp != null) { return(FollowUp.ReplaceOrFollowWith(item)); } if (Started) { if (Done) { item.RunMe(); return(item); } else { FollowUp = item; return(item); } } else { MyAction = item.MyAction; FollowUp = item.FollowUp; return(this); } } }
public ASyncScheduleItem AddASyncTask(Action a, ASyncScheduleItem followUp = null) { ASyncScheduleItem asyncer = new ASyncScheduleItem(); asyncer.MyAction = a; asyncer.FollowUp = followUp; return(asyncer); }
public ASyncScheduleItem StartASyncTask(Action a) { ASyncScheduleItem asyncer = new ASyncScheduleItem(); asyncer.MyAction = a; asyncer.RunMe(); return(asyncer); }
public void FollowWith(ASyncScheduleItem item) { lock (Locker) { if (Done) { item.RunMe(); } else { FollowUp = item; } } }
/// <summary> /// Internal region call only. /// </summary> public void MakeVBONow() { if (SucceededBy != null) { SucceededBy.MakeVBONow(); return; } Chunk c_zp = OwningRegion.GetChunk(WorldPosition + new Vector3i(0, 0, 1)); Chunk c_zm = OwningRegion.GetChunk(WorldPosition + new Vector3i(0, 0, -1)); Chunk c_yp = OwningRegion.GetChunk(WorldPosition + new Vector3i(0, 1, 0)); Chunk c_ym = OwningRegion.GetChunk(WorldPosition + new Vector3i(0, -1, 0)); Chunk c_xp = OwningRegion.GetChunk(WorldPosition + new Vector3i(1, 0, 0)); Chunk c_xm = OwningRegion.GetChunk(WorldPosition + new Vector3i(-1, 0, 0)); Chunk c_zpxp = OwningRegion.GetChunk(WorldPosition + new Vector3i(0, 1, 1)); Chunk c_zpxm = OwningRegion.GetChunk(WorldPosition + new Vector3i(0, -1, 1)); Chunk c_zpyp = OwningRegion.GetChunk(WorldPosition + new Vector3i(1, 0, 1)); Chunk c_zpym = OwningRegion.GetChunk(WorldPosition + new Vector3i(-1, 0, 1)); List<Chunk> potentials = new List<Chunk>(); for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { Chunk tch = OwningRegion.GetChunk(WorldPosition + new Vector3i(x, y, z)); if (tch != null) { potentials.Add(tch); } } } } Action a = () => VBOHInternal(c_zp, c_zm, c_yp, c_ym, c_xp, c_xm, c_zpxp, c_zpxm, c_zpyp, c_zpym, potentials); if (rendering != null) { ASyncScheduleItem item = OwningRegion.TheClient.Schedule.AddASyncTask(a); rendering = rendering.ReplaceOrFollowWith(item); } else { rendering = OwningRegion.TheClient.Schedule.StartASyncTask(a); } }
public ASyncScheduleItem StartASyncTask(Action a) { ASyncScheduleItem asyncer = new ASyncScheduleItem(); asyncer.MyAction = a; asyncer.RunMe(); return asyncer; }
public ASyncScheduleItem AddASyncTask(Action a, ASyncScheduleItem followUp = null) { ASyncScheduleItem asyncer = new ASyncScheduleItem(); asyncer.MyAction = a; asyncer.FollowUp = followUp; return asyncer; }