// Use this for initialization void Start() { anim = gameObject.GetComponent <Animator>(); tank = waterTankObj.GetComponent <WaterTank>(); gogoapi = gogoAPIObj.GetComponent <GogoAPI>(); TalkToGoGo_tankIsFullOut(); }
public void Example3() { int[] t = new int[] { 9, 3, 4, 8, 1, 2, 5, 7, 6 }; int[] x = new int[] { 123, 456, 789, 1011, 1213, 1415, 1617, 1819, 2021 }; int C = 11; double __expected = 2019.1666666666665; double __result = new WaterTank().minOutputRate(t, x, C); AssertTcEqualTo(__expected, __result); }
static void Main(string[] args) { var large = new LargeAirPump(); var tank = new WaterTank(large); var fishes = new List <Fish>(); fishes.Add(new Fish(AnimalSize.Tiny)); fishes.Add(new Fish(AnimalSize.Tiny)); fishes.Add(new Fish(AnimalSize.Tiny)); fishes.Add(new Fish(AnimalSize.Tiny)); fishes.Add(new Fish(AnimalSize.Small)); fishes.Add(new Fish(AnimalSize.Small)); fishes.Add(new Fish(AnimalSize.Small)); fishes.Add(new Fish(AnimalSize.Medium)); fishes.Add(new Fish(AnimalSize.Medium)); fishes.Add(new Fish(AnimalSize.Large)); tank.Animals.AddRange(fishes); var crabs = new List <Crab>(); crabs.Add(new Crab(AnimalSize.Small)); crabs.Add(new Crab(AnimalSize.Medium)); tank.Animals.AddRange(crabs); tank.StartTheBattleOfLife(); }
public CoffeeMachine() { _beanTank = new CoffeeBeanTank(); _waterTank = new WaterTank(); _disposal = new CoffeeDisposal(); _grinder = new CoffeeGrinder(); }
static void Main(string[] args) { var waterTank = new WaterTank() { Capacity = 100.0m, CurrentAmount = 0.0m }; var commandManager = new CommandManager(); commandManager.Invoke(new FillWaterTankCommand(waterTank, 50.0m)); Console.WriteLine(waterTank); commandManager.Invoke(new FillWaterTankCommand(waterTank, 60.0m)); Console.WriteLine(waterTank); commandManager.Invoke(new FillWaterTankCommand(waterTank, 10.0m)); Console.WriteLine(waterTank); commandManager.Undo(); Console.WriteLine(waterTank); commandManager.Invoke(new UnfillWaterTankCommand(waterTank, 10.0m)); Console.WriteLine(waterTank); commandManager.Invoke(new UnfillWaterTankCommand(waterTank, 100.0m)); Console.WriteLine(waterTank); commandManager.Invoke(new UnfillWaterTankCommand(waterTank, 10.0m)); Console.WriteLine(waterTank); commandManager.Undo(); Console.WriteLine(waterTank); }
public void Example2() { int[] t = new int[] { 5949, 3198, 376, 3592, 4019, 3481, 5609, 3840, 6092, 4059 }; int[] x = new int[] { 29, 38, 96, 84, 10, 2, 39, 27, 76, 94 }; int C = 1000000000; double __expected = 0.0; double __result = new WaterTank().minOutputRate(t, x, C); AssertTcEqualTo(__expected, __result); }
public override void Interact() { if (dirtSlot != null) { // TODO: Do it when you put items in the machine slot if (dirtSlot.ItemGO != null) { dirtCount = dirtSlot.Item.itemCount; dirtPercentage += 0.5f; if (dirtPercentage >= 100) { dirtPercentage = 0; dirtCount--; dirtSlot.UpdateItemCount(-1); sandSlot.AddItem(TileType.Sand, 1); } foreach (MachineBlock block in machineBlocks) { WaterTank _waterTank = block.GetComponent <WaterTank>(); if (_waterTank != null) { if (_waterTank.AddWater(0.1f)) { return; } } } Debug.LogError("No water tank found!"); } } }
private static void Main(string[] args) { WaterTank tank = new WaterTank(); WaterTankMonitor monitor = new WaterTankMonitor(tank); monitor.Fill(); monitor.Empty(); Console.ReadLine(); }
private void Awake() { _instance = this; rb = GetComponent <Rigidbody2D>(); waterTank = GetComponent <WaterTank>(); waterTank.WaterLevelChanged += Player_WaterLevelChanged; }
public void ShouldFillWater_Success() { // Arrange var waterTank = new WaterTank(capacity: 1000m); // Act waterTank.Fill(300m); // Assert waterTank.CurrentVolume.Should().Be(300m); }
public void ShouldDrainWater_ThrowsExceptionIfCurrentVolumeIsTooLow() { // Arrange var waterTank = new WaterTank(capacity: 1000m); // Act Action action = () => waterTank.Drain(100m); // Assert action.Should().Throw <ArgumentException>(); }
// Use this for initialization void Start() { //ModifyButton.GetComponent<Button>().onClick.AddListener(togglePump); gogo = ObjectGogoAPI.GetComponent <GogoAPI>(); buttomToggle = Time.time; tank = gameObject.GetComponent <WaterTank>(); Pump.SetActive(false); if (PumpSmoke != null) { PumpSmoke.SetActive(false); } }
public void Example4() { int[] t = new int[] { 100 }; int[] x = new int[] { 1000 }; int C = 12345; double __expected = 876.55; double __result = new WaterTank().minOutputRate(t, x, C); AssertTcEqualTo(__expected, __result); }
public void ShouldDrainWater_Success() { // Arrange var waterTank = new WaterTank(capacity: 1000m); waterTank.Fill(300m); // Act var drainedVolume = waterTank.Drain(100m); // Assert drainedVolume.Should().Be(100m); waterTank.CurrentVolume.Should().Be(200m); }
public void Example0() { int[] t = new int[] { 3, 3 }; int[] x = new int[] { 1, 2 }; int C = 3; double __expected = 0.9999999999999999; double __result = new WaterTank().minOutputRate(t, x, C); AssertTcEqualTo(__expected, __result); }
public void Example1() { int[] t = new int[] { 1, 2, 3, 4, 5 }; int[] x = new int[] { 5, 4, 3, 2, 1 }; int C = 10; double __expected = 1.9999999999999996; double __result = new WaterTank().minOutputRate(t, x, C); AssertTcEqualTo(__expected, __result); }
public void InitializeComponents() { _tank = new WaterTank(); _button = new Button(); _button.Text = "Add Water"; _button.Click += new EventHandler(this.AddWaterButtonClick); _button.Dock = DockStyle.Bottom; _panel = new FlowLayoutPanel(); _panel.SuspendLayout(); _panel.FlowDirection = FlowDirection.TopDown; _panel.AutoSize = true; _panel.AutoSizeMode = AutoSizeMode.GrowAndShrink; _panel.Height = _tank.Height + _button.Height + 75; _panel.Controls.Add(_tank); _panel.Controls.Add(_button); this.SuspendLayout(); this.Text = "Water System"; this.Height = _panel.Height; this.Width = _tank.Width; this.Controls.Add(_panel); _panel.ResumeLayout(); this.ResumeLayout(); }
public void SetField(WaterTank _Field) { Field = _Field; }
// Use this for initialization void Start() { particle.active = false; tankValue = tank.GetComponent <WaterTank>(); gogo = gogoapi.GetComponent <GogoAPI>(); }
// Use this for initialization void Start() { wtank = tank.GetComponent <WaterTank>(); OK.SetActive(false); }
void Awake() { this.rb = gameObject.GetComponent <Rigidbody2D>(); this.tankScript = tank.GetComponent <WaterTank>(); this.audio = gameObject.GetComponent <AudioSource>(); }
public WaterTankMonitor(WaterTank tank) { this.tank = tank; }
public FillWaterTankCommand(WaterTank waterTank, decimal amount) { _waterTank = waterTank; _amount = amount; }
// Use this for initialization void Start() { watertank = WaterTank_obj.GetComponent <WaterTank>(); }
public Pump(WaterTank tank, int pumpingCapacity) { _pumpingCapacity = pumpingCapacity; _itsTank = tank; }