public Integer ProduceClips(WireStorage wire) { Queue += ClipsPerTick; wire.TryTake(Integer.Floored(Queue), out var taken); Queue -= Math.Floor(Queue); return(taken); }
private void PerformUserAction(UserAction userAction) { switch (userAction) { case UserAction.MakeClip: if (Wire.TryTake(Integer.Int(1), out var taken)) { Clips.Add(taken); } break; case UserAction.RaiseMargin: Marketplace.ChangePrice(Money.Cents(1)); break; case UserAction.LowerMargin: Marketplace.ChangePrice(-Money.Cents(1)); break; case UserAction.BuyAds: Marketplace.BuyAds(Funds); break; case UserAction.BuyWire: if (WireSeller.TryPurchaseSpool(Funds, out var wire)) { Wire.Add(wire); } break; case UserAction.BuyClipper: ClipperManager.TryPurchase(Funds); break; case UserAction.None: default: break; } }