internal static void Prefix(GearItem gi, ref bool __result) { if (gi == null) { return; } LiquidItem liquidItem = gi.m_LiquidItem; if (liquidItem == null || liquidItem.m_LiquidType != GearLiquidTypeEnum.Water) { return; } WaterSupply waterSupply = liquidItem.GetComponent <WaterSupply>(); if (waterSupply == null) { waterSupply = liquidItem.gameObject.AddComponent <WaterSupply>(); gi.m_WaterSupply = waterSupply; } waterSupply.m_VolumeInLiters = liquidItem.m_LiquidLiters; waterSupply.m_WaterQuality = liquidItem.m_LiquidQuality; waterSupply.m_TimeToDrinkSeconds = liquidItem.m_TimeToDrinkSeconds; waterSupply.m_DrinkingAudio = liquidItem.m_DrinkingAudio; }
public void SimpleFlowArrives() { var supply = new WaterSupply(); var pump = new Pump(); var drain = new Drain(); var combinator = new DialyzingFluidFlowCombinator(); pump.PumpSpeed = 7; combinator.ConnectOutWithIn(supply.MainFlow,pump.MainFlow); combinator.ConnectOutWithIn(pump.MainFlow, drain.MainFlow); combinator.CommitFlow(); var model = new DialyzingFluidFlowModel { FlowElements = new IComponent[] { supply, pump, drain, combinator } }; var simulator = new Simulator(model); //Important: Call after all objects have been created simulator.SimulateStep(); var modelAfterStep = (DialyzingFluidFlowModel) simulator.Model; var supplyAfterStep = (WaterSupply)modelAfterStep.Components[0]; var pumpAfterStep = (Pump)modelAfterStep.Components[1]; var drainAfterStep = (Drain)modelAfterStep.Components[2]; pumpAfterStep.MainFlow.Incoming.Backward.CustomSuctionValue.Should().Be(7); supplyAfterStep.MainFlow.Outgoing.Forward.Quantity.Should().Be(7); drainAfterStep.MainFlow.Incoming.Forward.Quantity.Should().Be(7); }
internal static void Prefix(ref GearItem gi, float volumeAvailable, ref bool __result) { //Added for replacing transpiler patch: //ref to gi //float volumeAvailable //this if clause if (UpdateInspectGearTracker.isExecuting && volumeAvailable > 0f) { gi = GameManager.GetPlayerManagerComponent().m_Gear; } if (!WaterUtils.IsWaterItem(gi)) { return; } LiquidItem liquidItem = gi.m_LiquidItem; WaterSupply waterSupply = liquidItem.GetComponent <WaterSupply>(); if (waterSupply == null) { waterSupply = liquidItem.gameObject.AddComponent <WaterSupply>(); gi.m_WaterSupply = waterSupply; } waterSupply.m_VolumeInLiters = liquidItem.m_LiquidLiters; waterSupply.m_WaterQuality = liquidItem.m_LiquidQuality; waterSupply.m_TimeToDrinkSeconds = liquidItem.m_TimeToDrinkSeconds; waterSupply.m_DrinkingAudio = liquidItem.m_DrinkingAudio; }
//--------------------------------------------------------------------------------------------------------- /// <summary> /// Объединение данных /// </summary> /// <param name="engineering_infrastructure">Инженерная инфраструктура</param> //--------------------------------------------------------------------------------------------------------- public void Union(CEngineeringInfrastructure engineering_infrastructure) { WaterSupply.Union(engineering_infrastructure.WaterSupply); PowerSupply.Union(engineering_infrastructure.PowerSupply); GasSupply.Union(engineering_infrastructure.GasSupply); HeatSupply.Union(engineering_infrastructure.HeatSupply); }
public void SimpleFlowArrives() { var supply = new WaterSupply(); var pump = new Pump(); var drain = new Drain(); var combinator = new DialyzingFluidFlowCombinator(); pump.PumpSpeed = 7; combinator.ConnectOutWithIn(supply.MainFlow, pump.MainFlow); combinator.ConnectOutWithIn(pump.MainFlow, drain.MainFlow); combinator.CommitFlow(); var model = new DialyzingFluidFlowModel { FlowElements = new IComponent[] { supply, pump, drain, combinator } }; var simulator = new SafetySharpSimulator(model); //Important: Call after all objects have been created simulator.SimulateStep(); var modelAfterStep = (DialyzingFluidFlowModel)simulator.Model; var supplyAfterStep = (WaterSupply)modelAfterStep.Components[0]; var pumpAfterStep = (Pump)modelAfterStep.Components[1]; var drainAfterStep = (Drain)modelAfterStep.Components[2]; pumpAfterStep.MainFlow.Incoming.Backward.CustomSuctionValue.Should().Be(7); supplyAfterStep.MainFlow.Outgoing.Forward.Quantity.Should().Be(7); drainAfterStep.MainFlow.Incoming.Forward.Quantity.Should().Be(7); }
internal static bool Prefix(CookingPotItem __instance) { if (__instance.GetCookingState() == CookingPotItem.CookingState.Cooking) { return(true); } float waterAmount = WaterUtils.GetWaterAmount(__instance); if (waterAmount <= 0) { return(true); } bool potable = __instance.GetCookingState() == CookingPotItem.CookingState.Ready; GearItem gearItem = __instance.GetComponent <GearItem>(); WaterSupply waterSupply = gearItem.m_WaterSupply; if (waterSupply == null) { waterSupply = gearItem.gameObject.AddComponent <WaterSupply>(); gearItem.m_WaterSupply = waterSupply; } waterSupply.m_VolumeInLiters = waterAmount; waterSupply.m_WaterQuality = potable ? LiquidQuality.Potable : LiquidQuality.NonPotable; waterSupply.m_TimeToDrinkSeconds = GameManager.GetInventoryComponent().GetPotableWaterSupply().m_WaterSupply.m_TimeToDrinkSeconds; waterSupply.m_DrinkingAudio = GameManager.GetInventoryComponent().GetPotableWaterSupply().m_WaterSupply.m_DrinkingAudio; GameManager.GetPlayerManagerComponent().UseInventoryItem(gearItem); return(false); }
/// <summary> /// Method to send a notification informing the player that water has been lost /// </summary> /// <param name="waterSupply">The water supply the water was lost from</param> /// <param name="name">The localization key for potable or nonpotable water</param> /// <param name="amount">The amount of water lost in liters</param> internal static void ShowLostMessage(WaterSupply waterSupply, string name, float amount) { GearMessage.AddMessage( waterSupply.name, Localization.Get("GAMEPLAY_BWM_Lost"), " " + Localization.Get(name) + " (" + Utils.GetLiquidQuantityStringWithUnitsNoOunces(InterfaceManager.m_Panel_OptionsMenu.m_State.m_Units, amount) + ")", Color.red, false); }
private static System.Collections.IEnumerator DelayedLostMessage(WaterSupply waterSupply, string name, float amount) { yield return(new WaitForSeconds(1f)); GearMessage.AddMessage( waterSupply.name, Localization.Get("GAMEPLAY_Lost"), " " + Localization.Get(name) + " (" + Utils.GetLiquidQuantityStringWithUnitsNoOunces(InterfaceManager.m_Panel_OptionsMenu.m_State.m_Units, amount) + ")", Color.red, false); }
internal static void Postfix(WaterSupply ws, bool __result) { if (GameManager.GetThirstComponent().IsAddingThirstOverTime()) { return; } LiquidItem liquidItem = ws.GetComponent <LiquidItem>(); if (liquidItem == null) { return; } liquidItem.m_LiquidLiters = ws.m_VolumeInLiters; Object.Destroy(ws); liquidItem.GetComponent <GearItem>().m_WaterSupply = null; }
public static void ClampAmount(Panel_PickWater panel) { WaterSupply waterSupply = AccessTools.Field(panel.GetType(), "m_WaterSupplyInventory").GetValue(panel) as WaterSupply; if (!waterSupply) { Debug.LogError("Could not find WaterSupply to transfer to"); return; } float limit = Water.GetRemainingCapacity(waterSupply.m_WaterQuality) + Water.GetRemainingCapacityEmpty(); panel.m_numLiters = Mathf.Clamp(panel.m_numLiters, 0, limit); panel.m_maxLiters = Mathf.Clamp(panel.m_maxLiters, 0, limit); AccessTools.Method(panel.GetType(), "Refresh").Invoke(panel, null); labelNoCapacityWarning.gameObject.SetActive(limit == 0); }
public void GivenWaterQuantityGreaterThan0_ReturnValidWaterSupply() { #region Arrange var qty = 4; #endregion #region Act var result = WaterSupply.Create(qty); var waterSupply = result.Value; #endregion #region Assert waterSupply.Value.Should().Be(qty); #endregion }
private static void OnDumpFinished(bool success, bool playerCancel, float progress) { //MelonLoader.MelonLogger.Log("Dump Finished"); LiquidItem liquidItem = WaterButtons.currentLiquidItemShowing; float lostLiters = liquidItem.m_LiquidLiters * progress; if (liquidItem.m_LiquidQuality == LiquidQuality.Potable) // Potable water { WaterSupply potableWaterSupply = GameManager.GetInventoryComponent().GetPotableWaterSupply().m_WaterSupply; Water.ShowLostMessage(potableWaterSupply, "GAMEPLAY_WaterPotable", lostLiters); } else // NonPotable water { WaterSupply nonPotableWaterSupply = GameManager.GetInventoryComponent().GetNonPotableWaterSupply().m_WaterSupply; Water.ShowLostMessage(nonPotableWaterSupply, "GAMEPLAY_WaterUnsafe", lostLiters); } // Remove water and adjust the water supply. liquidItem.m_LiquidLiters = Mathf.Max(liquidItem.m_LiquidLiters - lostLiters, 0); Water.AdjustWaterSupplyToWater(); }
internal static void Postfix(PlayerManager __instance, float progress) { //WaterSupply waterSupply = AccessTools.Field(__instance.GetType(), "m_WaterSourceToDrinkFrom").GetValue(__instance) as WaterSupply; WaterSupply waterSupply = __instance.m_WaterSourceToDrinkFrom; if (waterSupply == null) { return; } GearItem gearItem = waterSupply.GetComponent <GearItem>(); if (gearItem.m_LiquidItem != null) { gearItem.m_LiquidItem.m_LiquidLiters = waterSupply.m_VolumeInLiters; Object.Destroy(waterSupply); gearItem.m_WaterSupply = null; } if (gearItem.m_CookingPotItem != null) { if (!WaterUtils.IsCooledDown(gearItem.m_CookingPotItem)) { //GameManager.GetPlayerManagerComponent().ApplyFreezingBuff(20 * progress, 0.5f, 1 * progress); GameManager.GetPlayerManagerComponent().ApplyFreezingBuff(20 * progress, 0.5f, 1 * progress, 24f); PlayerDamageEvent.SpawnAfflictionEvent("GAMEPLAY_WarmingUp", "GAMEPLAY_BuffHeader", "ico_injury_warmingUp", InterfaceManager.m_Panel_ActionsRadial.m_FirstAidBuffColor); } WaterUtils.SetWaterAmount(gearItem.m_CookingPotItem, waterSupply.m_VolumeInLiters); Object.Destroy(waterSupply); } if (waterSupply is WaterSourceSupply) { WaterSourceSupply waterSourceSupply = waterSupply as WaterSourceSupply; waterSourceSupply.UpdateWaterSource(); } Water.AdjustWaterSupplyToWater(); }
public void Given0WaterQuantity_ThrowInvalidOperationException() { #region Arrange var qty = 0; #endregion #region Act var waterSupplyOrError = WaterSupply.Create(qty); #endregion #region Assert waterSupplyOrError.Invoking(x => x.Value) .Should() .NotThrow <InvalidOperationException>(); #endregion }
internal static void Postfix(PlayerManager __instance) { WaterSupply waterSupply = AccessTools.Field(__instance.GetType(), "m_WaterSourceToDrinkFrom").GetValue(__instance) as WaterSupply; if (waterSupply == null) { return; } LiquidItem liquidItem = waterSupply.GetComponent <LiquidItem>(); if (liquidItem == null) { return; } liquidItem.m_LiquidLiters = waterSupply.m_VolumeInLiters; UnityEngine.Object.Destroy(waterSupply); liquidItem.GetComponent <GearItem>().m_WaterSupply = null; Water.AdjustWaterSupplyToWater(); }
public void GivenNegativeWaterQuantity_ThrowInvalidOperationException() { #region Arrange var qty = -88; #endregion #region Act var waterSupplyOrError = WaterSupply.Create(qty); #endregion #region Assert waterSupplyOrError.Invoking(x => x.Value) .Should() .Throw <InvalidOperationException>() .WithMessage("Water supply cannot be negative"); #endregion }
internal static void OnDrink() { float waterAmount = cookingPot.m_LitersWaterBeingBoiled; waterVolumeToDrink = GameManager.GetPlayerManagerComponent().CalculateWaterVolumeToDrink(waterAmount); gearItem = cookingPot.GetComponent <GearItem>(); waterSupply = gearItem.m_WaterSupply; if (waterSupply == null) { waterSupply = gearItem.gameObject.AddComponent <WaterSupply>(); gearItem.m_WaterSupply = waterSupply; } waterSupply.m_VolumeInLiters = waterAmount; bool potable = cookingPot.GetCookingState() == CookingPotItem.CookingState.Ready; waterSupply.m_WaterQuality = potable ? LiquidQuality.Potable : LiquidQuality.NonPotable; waterSupply.m_TimeToDrinkSeconds = GameManager.GetInventoryComponent().GetPotableWaterSupply().m_WaterSupply.m_TimeToDrinkSeconds; waterSupply.m_DrinkingAudio = GameManager.GetInventoryComponent().GetPotableWaterSupply().m_WaterSupply.m_DrinkingAudio; GameManager.GetThirstComponent().AddThirstOverTime(waterVolumeToDrink, waterSupply.m_TimeToDrinkSeconds); InterfaceManager.m_Panel_GenericProgressBar.Launch(Localization.Get("GAMEPLAY_DrinkingProgress"), waterSupply.m_TimeToDrinkSeconds, 0f, 0f, null, waterSupply.m_DrinkingAudio, true, false, new System.Action <bool, bool, float>(OnDrinkComplete)); GameManager.GetPlayerVoiceComponent().BlockNonCriticalVoiceForDuration(waterSupply.m_TimeToDrinkSeconds + 2f); }
internal static void Postfix(PlayerManager __instance, float progress) { WaterSupply waterSupply = AccessTools.Field(__instance.GetType(), "m_WaterSourceToDrinkFrom").GetValue(__instance) as WaterSupply; if (waterSupply == null) { return; } GearItem gearItem = waterSupply.GetComponent <GearItem>(); if (gearItem.m_LiquidItem != null) { gearItem.m_LiquidItem.m_LiquidLiters = waterSupply.m_VolumeInLiters; Object.Destroy(waterSupply); gearItem.m_WaterSupply = null; } if (gearItem.m_CookingPotItem != null) { if (!WaterUtils.IsCooledDown(gearItem.m_CookingPotItem)) { GameManager.GetPlayerManagerComponent().ApplyFreezingBuff(20 * progress, 0.5f, 1 * progress, 1); InterfaceManager.m_Panel_HUD.ShowBuffNotification("GAMEPLAY_WarmingUp", "GAMEPLAY_BuffHeader", InterfaceManager.m_Panel_HUD.m_BuffSpriteFreezingBuff); } WaterUtils.SetWaterAmount(gearItem.m_CookingPotItem, waterSupply.m_VolumeInLiters); Object.Destroy(waterSupply); } if (waterSupply is WaterSourceSupply waterSourceSupply) { waterSourceSupply.UpdateWaterSource(); } Water.AdjustWaterSupplyToWater(); }
internal static bool Prefix(WaterSupply ws, ref bool __result) { //Implementation.Log("Panel_Container -- IgnoreWaterSupplyItem"); __result = ws != null && ws.GetComponent <LiquidItem>() == null; //the water supply exists but has no liquid component return(false); }
public bool IsPossibleToDeleteWaterSupply(WaterSupply entity) { return(true); }
private static void AddDicitonaryValue(bool addRealEstate = false) { var dealVariantEntityNew = new DealVariant("dealVariant1"); if (dealVariantService.IsValid(dealVariantEntityNew)) { dealVariantService.Save(dealVariantEntityNew); } var dealVariantEntityNew2 = new DealVariant("dealVariant2"); if (dealVariantService.IsValid(dealVariantEntityNew2)) { dealVariantService.Save(dealVariantEntityNew2); } var dealVariantEntityNew3 = new DealVariant("dealVariant2"); if (dealVariantService.IsValid(dealVariantEntityNew3)) { dealVariantService.Save(dealVariantEntityNew3); } var districtEntityNew = new District("district1"); if (districtService.IsValid(districtEntityNew)) { districtService.Save(districtEntityNew); } var districtEntityNew2 = new District("district2"); if (districtService.IsValid(districtEntityNew2)) { districtService.Save(districtEntityNew2); } var districtEntityNew3 = new District("district2"); if (districtService.IsValid(districtEntityNew3)) { districtService.Save(districtEntityNew3); } var floorLevelEntityNew = new FloorLevel("floorLevel1"); if (floorLevelService.IsValid(floorLevelEntityNew)) { floorLevelService.Save(floorLevelEntityNew); } var floorLevelEntityNew2 = new FloorLevel("floorLevel2"); if (floorLevelService.IsValid(floorLevelEntityNew2)) { floorLevelService.Save(floorLevelEntityNew2); } var floorLevelEntityNew3 = new FloorLevel("floorLevel2"); if (floorLevelService.IsValid(floorLevelEntityNew3)) { floorLevelService.Save(floorLevelEntityNew3); } var layoutEntityNew = new Layout("layout1"); if (layoutService.IsValid(layoutEntityNew)) { layoutService.Save(layoutEntityNew); } var layoutEntityNew2 = new Layout("layout2"); if (layoutService.IsValid(layoutEntityNew2)) { layoutService.Save(layoutEntityNew2); } var layoutEntityNew3 = new Layout("layout2"); if (layoutService.IsValid(layoutEntityNew3)) { layoutService.Save(layoutEntityNew3); } var materialEntityNew = new Material("material1"); if (materialService.IsValid(materialEntityNew)) { materialService.Save(materialEntityNew); } var materialEntityNew2 = new Material("material2"); if (materialService.IsValid(materialEntityNew2)) { materialService.Save(materialEntityNew2); } var materialEntityNew3 = new Material("material2"); if (materialService.IsValid(materialEntityNew3)) { materialService.Save(materialEntityNew3); } var ownershipEntityNew = new Ownership("ownership1"); if (ownershipService.IsValid(ownershipEntityNew)) { ownershipService.Save(ownershipEntityNew); } var ownershipEntityNew2 = new Ownership("ownership2"); if (ownershipService.IsValid(ownershipEntityNew2)) { ownershipService.Save(ownershipEntityNew2); } var ownershipEntityNew3 = new Ownership("ownership2"); if (ownershipService.IsValid(ownershipEntityNew3)) { ownershipService.Save(ownershipEntityNew3); } var realtorEntityNew = new Realtor("realtor1", "phone"); if (realtorService.IsValid(realtorEntityNew)) { realtorService.Save(realtorEntityNew); } var realtorEntityNew2 = new Realtor("realtor2", "phone"); if (realtorService.IsValid(realtorEntityNew2)) { realtorService.Save(realtorEntityNew2); } var realtorEntityNew3 = new Realtor("realtor2", "phone"); if (realtorService.IsValid(realtorEntityNew3)) { realtorService.Save(realtorEntityNew3); } var sewageEntityNew = new Sewage("sewage1"); if (sewageService.IsValid(sewageEntityNew)) { sewageService.Save(sewageEntityNew); } var sewageEntityNew2 = new Sewage("sewage2"); if (sewageService.IsValid(sewageEntityNew2)) { sewageService.Save(sewageEntityNew2); } var sewageEntityNew3 = new Sewage("sewage2"); if (sewageService.IsValid(sewageEntityNew3)) { sewageService.Save(sewageEntityNew3); } var streetEntityNew = new Street("street1"); if (streetService.IsValid(streetEntityNew)) { districtEntityNew.AddStreet(streetEntityNew); districtService.Save(districtEntityNew); } var streetEntityNew1 = new Street("street11"); if (streetService.IsValid(streetEntityNew1)) { districtEntityNew.AddStreet(streetEntityNew1); districtService.Save(districtEntityNew); } var streetEntityNew2 = new Street("street2"); if (streetService.IsValid(streetEntityNew2)) { districtEntityNew2.AddStreet(streetEntityNew2); streetService.Save(streetEntityNew); } var streetEntityNew3 = new Street("street2"); if (streetService.IsValid(streetEntityNew3)) { Debug.Assert(false, "Не должан была пройти валидация."); } var terraceEntityNew = new Terrace("terrace1"); if (terraceService.IsValid(terraceEntityNew)) { terraceService.Save(terraceEntityNew); } var terraceEntityNew2 = new Terrace("terrace2"); if (terraceService.IsValid(terraceEntityNew2)) { terraceService.Save(terraceEntityNew2); } var terraceEntityNew3 = new Terrace("terrace2"); if (terraceService.IsValid(terraceEntityNew3)) { terraceService.Save(terraceEntityNew3); } var toiletTypeEntityNew = new ToiletType("toiletType1"); if (toiletTypeService.IsValid(toiletTypeEntityNew)) { toiletTypeService.Save(toiletTypeEntityNew); } var toiletTypeEntityNew2 = new ToiletType("toiletType2"); if (toiletTypeService.IsValid(toiletTypeEntityNew2)) { toiletTypeService.Save(toiletTypeEntityNew2); } var toiletTypeEntityNew3 = new ToiletType("toiletType2"); if (toiletTypeService.IsValid(toiletTypeEntityNew3)) { toiletTypeService.Save(toiletTypeEntityNew3); } var waterSupplyEntityNew = new WaterSupply("waterSupply1"); if (waterSupplyService.IsValid(waterSupplyEntityNew)) { waterSupplyService.Save(waterSupplyEntityNew); } var waterSupplyEntityNew2 = new WaterSupply("waterSupply2"); if (waterSupplyService.IsValid(waterSupplyEntityNew2)) { waterSupplyService.Save(waterSupplyEntityNew2); } var waterSupplyEntityNew3 = new WaterSupply("waterSupply2"); if (waterSupplyService.IsValid(waterSupplyEntityNew3)) { waterSupplyService.Save(waterSupplyEntityNew3); } if (!addRealEstate) { return; } var flat = new Flat { DealVariant = dealVariantEntityNew, Description = "decr", District = districtEntityNew, Floor = 3, FloorLevel = floorLevelEntityNew, HasVideo = true, KitchenSquare = 32, Layout = layoutEntityNew, Material = materialEntityNew, Ownership = ownershipEntityNew, Price = 32323, Realtor = realtorEntityNew, ResidentialSquare = 323, Street = streetEntityNew, SubmitToDomino = false, SubmitToVDV = true, Terrace = terraceEntityNew, TerritorialNumber = "32a", ToiletType = toiletTypeEntityNew, TotalFloor = 32, TotalRoomCount = 5, TotalSquare = 323 }; if (flatService.IsValid(flat)) { flatService.Save(flat); } var room = new Room { DealVariant = dealVariantEntityNew, Description = "decr", District = districtEntityNew, Floor = 3, FloorLevel = floorLevelEntityNew, HasVideo = true, Layout = layoutEntityNew, Material = materialEntityNew, Ownership = ownershipEntityNew, Price = 32323, Realtor = realtorEntityNew, Street = streetEntityNew, SubmitToDomino = false, SubmitToVDV = true, Terrace = terraceEntityNew, TerritorialNumber = "32a", TotalFloor = 32, TotalRoomCount = 5, TotalSquare = 323, RoomCount = 2 }; if (roomService.IsValid(room)) { roomService.Save(room); } var residence = new Residence { DealVariant = dealVariantEntityNew, Description = "decr", District = districtEntityNew, Floor = 3, HasVideo = true, Material = materialEntityNew, Ownership = ownershipEntityNew, Price = 32323, Realtor = realtorEntityNew, Street = streetEntityNew, SubmitToDomino = false, SubmitToVDV = true, TerritorialNumber = "32a", TotalFloor = 32, TotalSquare = 323 }; if (residenceService.IsValid(residence)) { residenceService.Save(residence); } var house = new House { DealVariant = dealVariantEntityNew, Description = "decr", District = districtEntityNew, HasVideo = true, Material = materialEntityNew, Ownership = ownershipEntityNew, Price = 32323, Realtor = realtorEntityNew, Street = streetEntityNew, SubmitToDomino = false, SubmitToVDV = true, TerritorialNumber = "32a", TotalFloor = 32, HasBathhouse = true, HasGarage = true, HasGas = true, HouseSquare = 342, PlotSquare = 123, Sewage = sewageEntityNew, WaterSupply = waterSupplyEntityNew }; if (houseService.IsValid(house)) { houseService.Save(house); } var plot = new Plot { DealVariant = dealVariantEntityNew, Description = "decr", District = districtEntityNew, HasVideo = true, Ownership = ownershipEntityNew, Price = 32323, Realtor = realtorEntityNew, Street = streetEntityNew, SubmitToDomino = false, SubmitToVDV = true, TerritorialNumber = "32a", PlotSquare = 123 }; if (plotService.IsValid(plot)) { plotService.Save(plot); } }
public static void Prefix(ref WaterSupply ws) { Debug.LogFormat("PlayerManager::DrinkFromWaterSupply"); ws.m_TimeToDrinkSeconds = actionTime; lastAction = FasterGenericAction.DRINK; }
internal static bool Prefix(WaterSupply ws, ref bool __result) { __result = ws != null && ws.GetComponent <LiquidItem>() == null; //the water supply exists but has no liquid component return(false); }
public InMemoryRunData() { runs = new List <Run>() { new Run { Date = new DateTime(2020, 3, 26), Distance = RunDistance.Create(7.36).Value, Type = RunType.Trail, RunTemperature = new RunTemperature(5), RunWindSpeed = RunWindSpeed.Create(9).Value, Clothes = new Clothes("thin sweater, tight sweater, tight shirt, shorts"), Gear = new Gear(WaterSupply.Create(4.0).Value, new FoodBag { Items = new List <FoodItem> { new FoodItem("guu", 2), new FoodItem("peanut butter sandwich", 1) } }), SatisfactionLevel = SatisfactionLevel.Medium, Notes = new Notes("Great run!") }, new Run { Date = new DateTime(2020, 4, 6), Distance = RunDistance.Create(8.36).Value, Type = RunType.Road, RunTemperature = new RunTemperature(13), RunWindSpeed = RunWindSpeed.Create(16).Value, Clothes = new Clothes("tight shirt, shorts"), Gear = new Gear(WaterSupply.Create(2.0).Value, new FoodBag { Items = new List <FoodItem> { new FoodItem("guu", 2), new FoodItem("peanut butter sandwich", 1) } }), SatisfactionLevel = SatisfactionLevel.Hard, Notes = new Notes("Ok run!") }, new Run { Date = new DateTime(2020, 5, 6), Distance = RunDistance.Create(8.36).Value, Type = RunType.Road, RunTemperature = new RunTemperature(13), RunWindSpeed = RunWindSpeed.Create(16).Value, Clothes = new Clothes("tight shirt, shorts"), Gear = new Gear(WaterSupply.Create(2.0).Value, new FoodBag { Items = new List <FoodItem> { new FoodItem("guu", 2), new FoodItem("peanut butter sandwich", 1) } }), SatisfactionLevel = SatisfactionLevel.Hard, Notes = new Notes("Horrible run") } }; }
//Waits 1 second before showing private static System.Collections.IEnumerator DelayedLostMessage(WaterSupply waterSupply, string name, float amount) { yield return(new WaitForSeconds(1f)); ShowLostMessage(waterSupply, name, amount); }
private static void SendDelayedLostMessage(WaterSupply waterSupply, string name, float amount) { GameManager.Instance().StartCoroutine(DelayedLostMessage(waterSupply, name, amount)); }
internal static bool Prefix(WaterSupply ws, ref bool __result) { __result = ws != null && ws.GetComponent <LiquidItem>() == null; return(false); }