From fec177f4ab7204308e03708fc7db9687648c8545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9=20=D0=A5=D0=B8?= =?UTF-8?q?=D0=BC=D0=B8=D1=87?= <30412223+Kiuh@users.noreply.github.com> Date: Mon, 1 Jan 2024 16:57:39 +0300 Subject: [PATCH] Revert "Apply formatting" This reverts commit ee06a8420c770a1c27f5251bc01420ba92f6a8a8. --- JamGame/Assets/Scripts/Common/DebugTools.cs | 4 +--- .../Scripts/Employee/Controller/Controller.cs | 2 +- .../Scripts/Employee/ExtendedInfoView.cs | 8 ++++---- .../Assets/Scripts/Level/Boss/TaskListView.cs | 2 +- JamGame/Assets/Scripts/Level/Boss/TaskView.cs | 16 ++++++++------- .../Scripts/Level/Config/InventoryRoom.cs | 2 +- .../Assets/Scripts/Level/DurationCounter.cs | 5 ++++- .../Scripts/Level/Inventory/Controller.cs | 4 ++-- .../Assets/Scripts/Level/Inventory/Model.cs | 4 ++-- .../Assets/Scripts/Level/Inventory/View.cs | 6 +++--- .../Assets/Scripts/Level/Shop/Controller.cs | 6 +++--- JamGame/Assets/Scripts/Level/Shop/Model.cs | 4 ++-- JamGame/Assets/Scripts/Level/Shop/View.cs | 6 +++--- .../Assets/Scripts/Location/LocationImpl.cs | 13 +++++------- .../Assets/Scripts/Location/NeedProvider.cs | 2 +- .../Scripts/Overlay/ExtendedInfoView.cs | 10 +++++----- JamGame/Assets/Scripts/TileBuilder/Command.cs | 2 +- .../TileBuilder/Controller/ControllerImpl.cs | 4 ++-- .../TileBuilder/Controller/Inspector.cs | 4 +--- .../Scripts/TileBuilder/TileBuilderImpl.cs | 6 +++--- .../Assets/Scripts/TileBuilder/Validator.cs | 20 +++++++++---------- .../Scripts/Utils/AnimatorTimeScaleSetter.cs | 1 + 22 files changed, 65 insertions(+), 66 deletions(-) diff --git a/JamGame/Assets/Scripts/Common/DebugTools.cs b/JamGame/Assets/Scripts/Common/DebugTools.cs index af340e88..6c203df9 100644 --- a/JamGame/Assets/Scripts/Common/DebugTools.cs +++ b/JamGame/Assets/Scripts/Common/DebugTools.cs @@ -8,9 +8,7 @@ public static class DebugTools { public static void LogCollection(IEnumerable collection) { - Debug.Log( - collection.Select(x => x.ToString()).Aggregate("[ ", (x, y) => x + ", " + y) + " ]" - ); + Debug.Log(collection.Select(x => x.ToString()).Aggregate("[ ", (x, y) => x + ", " + y) + " ]"); } } } diff --git a/JamGame/Assets/Scripts/Employee/Controller/Controller.cs b/JamGame/Assets/Scripts/Employee/Controller/Controller.cs index 227a7dd5..72c98273 100644 --- a/JamGame/Assets/Scripts/Employee/Controller/Controller.cs +++ b/JamGame/Assets/Scripts/Employee/Controller/Controller.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using Location; +using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; diff --git a/JamGame/Assets/Scripts/Employee/ExtendedInfoView.cs b/JamGame/Assets/Scripts/Employee/ExtendedInfoView.cs index 12a292c0..3a8fe9db 100644 --- a/JamGame/Assets/Scripts/Employee/ExtendedInfoView.cs +++ b/JamGame/Assets/Scripts/Employee/ExtendedInfoView.cs @@ -28,11 +28,11 @@ private void Update() { transform.LookAt(cam.transform.position); - string buffs = employee - .Buffs.Select(buff => buff.Name) + string buffs = employee.Buffs + .Select(buff => buff.Name) .Aggregate("", (x, y) => x + (x.Length == 0 ? "" : ", ") + y); - string quirks = personality - .Quirks.Select(quirk => quirk.Name) + string quirks = personality.Quirks + .Select(quirk => quirk.Name) .Aggregate("", (x, y) => x + (x.Length == 0 ? "" : ", ") + y); text.text = $"{personality.Name}\n{buffs}\n{quirks}"; diff --git a/JamGame/Assets/Scripts/Level/Boss/TaskListView.cs b/JamGame/Assets/Scripts/Level/Boss/TaskListView.cs index 5f07aad4..533c4a3c 100644 --- a/JamGame/Assets/Scripts/Level/Boss/TaskListView.cs +++ b/JamGame/Assets/Scripts/Level/Boss/TaskListView.cs @@ -1,7 +1,7 @@ +using Level.Boss.Task; using System; using System.Collections.Generic; using System.Collections.Specialized; -using Level.Boss.Task; using UnityEngine; namespace Level.Boss diff --git a/JamGame/Assets/Scripts/Level/Boss/TaskView.cs b/JamGame/Assets/Scripts/Level/Boss/TaskView.cs index 2136adaa..5e5e5575 100644 --- a/JamGame/Assets/Scripts/Level/Boss/TaskView.cs +++ b/JamGame/Assets/Scripts/Level/Boss/TaskView.cs @@ -1,5 +1,5 @@ -using System; using Level.Boss.Task; +using System; using TMPro; using UnityEngine; @@ -34,12 +34,14 @@ private void UpdateFromTask() description.text = task switch { - TargetEmployeeAmount => $"Hire at least {progress.Overall} employees", - MaxStressBound task - => $"Hold maximum stress of employees less than {task.MaxStressTarget} for {progress.Overall} seconds", - TargetRoomCount task => $"Build at least {progress.Overall} [{task.RoomTitle}]s", - RoomCountUpperBound task - => $"Have at most {task.UpperBoundInclusive} [{task.RoomTitle}]s for {progress.Overall} days", + TargetEmployeeAmount => + $"Hire at least {progress.Overall} employees", + MaxStressBound task => + $"Hold maximum stress of employees less than {task.MaxStressTarget} for {progress.Overall} seconds", + TargetRoomCount task => + $"Build at least {progress.Overall} [{task.RoomTitle}]s", + RoomCountUpperBound task => + $"Have at most {task.UpperBoundInclusive} [{task.RoomTitle}]s for {progress.Overall} days", _ => throw new NotImplementedException("This task type is not supported") }; } diff --git a/JamGame/Assets/Scripts/Level/Config/InventoryRoom.cs b/JamGame/Assets/Scripts/Level/Config/InventoryRoom.cs index 9582b526..70e13859 100644 --- a/JamGame/Assets/Scripts/Level/Config/InventoryRoom.cs +++ b/JamGame/Assets/Scripts/Level/Config/InventoryRoom.cs @@ -1,5 +1,5 @@ -using System; using Level.Room; +using System; namespace Level.Config { diff --git a/JamGame/Assets/Scripts/Level/DurationCounter.cs b/JamGame/Assets/Scripts/Level/DurationCounter.cs index c2f3f7ee..795b83c3 100644 --- a/JamGame/Assets/Scripts/Level/DurationCounter.cs +++ b/JamGame/Assets/Scripts/Level/DurationCounter.cs @@ -24,7 +24,10 @@ public void DayEnds() public DaysLived GetData() { - return new DaysLived() { Value = daysLived }; + return new DaysLived() + { + Value = daysLived + }; } } } diff --git a/JamGame/Assets/Scripts/Level/Inventory/Controller.cs b/JamGame/Assets/Scripts/Level/Inventory/Controller.cs index c441d0aa..994befd9 100644 --- a/JamGame/Assets/Scripts/Level/Inventory/Controller.cs +++ b/JamGame/Assets/Scripts/Level/Inventory/Controller.cs @@ -1,6 +1,6 @@ -using System.Linq; -using Common; +using Common; using Level.Room; +using System.Linq; using UnityEngine; namespace Level.Inventory diff --git a/JamGame/Assets/Scripts/Level/Inventory/Model.cs b/JamGame/Assets/Scripts/Level/Inventory/Model.cs index a54bbede..1010ab06 100644 --- a/JamGame/Assets/Scripts/Level/Inventory/Model.cs +++ b/JamGame/Assets/Scripts/Level/Inventory/Model.cs @@ -1,6 +1,6 @@ -using System.Collections.ObjectModel; +using Level.Room; +using System.Collections.ObjectModel; using System.Collections.Specialized; -using Level.Room; using UnityEngine; using UnityEngine.Events; diff --git a/JamGame/Assets/Scripts/Level/Inventory/View.cs b/JamGame/Assets/Scripts/Level/Inventory/View.cs index 43c3ec6b..e6f0fa5d 100644 --- a/JamGame/Assets/Scripts/Level/Inventory/View.cs +++ b/JamGame/Assets/Scripts/Level/Inventory/View.cs @@ -1,9 +1,9 @@ -using System; +using Common; +using Level.Room; +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; -using Common; -using Level.Room; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; diff --git a/JamGame/Assets/Scripts/Level/Shop/Controller.cs b/JamGame/Assets/Scripts/Level/Shop/Controller.cs index f9eb67b0..8a667a0f 100644 --- a/JamGame/Assets/Scripts/Level/Shop/Controller.cs +++ b/JamGame/Assets/Scripts/Level/Shop/Controller.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using System.Linq; -using Common; +using Common; using Level.Config; using Level.Room; +using System.Collections.Generic; +using System.Linq; using UnityEngine; namespace Level.Shop diff --git a/JamGame/Assets/Scripts/Level/Shop/Model.cs b/JamGame/Assets/Scripts/Level/Shop/Model.cs index d6b84da8..c25c567c 100644 --- a/JamGame/Assets/Scripts/Level/Shop/Model.cs +++ b/JamGame/Assets/Scripts/Level/Shop/Model.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Level.Room; +using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; -using Level.Room; using UnityEngine; using UnityEngine.Events; diff --git a/JamGame/Assets/Scripts/Level/Shop/View.cs b/JamGame/Assets/Scripts/Level/Shop/View.cs index 51c2dffd..0ee5b1cf 100644 --- a/JamGame/Assets/Scripts/Level/Shop/View.cs +++ b/JamGame/Assets/Scripts/Level/Shop/View.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; +using Common; +using Level.Room; +using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; -using Common; -using Level.Room; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.ResourceLocations; diff --git a/JamGame/Assets/Scripts/Location/LocationImpl.cs b/JamGame/Assets/Scripts/Location/LocationImpl.cs index 4f9c10d5..95a9318d 100644 --- a/JamGame/Assets/Scripts/Location/LocationImpl.cs +++ b/JamGame/Assets/Scripts/Location/LocationImpl.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using System.Linq; using Common; using Employee; using Level; using Level.Boss.Task; using Level.Config; +using System.Collections.Generic; +using System.Linq; using UnityEngine; namespace Location @@ -45,6 +45,7 @@ NeedType need_type { foreach (NeedProvider provider in needProviders) { + if (provider.NeedType == need_type && provider.IsAvailable(employee)) { yield return provider; @@ -73,17 +74,13 @@ MaxStress IDataProvider.GetData() AllEmployeesAtMeeting IDataProvider.GetData() { - bool all_at_meeting = employees.All( - employee => employee.LatestSatisfiedNeedType == NeedType.Meeting - ); + bool all_at_meeting = employees.All(employee => employee.LatestSatisfiedNeedType == NeedType.Meeting); return new AllEmployeesAtMeeting { Value = all_at_meeting }; } AllEmployeesAtHome IDataProvider.GetData() { - bool all_go_home = employees.All( - employee => employee.LatestSatisfiedNeedType == NeedType.Leave - ); + bool all_go_home = employees.All(employee => employee.LatestSatisfiedNeedType == NeedType.Leave); return new AllEmployeesAtHome { Value = all_go_home }; } } diff --git a/JamGame/Assets/Scripts/Location/NeedProvider.cs b/JamGame/Assets/Scripts/Location/NeedProvider.cs index e6038678..21f060a2 100644 --- a/JamGame/Assets/Scripts/Location/NeedProvider.cs +++ b/JamGame/Assets/Scripts/Location/NeedProvider.cs @@ -1,6 +1,6 @@ +using Employee; using System; using System.Collections.Generic; -using Employee; using UnityEngine; namespace Location diff --git a/JamGame/Assets/Scripts/Overlay/ExtendedInfoView.cs b/JamGame/Assets/Scripts/Overlay/ExtendedInfoView.cs index 6725f43f..878c36b0 100644 --- a/JamGame/Assets/Scripts/Overlay/ExtendedInfoView.cs +++ b/JamGame/Assets/Scripts/Overlay/ExtendedInfoView.cs @@ -1,5 +1,5 @@ -using System.Linq; using Employee; +using System.Linq; using TMPro; using UnityEngine; @@ -29,11 +29,11 @@ private void Update() { transform.LookAt(cam.transform.position); - string buffs = employee - .Buffs.Select(buff => buff.Name) + string buffs = employee.Buffs + .Select(buff => buff.Name) .Aggregate("", (x, y) => x + (x.Length == 0 ? "" : ", ") + y); - string quirks = personality - .Quirks.Select(quirk => quirk.Name) + string quirks = personality.Quirks + .Select(quirk => quirk.Name) .Aggregate("", (x, y) => x + (x.Length == 0 ? "" : ", ") + y); text.text = $"{personality.Name}\n{buffs}\n{quirks}"; diff --git a/JamGame/Assets/Scripts/TileBuilder/Command.cs b/JamGame/Assets/Scripts/TileBuilder/Command.cs index df3cc7a2..9937604e 100644 --- a/JamGame/Assets/Scripts/TileBuilder/Command.cs +++ b/JamGame/Assets/Scripts/TileBuilder/Command.cs @@ -1,6 +1,6 @@ +using Level.Room; using System.Collections.Generic; using System.Collections.Immutable; -using Level.Room; using TileUnion; using UnityEngine; diff --git a/JamGame/Assets/Scripts/TileBuilder/Controller/ControllerImpl.cs b/JamGame/Assets/Scripts/TileBuilder/Controller/ControllerImpl.cs index b4eb6466..a1fe16fa 100644 --- a/JamGame/Assets/Scripts/TileBuilder/Controller/ControllerImpl.cs +++ b/JamGame/Assets/Scripts/TileBuilder/Controller/ControllerImpl.cs @@ -1,7 +1,7 @@ -using System.Linq; -using Common; +using Common; using Level; using Level.Room; +using System.Linq; using TileBuilder.Command; using TileUnion; using UnityEngine; diff --git a/JamGame/Assets/Scripts/TileBuilder/Controller/Inspector.cs b/JamGame/Assets/Scripts/TileBuilder/Controller/Inspector.cs index 65cd9afc..d5ea0145 100644 --- a/JamGame/Assets/Scripts/TileBuilder/Controller/Inspector.cs +++ b/JamGame/Assets/Scripts/TileBuilder/Controller/Inspector.cs @@ -244,9 +244,7 @@ private void ShowLocationBuildingButtons(ControllerImpl controller) _ = EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Grow Meeting room")) { - Common.Result result = controller.GrowMeetingRoomForEmployees( - controller.NeededEmployeeCount - ); + Common.Result result = controller.GrowMeetingRoomForEmployees(controller.NeededEmployeeCount); if (result.Failure) { Debug.Log(result.Error); diff --git a/JamGame/Assets/Scripts/TileBuilder/TileBuilderImpl.cs b/JamGame/Assets/Scripts/TileBuilder/TileBuilderImpl.cs index d5e94b37..fd8f7683 100644 --- a/JamGame/Assets/Scripts/TileBuilder/TileBuilderImpl.cs +++ b/JamGame/Assets/Scripts/TileBuilder/TileBuilderImpl.cs @@ -1,10 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; using Common; using Level.Boss.Task; using Level.Room; using Pickle; +using System; +using System.Collections.Generic; +using System.Linq; using TileBuilder.Command; using TileUnion; using TileUnion.Tile; diff --git a/JamGame/Assets/Scripts/TileBuilder/Validator.cs b/JamGame/Assets/Scripts/TileBuilder/Validator.cs index 3a8b7d98..dc35aa62 100644 --- a/JamGame/Assets/Scripts/TileBuilder/Validator.cs +++ b/JamGame/Assets/Scripts/TileBuilder/Validator.cs @@ -1,7 +1,7 @@ +using Common; using System; using System.Collections.Generic; using System.Linq; -using Common; using TileBuilder.Command; using TileUnion; using UnityEngine; @@ -92,18 +92,18 @@ public Result ValidateCommand(ICommand command) } if (command is ShowSelectedRoom showRoomIllusion) { - IEnumerable newPositions = tileBuilder - .InstantiatedViews[showRoomIllusion.CoreModel.Uid] - .GetImaginePlaces(showRoomIllusion.CoreModel.TileUnionModel.PlacingProperties); + IEnumerable newPositions = tileBuilder.InstantiatedViews[ + showRoomIllusion.CoreModel.Uid + ].GetImaginePlaces(showRoomIllusion.CoreModel.TileUnionModel.PlacingProperties); return newPositions.All(x => tileBuilder.GetAllInsidePositions().Contains(x)) ? new SuccessResult() : new FailResult("Can not show in outside"); } if (command is DropRoom dropRoom) { - IEnumerable newPositions = tileBuilder - .InstantiatedViews[dropRoom.CoreModel.Uid] - .GetImaginePlaces(dropRoom.CoreModel.TileUnionModel.PlacingProperties); + IEnumerable newPositions = tileBuilder.InstantiatedViews[ + dropRoom.CoreModel.Uid + ].GetImaginePlaces(dropRoom.CoreModel.TileUnionModel.PlacingProperties); return tileBuilder .GetTileUnionsInPositions(newPositions) @@ -177,9 +177,9 @@ public Result ValidateCommand(ICommand command) } if (command is DropRoom dropRoom) { - IEnumerable newPositions = tileBuilder - .InstantiatedViews[dropRoom.CoreModel.Uid] - .GetImaginePlaces(dropRoom.CoreModel.TileUnionModel.PlacingProperties); + IEnumerable newPositions = tileBuilder.InstantiatedViews[ + dropRoom.CoreModel.Uid + ].GetImaginePlaces(dropRoom.CoreModel.TileUnionModel.PlacingProperties); return tileBuilder .GetTileUnionsInPositions(newPositions) diff --git a/JamGame/Assets/Scripts/Utils/AnimatorTimeScaleSetter.cs b/JamGame/Assets/Scripts/Utils/AnimatorTimeScaleSetter.cs index 2f92fbb0..bb56773e 100644 --- a/JamGame/Assets/Scripts/Utils/AnimatorTimeScaleSetter.cs +++ b/JamGame/Assets/Scripts/Utils/AnimatorTimeScaleSetter.cs @@ -1,4 +1,5 @@ using UnityEngine; + #if UNITY_EDITOR using System.IO;