public override void Tick(IVoxelHandle handle) { //todo: should not be done every tick?? handle.Data.Inventory.ChangeCapacity(totalCapacity); handle.EachRandomInterval(0.1f, () => tryCollect(handle)); handle.EachRandomInterval(0.1f, () => tryDistribute(handle)); }
public override void Tick(IVoxelHandle handle) { handle.Data.Inventory.ChangeCapacity(inventorySize); handle.EachRandomInterval(1f, () => tryGatherResources(handle)); handle.EachRandomInterval(1f, () => tryGrind(handle)); handle.EachRandomInterval(1f, () => tryDeliverPigment(handle)); }
public override void Tick(IVoxelHandle handle) { handle.Data.Inventory.ChangeCapacity(maxItemCount); handle.EachRandomInterval(1f, () => { tryFish(handle); updateDataVal(handle); }); handle.EachRandomInterval(1f, () => { tryOutput(handle); updateDataVal(handle); }); }
public override void Tick(IVoxelHandle handle) { //todo: should not be done every tick?? handle.Data.Inventory.ChangeCapacity(totalResourceCapacity); //should be done at start checkResourceLevels(handle); //should be done at start (and is also done after each consume) foreach (var resource in neededResources) { handle.EachRandomInterval(resource.ConsummationRate, () => consume(resource, handle)); } handle.EachRandomInterval(1f, () => trySupplyWorkers(handle)); }
public override void Tick(IVoxelHandle handle) { handle.Data.Inventory.ChangeCapacity(inventorySize); handle.EachRandomInterval(2f, () => { tryHarvest(handle); updateDataval(handle); }); handle.EachRandomInterval(2f, () => { tryOutput(handle); updateDataval(handle); }); }
public override void Tick(IVoxelHandle handle) { handle.Data.Inventory.ChangeCapacity(inventoryCapacity); handle.Data.DataValue = handle.Data.DataValue < datavalOffset ? datavalOffset : handle.Data.DataValue; if (handle.Data.WorkerCount > 0) { handle.EachRandomInterval(getEfficiency(handle, 1f, 1f * neededWorkerCount), () => tryExcavate(handle)); handle.EachRandomInterval(getEfficiency(handle, 5f, 5f * neededWorkerCount), () => { tryOutput(handle); checkIfDepleted(handle); }); } }
public override void Tick(IVoxelHandle handle) { if (handle.Data.DataValue >= HarvestDataValue) { handle.Data.DataValue = HarvestDataValue; return; } handle.EachRandomInterval(5, () => { handle.Data.DataValue++; }); }
public override void Tick(IVoxelHandle handle) { handle.EachRandomInterval(0.5f, () => { tryGatherResources(handle); updateAppearance(handle); checkComplete(handle); }); }
public override void Tick(IVoxelHandle handle) { // TODO: should actually be done on type change of voxel, not every tick handle.Data.Inventory.ChangeCapacity(5); handle.EachRandomInterval(1, () => { tryHarvest(handle); tryOutput(handle); }); updateDataVal(handle); }
public override void Tick(IVoxelHandle handle) { handle.EachRandomInterval(2, () => { var possible = handle.Get4Connected().Where(e => e.Type == Hole).ToArray(); if (possible.Length == 0) { return; } foreach (var b in possible) { b.ChangeType(Water); b.Data.DataValue = 0; } }); if (handle.Data.DataValue >= maxDataVal) { return; } handle.EachRandomInterval(0.5f, () => { handle.Data.DataValue++; }); }
public override void Tick(IVoxelHandle handle) { handle.EachRandomInterval(2f, () => { if (!checkWaterInRange(handle)) { handle.Data.DataValue = 0; } else { if (handle.Data.DataValue < HarvestDataVal) { handle.Data.DataValue++; } } }); }