public bool Restart(Inventory inventory, int amount, BlueprintDataBlock blueprint, ulong startTimeMillis) { if (!blueprint || !blueprint.CanWork(amount, inventory)) { this = new CraftingSession(); return(false); } this.blueprint = blueprint; this.startTime = (float)((double)((float)startTimeMillis) / 1000); this.duration = blueprint.craftingDuration * (float)amount; this.progressPerSec = 1f; this.progressSeconds = 0f; this.amount = amount; this.inProgress = true; return(true); }
public bool Restart(Inventory inventory, int amount, BlueprintDataBlock blueprint, ulong startTimeMillis) { if (!blueprint || !blueprint.CanWork(amount, inventory)) { this = new CraftingSession(); return false; } this.blueprint = blueprint; this.startTime = (float)((double)((float)startTimeMillis) / 1000); this.duration = blueprint.craftingDuration * (float)amount; this.progressPerSec = 1f; this.progressSeconds = 0f; this.amount = amount; this.inProgress = true; return true; }