public void finishOrder(double currentBeat, ORDER_RESULT result) { startSongTime = currentBeat; endSongTime = currentBeat + 4; hasOrdered = true; orderResult = result; }
// Hide the speech bubble when an order ends public void orderEnd(ORDER_RESULT result) { speechHideStack--; speechHideStack = Mathf.Max(0, speechHideStack); if (speechHideStack == 0) { gameObject.SetActive(false); } }
public Order(double startSongTime, List <Recipe> recipes) { this.startSongTime = startSongTime; this.recipes = recipes; done = false; started = false; finished = false; shown = false; result = ORDER_RESULT.SUCCESS; }
public void update(Engine engine) { // Update customer visuals customer.update(engine); // Update order visuals if (!shown && engine.getSongTime() >= startSongTime) { shown = true; engine.showOrderStart(); } if (done) { return; } // Update recipes bool allDone = true; foreach (Recipe r in recipes) { // If the Recipe has not been completed if (!r.isDone()) { allDone = false; if (engine.getSongTime() >= r.getStartSongTime()) { if (!r.isStarted()) { r.start(engine); } r.update(engine); if (r.isDone()) { r.finish(engine); if (!r.didSucceed()) { result = ORDER_RESULT.FAILURE; } } } } } if (allDone) { done = true; } }
public void showOrderResult(ORDER_RESULT result) { orderEnd.Invoke(result); }