Структуры

This commit is contained in:
ThomasCharester committed 2026-02-26 13:19:15 +03:00
1 parent 06b08f1efe
commit 1b578067f3
82 files changed
+2692 -944

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 14e2378107474634a7cef1a78de2bad1
timeCreated: 1772098281
+3
View File
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 05301ce17b624f25af29ec9e408dcef6
timeCreated: 1772098338
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
namespace Code.Calendar.DataStructures
{
public struct Plant
{
public string Name;
public string IconPath;
public int Id;
}
public struct Task
{
public string Description;
public DateTime Date;
public bool IsPeriodic;
public int PeriodicInterval;
public int PlantId;
public List<string> PhotoPaths;
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: bde98849445a4c769f5c1cf41e561f87
timeCreated: 1772098360
@@ -1,5 +1,4 @@
using Code.Infrastructure.Audio;
using Code.Infrastructure.Camera;
using Code.Infrastructure.Input;
using Code.Infrastructure.UI;
using Reflex.Attributes;
@@ -17,8 +16,6 @@ namespace Code.Infrastructure.App
public class AppStateMachineContext
{
[Inject] public SceneLoader.SceneLoader SceneLoader { get; set; }
[Inject] public CameraStateMachine Camera { get; set; }
[Inject] public CameraFactory CameraFactory { get; set; }
[Inject] public IUIService UIService { get; set; }
[Inject] public IAudioFactory AudioFactory { get; set; }
[Inject] public IAudioService AudioService { get; set; }
@@ -1,16 +1,12 @@
using Code.Debug;
using Code.Infrastructure.Audio;
using Code.Infrastructure.Camera;
using Code.Infrastructure.Configs;
using Code.Infrastructure.Input;
using Code.Infrastructure.Loadings;
using Code.Infrastructure.SceneLoader;
using Code.Infrastructure.UI;
using Code.Infrastructure.Volume;
using Reflex.Core;
using Reflex.Enums;
using Reflex.Injectors;
using Unity.Cinemachine;
using UnityEngine;
using UnityEngine.Rendering.Universal;
using Resolution = Reflex.Enums.Resolution;
@@ -20,14 +16,10 @@ namespace Code.Infrastructure.App
public class PapaInstaller : MonoBehaviour, IInstaller,
ISceneConfigsLoadedHandle,
IInputServiceInitializedHandle,
ICameraInitializedHandle,
IUIInitializedHandle,
IUIPanelLoaded,
IVolumesInitializedHandle,
IVolumeLoaded,
IAudioSourcePoolInitializedHandle,
IAudioConfigsLoadedHandle,
ICinematicMachineHandle,
ILayerMasksInitializedHandle
{
public void InstallBindings(ContainerBuilder containerBuilder)
@@ -46,19 +38,11 @@ namespace Code.Infrastructure.App
containerBuilder.RegisterType(typeof(AppStateMachine), Lifetime.Singleton, Resolution.Lazy);
containerBuilder.RegisterType(typeof(AppStateMachineContext), Lifetime.Singleton, Resolution.Lazy);
containerBuilder.RegisterType(typeof(CameraFactory), Lifetime.Singleton, Resolution.Lazy);
containerBuilder.RegisterType(typeof(CameraStateMachine), Lifetime.Singleton, Resolution.Lazy);
containerBuilder.RegisterType(typeof(CameraStateMachineContext), Lifetime.Singleton, Resolution.Lazy);
containerBuilder.RegisterType(typeof(UIFactory), new[] { typeof(IUIFactory) }, Lifetime.Singleton,
Resolution.Eager);
containerBuilder.RegisterType(typeof(UIService), new[] { typeof(IUIService) }, Lifetime.Singleton,
Resolution.Eager);
containerBuilder.RegisterType(typeof(VolumeService), new[] { typeof(IVolumeService) }, Lifetime.Singleton,
Resolution.Lazy);
containerBuilder.RegisterType(typeof(VolumeFactory), new[] { typeof(IVolumeFactory) }, Lifetime.Singleton,
Resolution.Eager);
containerBuilder.RegisterType(typeof(AudioFactory), new[] { typeof(IAudioFactory) }, Lifetime.Singleton,
Resolution.Eager);
@@ -74,26 +58,14 @@ namespace Code.Infrastructure.App
// Logo
// Scene configs
// Input service
// Camera
// Volume Factory
// Loading volume
// Audio Factory
// Audio Pool
// Cinemachine Camera
// Layer masks
_initialLoading = new Loading(11, () => EssentialLoadEnded(_thatRightContainer));
_initialLoading = new Loading(7, () => EssentialLoadEnded(_thatRightContainer));
_ui2CamLoading = new Loading(2,
() =>
{
_thatRightContainer.Resolve<IUIService>().SetCanvasCamera(_thatRightContainer
.Resolve<CameraStateMachineContext>().cameraLoadedData.Camera);
});
}
private Loading _initialLoading;
private Loading _ui2CamLoading;
private Container _thatRightContainer;
private void Bootstrap(Container container)
@@ -104,9 +76,6 @@ namespace Code.Infrastructure.App
ConstructorInjector.Construct(typeof(LayerMasks), container);
var cameraFactory = container.Resolve<CameraFactory>();
cameraFactory.CreateCameraStateMachine(container.Resolve<CameraStateMachine>())
.Forget();
}
private void EssentialLoadEnded(Container container)
@@ -128,24 +97,9 @@ namespace Code.Infrastructure.App
_initialLoading.DoProgress();
}
public void CameraInitialized(CameraStateMachineContext.CameraLoadedData data)
{
_thatRightContainer.Resolve<CameraStateMachineContext>().cameraLoadedData = data;
_thatRightContainer.Resolve<CameraStateMachine>().SwitchState(CameraMode.None)
.AllowStateTransition(CameraMode.ThirdPerson)
.AllowStateTransition(CameraMode.Platformer);
data.Camera.GetUniversalAdditionalCameraData().renderPostProcessing = true;
_ui2CamLoading.DoProgress();
_initialLoading.DoProgress();
_thatRightContainer.Resolve<CameraFactory>().LoadCinemachineCamera(CameraMode.None).Forget();
}
public void UIInitialized()
{
_ui2CamLoading.DoProgress();
_initialLoading.DoProgress();
_thatRightContainer.Resolve<IUIService>().TryLoadPanel(UIPanelType.Logo);
@@ -170,26 +124,6 @@ namespace Code.Infrastructure.App
}
}
public void VolumesInitialized()
{
_initialLoading.DoProgress();
_thatRightContainer.Resolve<IVolumeService>().TryLoadVolume(VolumeId.MenuRetro);
}
public void VolumeLoaded(VolumeId volumeId)
{
switch (volumeId)
{
case VolumeId.MenuRetro:
_initialLoading.DoProgress();
break;
default:
Application.Quit();
break;
}
}
public void AudioSourcePoolInitialized()
{
_initialLoading.DoProgress();
@@ -200,11 +134,6 @@ namespace Code.Infrastructure.App
_initialLoading.DoProgress();
}
public void CinemachineLoaded(CinemachineCamera cinemachineCamera)
{
_initialLoading.DoProgress();
}
public void LayerMasksInitialized()
{
_initialLoading.DoProgress();
@@ -1,5 +1,4 @@
using System.Threading;
using Code.Debug;
using Code.Infrastructure.Audio;
using Code.Infrastructure.Generators;
using Code.Infrastructure.UI;
@@ -23,26 +22,24 @@ namespace Code.Infrastructure.App.States
Context.UIService.TryRemovePanel(UIPanelType.Logo);
Context.UIService.TryLoadPanel(UIPanelType.DebugSceneChooser);
Context.AudioFactory.LoadAudioClips(AudioNames.UISounds);
// Context.AudioFactory.LoadAudioClips(AudioNames.UISounds);
}
protected override void OnExitState()
{
// Context.AudioFactory.ReleaseAudios(AudioNames.UISounds);
Context.UIService.TryRemovePanel(UIPanelType.DebugSceneChooser);
_eventBus.Unsubscribe(this);
}
public void UILoaded(UIPanelType uiPanelType)
{
if (uiPanelType != UIPanelType.DebugSceneChooser) return;
Context.UIService.OpenPanel(uiPanelType);
// if (uiPanelType != UIPanelType.DebugSceneChooser) return;
//
// Context.UIService.OpenPanel(uiPanelType);
}
public void OnReadyToPlay(AudioNames groupName)
{
Context.AudioService.PlayRepeatedly(AudioNames.UISounds,0);
// Context.AudioService.PlayRepeatedly(AudioNames.UISounds,0);
}
}
}
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Code.Infrastructure.Configs;
using Code.Infrastructure.EventBus;
using Cysharp.Threading.Tasks;
@@ -2,7 +2,6 @@ namespace Code.Infrastructure.Audio
{
public enum AudioNames
{
UISounds,
EnemySFX
UISounds
}
}
@@ -1,7 +1,7 @@
namespace Code.Infrastructure.Configs
{
// Если забыл, это енам масок, пиши тип и -=-=- конфиги
public enum LayerMaskType
{
PlatformerGround
}
}
@@ -2,15 +2,9 @@ namespace Code.Infrastructure.Input
{
public enum ActionMappings
{
MainMenu,
Gameplay,
MainMenu,
Debug
}
public enum GameplayActions
{
Move,
Brake,
}
public enum DebugActions
{
Debug1,
@@ -5,9 +5,6 @@ namespace Code.Infrastructure.SceneLoader
[SceneIdEnum]
public enum SceneId
{
MainMenu,
Gameplay,
SoundTest,
Platformer
MainMenu
}
}
+1 -8
View File
@@ -3,13 +3,6 @@ namespace Code.Infrastructure.UI
public enum UIPanelType
{
Logo,
Loading,
DebugSceneChooser,
// Race
PlayerScoreCounter,
WinScreen,
PlayerScores,
//
DebugMenu
Loading
}
}