public ForgeJob(IntVector3 pos, params Action <ChunkGenData>[] callback) { this.pos = pos; status = ForgeProcessStatus.NOT_STARTED; callbacks = new List <Action <ChunkGenData> >(); callbacks.AddRange(callback); }
void UpperCallback(ChunkGenData cdata) { status = ForgeProcessStatus.FINISHED; foreach (var act in callbacks) { act(cdata); } }
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); }