// Use this for initialization void Start() { currentScore = GameObject.Find("CurrentScore").GetComponent<CurrentScore>(); fullScore = GameObject.FindObjectOfType<FullScore>(); score = GetComponent<Score>(); energy = GetComponent<Energy>(); energyLine = GameObject.FindObjectOfType<EnergyLine>(); inputController = GameObject.FindObjectOfType<InputController>(); timerScript = GameObject.FindObjectOfType<TimerScript>(); timerUI = GameObject.FindObjectOfType<TimerUI>(); info = GetComponent<Info>(); taskStrings = GetComponent<TaskStrings>(); pauseButton = GameObject.FindObjectOfType<PauseButton>().gameObject; pauseMenu = GameObject.Find("Canvas").GetComponentInChildren<PauseMenu>(); // endMenu = GameObject.FindObjectOfType<EndMenu>(); taskHelper = GameObject.FindObjectOfType<TaskHelper>(); globalController = GetComponent<GlobalController>(); cam = GameObject.Find("MainCamera"); secondCamera = GameObject.Find("SecondCamera"); wordRideCanvas = GameObject.FindObjectOfType<WordRideCanvas>(); metalSparksPrefab = Resources.Load("Prefabs/Particles/MetalSpark") as GameObject; carUserParametres = GetComponent<CarUserParametres>(); gameUI = GameObject.FindObjectOfType<GameUI>(); canvasController = GameObject.FindObjectOfType<CanvasController>(); particleCanvas = GameObject.Find("ParticleCanvas"); carCreator = GameObject.FindObjectOfType<CarCreator>(); mainBonus = GameObject.FindObjectOfType<MainBonus>(); waitBackground = GameObject.FindObjectOfType<WaitBackground>(); }
public void VerifyAllEnums() { var acceleration = new Acceleration(1, AccelerationUnit.BaseUnit); var angle = new Angle(1, AngleUnit.BaseUnit); var angularAcceleration = new AngularAcceleration(1, AngularAccelerationUnit.BaseUnit); var area = new Area(1, AreaUnit.BaseUnit); var density = new MassDensity(1, MassDensityUnit.BaseUnit); var electricCurrent = new ElectricCurrent(1, ElectricCurrentUnit.BaseUnit); var electricResistance = new ElectricResistance(1, ElectricResistanceUnit.BaseUnit); var electricVoltage = new ElectricPotential(1, ElectricPotentialUnit.BaseUnit); var energy = new Energy(1, EnergyUnit.BaseUnit); var force = new Force(1, ForceUnit.BaseUnit); var frequency = new Frequency(1, FrequencyUnit.BaseUnit); var jerk = new Jerk(1, JerkUnit.BaseUnit); var length = new Length(1, LengthUnit.BaseUnit); var mass = new Mass(1, MassUnit.BaseUnit); var massFlowRate = new MassFlowRate(1, MassFlowRateUnit.BaseUnit); var momentum = new Momentum(1, MomentumUnit.BaseUnit); var numeric = new Numeric(1, NumericUnit.BaseUnit); var power = new Power(1, PowerUnit.BaseUnit); var pressure = new Pressure(1, PressureUnit.BaseUnit); var speed = new Speed(1, SpeedUnit.BaseUnit); var temperature = new Temperature(1, TemperatureUnit.BaseUnit); var time = new Time(1, TimeUnit.BaseUnit); var torque = new Torque(1, TorqueUnit.BaseUnit); var volume = new Volume(1, VolumeUnit.BaseUnit); var volumetricFlowRate = new VolumetricFlowRate(1, VolumetricFlowRateUnit.BaseUnit); }
void Regulus.Game.IStage.Enter() { for (int i = 0; i < _Groups.Length; ++i ) { var energy = new Energy(3); var eg = new EnergyGroup() { Energy = energy, Round = Regulus.Utility.Random.Next(0, 3) } ; Func<bool>[] incs1 = { energy.IncGreen , energy.IncRed , energy.IncYellow }; incs1[Regulus.Utility.Random.Next(0, incs1.Length)](); incs1[Regulus.Utility.Random.Next(0, incs1.Length)](); Func<bool>[] incs2 = { energy.IncPower , ()=>{eg.Hp = 1; return true;} , ()=>{eg.Change = 1; return true;} }; incs2[Regulus.Utility.Random.Next(0, incs2.Length)](); _Groups[i] = eg ; } foreach (var capture in _Capturers) { capture.Player.OnSpawnCaptureEnergy(capture); capture.Initial(_Groups); capture.CaptureEvent += _OnCapture; } _Timeout = new Utility.TimeCounter(); }
public IEnumerator Start() { while (Application.isPlaying) { if (_Living == 1) { // Energy Create if (_Energy == null) { GameObject obj = GameObject.CreatePrimitive(PrimitiveType.Sphere); _Energy = obj.AddComponent<Energy>(); _Energy.Transform.position = Transform.position; } // Energy Available if (_Energy != null) _Energy.enabled = true; yield return new WaitForSeconds(Random.Range(_MinLife, _MaxLife)); // Energy UnAvailable if (_Energy != null) _Energy.enabled = false; yield return new WaitForSeconds(Random.Range(_MinWait, _MaxWait)); } else { if (_Energy != null) _Energy.enabled = false; yield return new WaitForSeconds(Random.Range(_MinWait, _MaxWait)); } } }
public static void Launch(Transform transform1, Energy energy) { var instance = GameObject.FindObjectOfType<PopupEnergyLauncher>(); if (instance != null) { instance._Launch(transform1 , energy); } }
public void OpAddition() { var energy1 = new Energy(2000, EnergyUnit.NewtonMeters); var energy2 = new Energy(2, EnergyUnit.Kilojoules); var expected = new Energy(4000, EnergyUnit.NewtonMeters); (energy1 + energy2).ShouldEqual(expected); (energy2 + energy1).ShouldEqual(expected); }
void Start() { desiredDirection = Quaternion.identity; walking = gameObject.GetComponent<Walking> (); rotating = gameObject.GetComponent<Rotating> (); shooting = gameObject.GetComponent<Shooting> (); swinging = gameObject.GetComponent<Swinging> (); energy = gameObject.GetComponent<Energy> (); }
public void OpDivision() { var energy1 = new Energy(2000, EnergyUnit.NewtonMeters); var energy2 = new Energy(2, EnergyUnit.Kilojoules); (energy1 / energy2).ShouldBeWithinEpsilonOf(1); (energy2 / energy1).ShouldBeWithinEpsilonOf(1); (energy1 / 2).ShouldEqual(new Energy(1000, EnergyUnit.NewtonMeters)); (energy2 / 2).ShouldEqual(new Energy(1, EnergyUnit.Kilojoules)); }
public void OpGreaterThanOrEqual() { var energy1 = new Energy(2000, EnergyUnit.NewtonMeters); var energy2 = new Energy(2, EnergyUnit.Kilojoules); var energy3 = new Energy(4000, EnergyUnit.Joules); (energy1 >= energy3).ShouldBeFalse(); (energy3 >= energy1).ShouldBeTrue(); (energy1 >= energy2).ShouldBeTrue(); (energy2 >= energy1).ShouldBeTrue(); }
public void OpInverseEquals() { var energy1 = new Energy(2000, EnergyUnit.NewtonMeters); var energy2 = new Energy(2, EnergyUnit.Kilojoules); var energy3 = new Energy(4000, EnergyUnit.Joules); (energy1 != energy2).ShouldBeFalse(); (energy2 != energy1).ShouldBeFalse(); (energy1 != energy3).ShouldBeTrue(); (energy3 != energy1).ShouldBeTrue(); }
private void _Launch(Transform transform1, Energy energy) { var screen = Camera.main.WorldToScreenPoint(transform1.position); GameObject prefab = _GetPrefab(energy.Type); var popup = GameObject.Instantiate(prefab); var rect = popup.GetComponent<RectTransform>(); rect.position = screen; rect.SetParent(Root); var text = popup.GetComponentInChildren<UnityEngine.UI.Text>(); text.text = energy.Value.ToString(); }
/// <summary> /// Initializes a new instance of the <see cref="Core.Models.Account"/> class. /// </summary> /// <param name="id">Account Identifier.</param> public Account(int id) : base() { ID = id; UserName = "******"; TerritoryBuildings = new Dictionary<PositionI, long>(); Buildings = new Dictionary<PositionI, long>(); Units = new LinkedList<PositionI>(); BuildableBuildings = new Dictionary<long, List<long>>(); Scrap = new Scrap(); Population = new Population(); Technology = new Technology(); Energy = new Energy(); Plutonium = new Plutonium(); }
public void OpEquals() { var energy1 = new Energy(2000, EnergyUnit.NewtonMeters); var energy2 = new Energy(2, EnergyUnit.Kilojoules); var energy3 = new Energy(4000, EnergyUnit.Joules); (energy1 == energy2).ShouldBeTrue(); (energy2 == energy1).ShouldBeTrue(); (energy1 == energy3).ShouldBeFalse(); (energy3 == energy1).ShouldBeFalse(); energy1.Equals(energy2) .ShouldBeTrue(); energy1.Equals((object)energy2) .ShouldBeTrue(); energy2.Equals(energy1) .ShouldBeTrue(); energy2.Equals((object)energy1) .ShouldBeTrue(); }
/// <inheritdoc cref="Energy.FromMegawattHours(double?)"/> public static Energy?MegawattHours(this double?value) => Energy.FromMegawattHours(value);
/// <inheritdoc cref="Energy.FromThermsEc(double)"/> public static Energy ThermsEc(this long value) => Energy.FromThermsEc(value);
void Start() { rectTransform = GetComponent<RectTransform>(); energyPlayer = Player.GetComponent<Energy>(); energyPlayer.OnDeath += Death; }
/// <inheritdoc cref="Energy.FromBritishThermalUnits(double)"/> public static Energy BritishThermalUnits(this decimal value) => Energy.FromBritishThermalUnits(Convert.ToDouble(value));
public void ToHorsepowerHoursTest() { Energy target = new Energy(10F); double expected = 0.0000037250613599861884; double actual; actual = target.ToHorsepowerHours(); Assert.AreEqual(expected, actual); }
public void EnergyConstructorTest() { List<Double> values = new List<Double>(); //Initialization values.Add(0); foreach (Double value in values) { Energy target = new Energy(value); Assert.IsInstanceOfType(target, typeof(Energy)); Assert.IsNotNull(target); } values.Clear(); }
/// <inheritdoc cref="Energy.FromBritishThermalUnits(double?)"/> public static Energy?BritishThermalUnits(this decimal?value) => Energy.FromBritishThermalUnits(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="Energy.FromWattHours(double)"/> public static Energy WattHours(this int value) => Energy.FromWattHours(value);
/// <inheritdoc cref="Energy.FromThermsUs(double)"/> public static Energy ThermsUs(this decimal value) => Energy.FromThermsUs(Convert.ToDouble(value));
/// <inheritdoc cref="Energy.FromThermsUs(double?)"/> public static Energy?ThermsUs(this decimal?value) => Energy.FromThermsUs(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="Energy.FromThermsUs(double?)"/> public static Energy?ThermsUs(this float?value) => Energy.FromThermsUs(value);
/// <inheritdoc cref="Energy.FromThermsUs(double?)"/> public static Energy?ThermsUs(this double?value) => Energy.FromThermsUs(value);
/// <inheritdoc cref="Energy.FromThermsUs(double?)"/> public static Energy?ThermsUs(this long?value) => Energy.FromThermsUs(value);
public void ToBarrelsOfOilTest() { Energy target = new Energy(10F); double expected = 0.0000000016339869281045752; double actual; actual = target.ToBarrelsOfOil(); Assert.AreEqual(expected, actual); }
/// <inheritdoc cref="Energy.FromWattHours(double?)"/> public static Energy?WattHours(this long?value) => Energy.FromWattHours(value);
public void ToCelsiusHeatUnitsTest() { Energy target = new Energy(10F); double expected = 0.0052656506684073175; double actual; actual = target.ToCelsiusHeatUnits(); Assert.AreEqual(expected, actual); }
/// <inheritdoc cref="Energy.FromWattHours(double?)"/> public static Energy?WattHours(this double?value) => Energy.FromWattHours(value);
public void ToStringProviderTest() { double value = 10F; Energy target = new Energy(value); IFormatProvider provider = null; string expected = value.ToString(); string actual; actual = target.ToString(provider); Assert.AreEqual(expected, actual); }
/// <inheritdoc cref="Energy.FromWattHours(double?)"/> public static Energy?WattHours(this float?value) => Energy.FromWattHours(value);
public void ToWattHoursTest() { Energy target = new Energy(10F); double expected = 0.0027777777777777779; double actual; actual = target.ToWattHours(); Assert.AreEqual(expected, actual); }
/// <inheritdoc cref="Energy.FromWattHours(double)"/> public static Energy WattHours(this decimal value) => Energy.FromWattHours(Convert.ToDouble(value));
// Use this for initialization void Start() { //getting the animator component anim = GetComponent<Animator>(); //finding the life bar lifeBar = transform.FindChild("Health").FindChild("lifeBar").GetComponent<Energy>(); }
/// <inheritdoc cref="Energy.FromWattHours(double?)"/> public static Energy?WattHours(this decimal?value) => Energy.FromWattHours(value == null ? (double?)null : Convert.ToDouble(value.Value));
/// <inheritdoc cref="Energy.FromThermsEc(double)"/> public static Energy ThermsEc(this double value) => Energy.FromThermsEc(value);
/// <inheritdoc cref="Energy.FromCalories(double)"/> public static Energy Calories(this int value) => Energy.FromCalories(value);
/// <inheritdoc cref="Energy.FromThermsEc(double?)"/> public static Energy?ThermsEc(this int?value) => Energy.FromThermsEc(value);
/// <inheritdoc cref="Energy.FromCalories(double?)"/> public static Energy?Calories(this long?value) => Energy.FromCalories(value);
/// <inheritdoc cref="Energy.FromMegawattHours(double?)"/> public static Energy?MegawattHours(this float?value) => Energy.FromMegawattHours(value);
/// <inheritdoc cref="Energy.FromCalories(double?)"/> public static Energy?Calories(this double?value) => Energy.FromCalories(value);
public void ToBTUTest() { Energy target = new Energy(10F); double expected = 0.0094781712031331723; double actual; actual = target.ToBTU(); Assert.AreEqual(expected, actual); }
public void Start() { energy = GetComponent <Energy>(); _guiText = GameObject.FindGameObjectWithTag("ShieldModeText").GetComponent <TextMeshPro>(); }
public void ToCaloriesTest() { Energy target = new Energy(10F); double expected = 2.3884589662749596; double actual; actual = target.ToCalories(); Assert.AreEqual(expected, actual); }
/// <inheritdoc cref="Energy.FromThermsImperial(double?)"/> public static Energy?ThermsImperial(this float?value) => Energy.FromThermsImperial(value);
public void ToCoulombsTest() { Energy target = new Energy(2F); Voltage volts = new Voltage(3F); Charge expected = new Charge(0.666666666666667); Charge actual; actual = target.ToCoulombs(volts); Assert.AreEqual(expected, actual); }
private Motorcycle CreateMotorcycle(string i_VehicleModel, string i_LicensePlate, string i_WheelManufacturer, Energy i_Engine, float i_CurentAirPreasure) { Wheel[] wheels = new Wheel[k_NumberOfWheelsForMotorcycle]; for (int i = 0; i < k_NumberOfWheelsForMotorcycle; i++) { wheels[i] = new Wheel(i_WheelManufacturer, k_MaximumAirPressureForMotorcycle); wheels[i].WheelInflation(i_CurentAirPreasure); } Motorcycle newMotorcycle = new Motorcycle(i_VehicleModel, i_LicensePlate, wheels, i_Engine); return(newMotorcycle); }
public void ToLitersAtmosphereTest() { Energy target = new Energy(10F); double expected = 0.098692326671601285; double actual; actual = target.ToLitersAtmosphere(); Assert.AreEqual(expected, actual); }
private Car CreateCar(string i_VehicleModel, string i_LicensePlate, string i_WheelManufacturer, Energy i_Engine, float i_CurentAirPreasure) { Wheel[] wheels = new Wheel[k_NumberOfWheelsForCar]; for (int i = 0; i < k_NumberOfWheelsForCar; i++) { wheels[i] = new Wheel(i_WheelManufacturer, k_MaximumAirPressureForCar); wheels[i].WheelInflation(i_CurentAirPreasure); } Car newCar = new Car(i_VehicleModel, i_LicensePlate, wheels, i_Engine); return(newCar); }
public void ToStringFormatTest() { double value = 10F; Energy target = new Energy(value); string format = string.Empty; string expected = value.ToString(); string actual; actual = target.ToString(format); Assert.AreEqual(expected, actual); }
/// <inheritdoc cref="Energy.FromThermsImperial(double?)"/> public static Energy?ThermsImperial(this double?value) => Energy.FromThermsImperial(value);
public void ToTonsOfCoalTest() { Energy target = new Energy(10F); double expected = 0.00000000034120842375356565; double actual; actual = target.ToTonsOfCoal(); Assert.AreEqual(expected, actual); }
/// <inheritdoc cref="Energy.FromThermsImperial(double)"/> public static Energy ThermsImperial(this long value) => Energy.FromThermsImperial(value);
public void TryParseResultTest() { double value = 10F; string s = value.ToString(); Energy result = new Energy(value); Energy resultExpected = new Energy(value); bool expected = true; bool actual; actual = Energy.TryParse(s, out result); Assert.AreEqual(resultExpected, result); Assert.AreEqual(expected, actual); }
/// <inheritdoc cref="Energy.FromBritishThermalUnits(double?)"/> public static Energy?BritishThermalUnits(this float?value) => Energy.FromBritishThermalUnits(value);
/// <summary>Creates a new <see cref="ChargeStep"/> instance with the specified max energy.</summary> public ChargeStep(Energy maxEnergy) : base() { Strategy = ChargingStrategy.Default; State = ChargingState.Planned; MaximumEnergy = maxEnergy; }
/// <inheritdoc cref="Energy.FromThermsEc(double)"/> public static Energy ThermsEc(this float value) => Energy.FromThermsEc(value);
public Player() { Energy = new Crystal.Energy(7); Hp = 100; }
/// <inheritdoc cref="Energy.FromThermsUs(double)"/> public static Energy ThermsUs(this int value) => Energy.FromThermsUs(value);