Esempio n. 1
0
 public ForgeJob(IntVector3 pos, params Action <ChunkGenData>[] callback)
 {
     this.pos  = pos;
     status    = ForgeProcessStatus.NOT_STARTED;
     callbacks = new List <Action <ChunkGenData> >();
     callbacks.AddRange(callback);
 }
Esempio n. 2
0
 void UpperCallback(ChunkGenData cdata)
 {
     status = ForgeProcessStatus.FINISHED;
     foreach (var act in callbacks)
     {
         act(cdata);
     }
 }
Esempio n. 3
0
 public bool Start(ChunkForge forge)
 {
     if (forge.Busy)
     {
         return(false);
     }
     if (status > ForgeProcessStatus.NOT_STARTED)
     {
         return(false);
     }
     status = ForgeProcessStatus.IN_PROCESS;
     forge.ForgeChunkGenData(pos, UpperCallback);
     return(true);
 }