private void btnSmartEmpty_Click(object sender, EventArgs e) { if (Hopper != null) { Hopper.SmartEmpty(textBox1); } }
// Use this for initialization void Start() { _isShowingResults = false; _lever = GetComponentInChildren <Lever>(); _hopper = GetComponentInChildren <Hopper>(); _screen = GetComponentInChildren <BanditScreen>(); }
private void emptyAllBtn_Click(object sender, EventArgs e) { if (Hopper != null) { Hopper.EmptyDevice(textBox1); } }
private void recycleBox_CheckedChange(object sender, EventArgs e) { CheckBox c; if (sender is CheckBox) { c = sender as CheckBox; try { int n = Int32.Parse(c.Name); if (c.Checked) { Hopper.RouteChannelToStorage(n, textBox1); } else { Hopper.RouteChannelToCashbox(n, textBox1); } } catch (Exception ex) { return; } } }
private void resetValidatorBtn_Click(object sender, EventArgs e) { if (Hopper != null) { Hopper.Reset(textBox1); } }
private void setAllToZeroToolStripMenuItem_Click(object sender, EventArgs e) { for (int i = 0; i < Hopper.NumberOfChannels; i++) { Hopper.SetCoinLevelsByChannel(i, 0, textBox1); } }
} // ThrashManualData private JsonResult DoSave(Hopper oHopper, string sNoAccountError, Customer oCustomer) { int mpID = FindOrCreateMarketplace(oCustomer); if (mpID <= 0) { log.Alert("Marketplace neither found nor created for customer {0}.", oCustomer.Stringify()); return(CreateJsonError(sNoAccountError)); } // if Connector.SetBackdoorData(this.vendorInfo.Name, mpID, oHopper); try { this.serviceClient.Instance.MarketplaceInstantUpdate(mpID); new RetrieveDataHelper( this.databaseHelper, new DatabaseMarketPlace(hmrcVendorInfo.Name) ).CustomerMarketplaceUpdateAction(mpID); } catch (Exception e) { log.Error(e, "Account has been linked but error occurred while storing the data."); return(CreateJsonError(this.hideRealError ? "Internal error occurred while storing VAT return data." : "Account has been linked but error occurred while storing the data: " + e.Message )); } // try return(CreateJsonNoError()); } // DoSave
// Start is called before the firsIt frame update void Start() { Spawn(); Spawn(); Spawn(); Spawn(); Spawn(); conveyorBelts[conveyors.Count - 1].setDirection(ConveyorBelt.DIRECTION.SOUTH); conveyors.Add(Instantiate(conveyor, transform.position, transform.rotation)); conveyorBelts.Add(conveyors[conveyors.Count - 1].GetComponent <ConveyorBelt>()); conveyors[conveyors.Count - 1].transform.position += new Vector3(conveyors.Count + 1, -1); conveyorBelts[conveyors.Count - 1].setDirection(ConveyorBelt.DIRECTION.SOUTH); conveyorBelts[conveyors.Count - 2].setNextConveyor(conveyorBelts[conveyors.Count - 1]); MachineOven oven = Instantiate(ovenItem, transform.position, transform.rotation).GetComponent <MachineOven>(); conveyorBelts[conveyors.Count - 1].setNextConveyor(oven); ConveyorBelt lastBelt = Instantiate(conveyor, transform.position, transform.rotation).GetComponent <ConveyorBelt>(); oven.transform.position += new Vector3(conveyors.Count + 1, -2); oven.setDirection(MachineOven.DIRECTION.SOUTH); lastBelt.transform.position += new Vector3(conveyors.Count + 1, -3); oven.setNextConveyor(lastBelt); Hopper ohopper = Instantiate(hopper, transform.position, transform.rotation).GetComponent <Hopper>(); ohopper.transform.position += new Vector3(2, 0); ohopper.setNextConveyor(conveyorBelts[0]); for (int i = 0; i < 10; i++) { ohopper.addConveyedItem(Instantiate(conveyedItem, transform.position + new Vector3(2, 0), transform.rotation).GetComponent <GenericFood>()); } }
public HmrcFileCache() { ErrorMsg = string.Empty; Hopper = new Hopper(VatReturnSourceType.Uploaded); m_oDateIntervals = new SortedDictionary <long, List <DateInterval> >(); AddedCount = 0; } // HmrcFileCache
public DigResult Dig(TimeSpan gameTime) { lastDig = gameTime; var faultMessages = GetFaultMessages(); if (faultMessages.Any()) { digFailed = true; return(DigResult.Fault(faultMessages)); } digFailed = false; UpdateLifetimeStat(DiggerStats.LifetimeDigs, 1); var durabilityHit = RollDurabilityHit(); Durability.Damage(durabilityHit); var chips = RollChips(); Hopper.AddChips(chips); UpdateLifetimeStat(DiggerStats.LifetimeChips, chips); return(DigResult.Success(chips, durabilityHit)); }
protected virtual void OnTryShoot(Shooter shooter) { if (Hopper.HasBalls) { Hopper.RemoveBall(); PublishShootEvent(); } }
public void TryIntakeBall(Ball ball) { if (Hopper.HasRoom) { Hopper.AddBall(); ball.QueueFree(); } }
public void Show() { Hopper h = new Hopper(); h.Unload(); Machine m = new Machine(); //m.Unload(); }
public static Piece GetPieceByNotation(string pieceNotation) { PieceColor color; int number; Piece piece; if (pieceNotation[0] == 'w') { color = PieceColor.White; } else if (pieceNotation[0] == 'b') { color = PieceColor.Black; } else { throw new Exception("Invalid color notation"); } if (pieceNotation.Length == 3) { if (!int.TryParse(pieceNotation[2].ToString(), out number)) { throw new Exception("Invalid number notation"); } } else { number = 1; } switch (pieceNotation[1]) { case 'A': piece = new Ant(color, number); break; case 'B': piece = new Beetle(color, number); break; case 'G': piece = new Hopper(color, number); break; case 'S': piece = new Spider(color, number); break; case 'Q': piece = new QueenBee(color, number); break; default: throw new Exception("Invalid piece notation"); } return(piece); }
public int Empty() { if (Hopper.IsFull && digFailed) { lastDig = TimeSpan.Zero; } return(Hopper.Empty()); }
void HopperScriptShowPlayers() { hopperScript = GameObject.FindGameObjectWithTag("Player").GetComponent <Hopper>(); if (hopperScript != null) { hopperScript.playerHolder.SetActive(true); hopperScript.playerHolderToHide.SetActive(false); } }
private void resetValidatorBtn_Click(object sender, EventArgs e) { if (Hopper != null) { Hopper.Reset(textBox1); } // Deliberately closing the port to force a reconnect Hopper.SSPComms.CloseComPort(); }
public PaintLineManager(CustomForm customForm) { this.customForm = customForm; hopper = new Hopper(this); casePacker = new CasePacker(this); weighStation = new WeighStation(this); fillHead = new FillHead(this); labeller = new Labeller(this); sealer = new Sealer(this); }
private void setAllToZeroToolStripMenuItem_Click(object sender, EventArgs e) { if (Hopper != null) { for (int i = 1; i < Hopper.NumberOfChannels + 1; i++) { Hopper.SetCoinLevelsByChannel(i, 0); } Hopper.UpdateData(); } }
public Vill(VillagerActivePlayer player, EntityArea entityArea) : base(entityArea) { this.player = player; attackCooldown = RXRandom.Float(); //random cooldown to start so they're not synced offsetY = 6f; int numArts = 8; artIndex = RXRandom.Range(0, numArts) + 1; body = new FContainer(); bodySprite = new FSprite("Arena/Vill" + artIndex + "_body"); body.AddChild(bodySprite); colorSprite = new FSprite("Arena/Vill" + artIndex + "_color"); colorSprite.color = player.player.color.color; body.AddChild(colorSprite); weapon = new FContainer(); body.AddChild(weapon); string weaponName = RXRandom.GetRandomString("RollingPin", "Torch", "Pitchfork", "", "", "", ""); //Rake, FryingPan if (weaponName != "" && artIndex != 8) { if (weaponName == "Torch") { var torch = new VillTorch(); weapon.AddChild(torch); } else { FSprite weaponSprite = new FSprite("Arena/" + weaponName + "_1"); weapon.AddChild(weaponSprite); } } shadowSprite = new FSprite("Arena/VillShadow"); shadowSprite.alpha = 0.2f; shadowSprite.scaleX = 0.7f; shadowSprite.scaleY = 0.5f; hopper = new Hopper(this); hopper.config.jumpDist = RXRandom.Range(18f, 19f); hopper.config.jumpDuration = RXRandom.Range(0.2f, 0.24f); hopper.config.jumpHeight = RXRandom.Range(3f, 4f); }
public Vill(VillagerActivePlayer player, EntityArea entityArea) : base(entityArea) { this.player = player; attackCooldown = RXRandom.Float(); //random cooldown to start so they're not synced offsetY = 6f; int numArts = 8; artIndex = RXRandom.Range(0,numArts)+1; body = new FContainer(); bodySprite = new FSprite("Arena/Vill"+artIndex+"_body"); body.AddChild(bodySprite); colorSprite = new FSprite("Arena/Vill"+artIndex+"_color"); colorSprite.color = player.player.color.color; body.AddChild(colorSprite); weapon = new FContainer(); body.AddChild(weapon); string weaponName = RXRandom.GetRandomString("RollingPin","Torch","Pitchfork","","","",""); //Rake, FryingPan if(weaponName != "" && artIndex != 8) { if(weaponName == "Torch") { var torch = new VillTorch(); weapon.AddChild(torch); } else { FSprite weaponSprite = new FSprite("Arena/"+weaponName+"_1"); weapon.AddChild(weaponSprite); } } shadowSprite = new FSprite("Arena/VillShadow"); shadowSprite.alpha = 0.2f; shadowSprite.scaleX = 0.7f; shadowSprite.scaleY = 0.5f; hopper = new Hopper(this); hopper.config.jumpDist = RXRandom.Range(18f,19f); hopper.config.jumpDuration = RXRandom.Range(0.2f,0.24f); hopper.config.jumpHeight = RXRandom.Range(3f,4f); }
} // Add public void Add(long nRegistrationNo, DateInterval di, SheafMetaData smd, ISeeds oSeeds) { Hopper.Add(smd, oSeeds); if (m_oDateIntervals.ContainsKey(nRegistrationNo)) { m_oDateIntervals[nRegistrationNo].Add(di); } else { m_oDateIntervals[nRegistrationNo] = new List <DateInterval> { di } }; AddedCount++; } // Add
private void btnToggleCoinMech_Click(object sender, EventArgs e) { if (Hopper != null) { if (Hopper.CoinMechEnabled) { if (Hopper.DisableCoinMech(textBox1)) { btnToggleCoinMech.Text = "En&able Coin Mech"; } } else if (Hopper.EnableCoinMech(textBox1)) { btnToggleCoinMech.Text = "&Disable Coin Mech"; } } }
public ChipDiggerState GetState() { return(new ChipDiggerState { Name = Name, LastDig = lastDig, FirstEquipped = FirstEquipped, DiggerBit = DiggerBit.GetState(), Durability = Durability.GetState(), Upgrades = AvailableUpgrades, Hopper = Hopper.GetState(), MineClaim = new MineClaimState { ChipDensity = MineClaim.ChipDensity, Hardness = MineClaim.Hardness }, LifeTimeStats = LifetimeStats }); }
private void recycleBoxHopper_CheckedChange(object sender, EventArgs e) { CheckBox c = sender as CheckBox; try { if (c.Checked) { Hopper.RouteChannelToStorage(Int32.Parse(c.Name), textBox1); } else { Hopper.RouteChannelToCashbox(Int32.Parse(c.Name), textBox1); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); return; } }
} // Add public bool Intersects(long nRegistrationNo, DateInterval di) { if (!m_oDateIntervals.ContainsKey(nRegistrationNo)) { return(false); } foreach (DateInterval oInterval in m_oDateIntervals[nRegistrationNo]) { if (oInterval.Intersects(di)) { Hopper.Clear(); m_oDateIntervals.Clear(); ErrorMsg = "Inconsistent date ranges: " + oInterval + " and " + di + "."; ms_oLog.Warn("HMRC file cache has been cleaned because of error: {0}", ErrorMsg); return(true); } // if } // for each return(false); } // Intersects
private void btnSetFloat_Click(object sender, EventArgs e) { try { double minPayoutTxt = double.Parse(tbMinPayout.Text) * 100; short minPayout = (Int16)minPayoutTxt; double floatAmountTxt = double.Parse(tbFloatAmount.Text) * 100; int floatAmount = (Int32)floatAmountTxt; if (Hopper != null) { Hopper.SetFloat(minPayout, floatAmount, tbFloatCurrency.Text.ToCharArray(), textBox1); } } catch (Exception ex) { MessageBox.Show(ex.ToString(), "EXCEPTION"); return; } }
private void btnFloat_Click(object sender, EventArgs e) { try { // Validate if (tbFloatAmount.Text == "" || tbMinPayout.Text == "" || tbFloatCurrency.Text == "") { return; } // Parse to a float float fFa = float.Parse(tbFloatAmount.Text); float fMp = float.Parse(tbMinPayout.Text); int fa = (Int32)(fFa * 100); // multiply by 100 for penny value // If payout selected if (cbFloatSelect.Text == "SMART Payout") { int mp = (int)(fMp * 100); // multiply by 100 for penny value Payout.SetFloat(mp, fa, tbFloatCurrency.Text.ToCharArray(), textBox1); } // Or if Hopper else if (cbFloatSelect.Text == "SMART Hopper") { short mp = (short)(fMp * 100); // multiply by 100 for penny value Hopper.SetFloat(mp, fa, tbFloatCurrency.Text.ToCharArray(), textBox1); } else { MessageBox.Show("Choose a device to float from!"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); return; } }
} // SaveUploadedFiles public JsonResult SaveNewManuallyEntered(string sData) { if (string.IsNullOrWhiteSpace(sData)) { return(CreateJsonError("No data received.")); } HmrcManualDataModel oData; try { oData = JsonConvert.DeserializeObject <HmrcManualDataModel>(sData); } catch (Exception e) { return(CreateJsonError("Failed to parse input data: " + e.Message)); } // try if (!oData.IsValid()) { return(CreateJsonError(string.Join("\n", oData.Errors))); } Customer oCustomer = this.customers.ReallyTryGet(oData.CustomerID); if (oCustomer == null) { return(CreateJsonError("Could not retrieve customer by id {0}.", oData.CustomerID)); } string stateError; Hopper oSeeds = ThrashManualData(oData, out stateError); if (stateError != null) { return(CreateJsonError(stateError)); } return(DoSave(oSeeds, "Failed to save manual VAT return data.", oCustomer)); } // SaveNewManuallyEntered
public static void Mainx(string[] args) { EconomyVagon ew1 = new EconomyVagon(21, 10); EconomyVagon ew2 = new EconomyVagon(22, 10); Person st1 = new Person("Lenka", "Kozakova"); // BusinessVagon bw1 = new BusinessVagon(st1, 11, 20); // Person st2 = new Person("Lukas", "Kozak"); // BusinessVagon bw2 = new BusinessVagon(st2, 12, 25); // NightVagon nw1 = new NightVagon(31, 5, 10); NightVagon nw2 = new NightVagon(32, 5, 10); Hopper hw1 = new Hopper(41, 100.5); Hopper hw2 = new Hopper(42, 110.5); Hopper hw4 = new Hopper(44, 110.5); Hopper hw5 = new Hopper(45, 110.5); Person d1 = new Person("Karel", "Novak"); // Engine e1 = new Engine("Diesel"); // Locomotive l1 = new Locomotive(d1, e1); // Person d2 = new Person("Pepa", "Parnik"); // Engine e2 = new Engine("Parni"); // Locomotive l2 = new Locomotive(d2, e2); // Train t1 = new Train(l1); t1.ConnectWagon(ew1); t1.ConnectWagon(ew2); t1.ConnectWagon(ew2); t1.ConnectWagon(bw1); t1.ConnectWagon(nw1); t1.ConnectWagon(hw1); t1.ConnectWagon(hw1); t1.ConnectWagon(hw2); t1.ConnectWagon(hw4); t1.ConnectWagon(hw5); t1.ConnectWagon(hw5); Console.WriteLine(t1); Console.WriteLine(); t1.DisconnectWagon(ew1); Console.WriteLine(t1); Console.WriteLine(); t1.DisconnectWagon(ew1); Console.WriteLine(); Train t2 = new Train(l2); t2.ConnectWagon(ew1); t2.ConnectWagon(ew2); t2.ConnectWagon(bw2); t2.ConnectWagon(nw1); t2.ConnectWagon(nw1); t2.ConnectWagon(nw2); t2.ConnectWagon(hw1); t2.ConnectWagon(hw2); t2.ConnectWagon(hw4); t2.ConnectWagon(hw5); Console.WriteLine(t2); Console.WriteLine(); t1.ReserveChair(21, 5); t1.ReserveChair(21, 6); t1.ReserveChair(22, 7); t1.ReserveChair(22, 7); t1.ReserveChair(11, 4); t1.ReserveChair(11, 5); t1.ReserveChair(41, 5); t1.ReservedChairs(); Console.WriteLine(); }
public static void SetBackdoorData(string sAccountTypeName, int nCustomerMarketplaceID, Hopper oHopper) { VendorInfo vi = Integration.ChannelGrabberConfig.Configuration.Instance.GetVendorInfo(sAccountTypeName); if (vi == null) { return; } switch (vi.Behaviour) { case Behaviour.Default: // nothing to do here break; case Behaviour.HMRC: Ezbob.HmrcHarvester.Harvester.SetBackdoorData(nCustomerMarketplaceID, oHopper); break; default: throw new ArgumentOutOfRangeException(); } // switch } // SetBackdoorData