CodeWriter and pain
This commit is contained in:
1 parent
a409054750
commit
85ac63425c
89 files changed
+1439
-1461
No files matched your search
Generated
+13
@@ -0,0 +1,13 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Rider ignored files
|
||||
/contentModel.xml
|
||||
/projectSettingsUpdater.xml
|
||||
/.idea.Infra.iml
|
||||
/modules.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -16,7 +16,7 @@ namespace Code.Infrastructure.App
|
||||
[Inject] public CameraStateMachine Camera { get; set; }
|
||||
}
|
||||
|
||||
[Generators.StateMachine(typeof(AppStateMachineContext),typeof(AppStates))]
|
||||
[global::StateMachine(typeof(AppStateMachineContext),typeof(AppStates))]
|
||||
public partial class AppStateMachine
|
||||
{
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Code.Example;
|
||||
using Reflex.Core;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using Code.Infrastructure.Camera;
|
||||
using Code.Infrastructure.Generators;
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using Code.Infrastructure.Camera;
|
||||
using Code.Infrastructure.Generators;
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Code.Infrastructure.Generators;
|
||||
|
||||
|
||||
namespace Code.Infrastructure.App.States
|
||||
{
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Code.Infrastructure.Generators;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.Infrastructure.Camera
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Code.Infrastructure.EventBus;
|
||||
using Code.Infrastructure.Generators;
|
||||
using Code.Infrastructure.Input;
|
||||
using Reflex.Attributes;
|
||||
using UnityEngine.AddressableAssets;
|
||||
@@ -46,7 +45,7 @@ namespace Code.Infrastructure.Camera
|
||||
[Inject] public EventBus.EventBus EventBus;
|
||||
}
|
||||
|
||||
[Generators.StateMachine(typeof(CameraStateMachineContext), typeof(CameraMode))]
|
||||
[global::StateMachine(typeof(CameraStateMachineContext), typeof(CameraMode))]
|
||||
public partial class CameraStateMachine
|
||||
{
|
||||
public UnityEngine.Camera Camera => StateMachineContext.cameraLoadedData.Camera;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
using Code.Infrastructure.Generators;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.Infrastructure.Camera.CameraStates
|
||||
{
|
||||
[State(typeof(CameraMode),typeof(CameraStateMachineContext), true)]
|
||||
// [State(typeof(CameraMode),typeof(CameraStateMachineContext), true)]
|
||||
public partial class NoneCameraState : BaseCameraState
|
||||
{
|
||||
public NoneCameraState(CameraStateMachineContext context, EventBus.EventBus eventBus) : base(context, eventBus)
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,49 +1,50 @@
|
||||
using System;
|
||||
|
||||
namespace Code.Infrastructure.Generators
|
||||
public class SceneIdEnum : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public class ToConfig : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public class Config : Attribute
|
||||
{
|
||||
public class StateMachine : Attribute
|
||||
public bool Multiple;
|
||||
public string MenuName;
|
||||
public Config(string menuName, bool multiple = false)
|
||||
{
|
||||
public Type StateMachineContextType;
|
||||
public Type StateMachineEnumType;
|
||||
Multiple = multiple;
|
||||
MenuName = menuName;
|
||||
}
|
||||
}
|
||||
|
||||
public StateMachine(Type stateMachineContextType, Type stateMachineEnumType)
|
||||
{
|
||||
StateMachineContextType = stateMachineContextType;
|
||||
StateMachineEnumType = stateMachineEnumType;
|
||||
}
|
||||
}
|
||||
|
||||
public class State : Attribute
|
||||
{
|
||||
public Type StateEnum;
|
||||
public Type StateMachineContext;
|
||||
public bool SilentBitch; // Поэтому нейминг переменных очень важен
|
||||
public class StateRaisingEvent : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public State(Type stateEnum,Type stateMachineContext, bool silentBitch = false)
|
||||
{
|
||||
StateEnum = stateEnum;
|
||||
StateMachineContext = stateMachineContext;
|
||||
SilentBitch = silentBitch;
|
||||
}
|
||||
}
|
||||
public class StateRaisingEvent : Attribute
|
||||
{
|
||||
}
|
||||
public class Config : Attribute
|
||||
public class State : Attribute
|
||||
{
|
||||
public Type StateEnum;
|
||||
public Type StateMachineContext;
|
||||
public bool SilentBitch; // Поэтому нейминг переменных очень важен
|
||||
|
||||
public State(Type stateEnum,Type stateMachineContext, bool silentBitch = false)
|
||||
{
|
||||
public bool Multiple;
|
||||
public string MenuName;
|
||||
public Config(string menuName, bool multiple = false)
|
||||
{
|
||||
Multiple = multiple;
|
||||
MenuName = menuName;
|
||||
}
|
||||
StateEnum = stateEnum;
|
||||
StateMachineContext = stateMachineContext;
|
||||
SilentBitch = silentBitch;
|
||||
}
|
||||
public class ToConfig : Attribute
|
||||
{
|
||||
}
|
||||
public class SceneIdEnum : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public class StateMachine : Attribute
|
||||
{
|
||||
public Type StateMachineContextType;
|
||||
public Type StateMachineEnumType;
|
||||
|
||||
public StateMachine(Type stateMachineContextType, Type stateMachineEnumType)
|
||||
{
|
||||
StateMachineContextType = stateMachineContextType;
|
||||
StateMachineEnumType = stateMachineEnumType;
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
using System.Linq;
|
||||
using Unity.VisualScripting;
|
||||
using UnityCodeGen;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Code.Infrastructure.Generators
|
||||
{
|
||||
[Generator]
|
||||
public class ConfigGenerator : ICodeGenerator
|
||||
{
|
||||
public void Execute(GeneratorContext context)
|
||||
{
|
||||
var configs = TypeCache.GetTypesWithAttribute<Config>();
|
||||
|
||||
var configsCode = "";
|
||||
var configAddCode = "";
|
||||
var configReferencesCode = "";
|
||||
var configReferencesUsingsCode = "";
|
||||
var configOfConfigsCode = "";
|
||||
|
||||
foreach (var cfg in configs)
|
||||
{
|
||||
var configFields = "";
|
||||
var configUsings = "";
|
||||
|
||||
var mem = cfg.GetFields();
|
||||
var members = mem.Where(m => m.HasAttribute<ToConfig>()).ToList();
|
||||
foreach (var m in members)
|
||||
{
|
||||
configUsings += $"using {m.FieldType.Namespace};\n";
|
||||
configFields += $"public {m.FieldType.FullName} {m.Name};\n";
|
||||
}
|
||||
|
||||
var attribute = cfg.GetAttribute<Config>();
|
||||
|
||||
configUsings += @"
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
";
|
||||
var configCode = $@"
|
||||
#pragma warning disable CS0105
|
||||
{configUsings}
|
||||
namespace {cfg.Namespace}{{
|
||||
#pragma warning restore CS0105
|
||||
[CreateAssetMenu(fileName = ""{cfg.Name}Config"", menuName = ""{attribute.MenuName}"")]
|
||||
public class {cfg.Name}Config : ScriptableObject
|
||||
{{
|
||||
{configFields}
|
||||
}}
|
||||
}}
|
||||
";
|
||||
context.AddCode($"{cfg.Name}Config.Generated.cs", configCode);
|
||||
|
||||
configReferencesUsingsCode += $"using {cfg.Namespace};\n";
|
||||
|
||||
if (attribute.Multiple)
|
||||
{
|
||||
configReferencesCode += $"public string {cfg.Name};\n";
|
||||
configAddCode += $@"
|
||||
_multipleConfigReferences.Add(typeof({cfg.FullName}Config), systemConfigsReferences.{cfg.Name});
|
||||
";
|
||||
}
|
||||
else
|
||||
{
|
||||
configReferencesCode += $"public AssetReference {cfg.Name};\n";
|
||||
configAddCode += $@"
|
||||
_singleConfigReferences.Add(typeof({cfg.FullName}Config), systemConfigsReferences.{cfg.Name});
|
||||
";
|
||||
}
|
||||
}
|
||||
configsCode += $@"
|
||||
#pragma warning disable CS0105
|
||||
{configReferencesUsingsCode}
|
||||
using UnityEngine;
|
||||
#pragma warning restore CS0105
|
||||
|
||||
namespace Code.Infrastructure.Configs
|
||||
{{
|
||||
|
||||
public partial class ConfigLocator
|
||||
{{
|
||||
partial void LoadConfigs()
|
||||
{{
|
||||
SystemConfigsReferences systemConfigsReferences = Resources.Load<SystemConfigsReferences>(""SystemConfigsReferences"");
|
||||
{configAddCode}
|
||||
//_singleConfigReferences.Add(typeof(ScenesAssetReferences), systemConfigsReferences.scenesAssetReferences);
|
||||
}}
|
||||
}}
|
||||
}}
|
||||
";
|
||||
context.AddCode($"ConfigLocator.Generated.cs", configsCode);
|
||||
|
||||
configOfConfigsCode += $@"
|
||||
#pragma warning disable CS0105
|
||||
{configReferencesUsingsCode}
|
||||
using UnityEngine.AddressableAssets;
|
||||
#pragma warning restore CS0105
|
||||
|
||||
namespace Code.Infrastructure.Configs{{
|
||||
public partial class SystemConfigsReferences
|
||||
{{
|
||||
{configReferencesCode}
|
||||
}}
|
||||
}}
|
||||
";
|
||||
context.AddCode($"SystemConfigsReferences.Generated.cs", configOfConfigsCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 026403be8eae4546adcb407308031c1d
|
||||
timeCreated: 1765660396
|
||||
@@ -1,148 +0,0 @@
|
||||
using System.Linq;
|
||||
using Unity.VisualScripting;
|
||||
using UnityCodeGen;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.Infrastructure.Generators
|
||||
{
|
||||
[Generator]
|
||||
public class SceneLoaderGenerator : ICodeGenerator
|
||||
{
|
||||
public void Execute(GeneratorContext context)
|
||||
{
|
||||
var Enum = TypeCache.GetTypesWithAttribute<SceneIdEnum>();
|
||||
|
||||
var loaderCode = "";
|
||||
var dictionaryCode = "";
|
||||
var interfacesCode = "";
|
||||
var interfacesUsingsCode = $@"
|
||||
using Code.Infrastructure.EventBus;
|
||||
";
|
||||
|
||||
foreach (var en in Enum)
|
||||
{
|
||||
if (!en.IsEnum) return;
|
||||
|
||||
var members = en.GetFields();
|
||||
foreach (var member in members)
|
||||
{
|
||||
if(member.FieldType.FullName != en.FullName) continue;
|
||||
interfacesCode += $@"
|
||||
public interface IOn{member.Name}SceneLoadedHandler : IGlobalSubscriber
|
||||
{{
|
||||
void On{member.Name}SceneLoaded();
|
||||
}}
|
||||
";
|
||||
dictionaryCode += $@"
|
||||
|
||||
_scenesActions.Add(SceneId.{member.Name},() => _eventBus.RaiseEvent<IOn{member.Name}SceneLoadedHandler>(h=> h.On{member.Name}SceneLoaded()));
|
||||
";
|
||||
}
|
||||
}
|
||||
|
||||
loaderCode = $@"
|
||||
#pragma warning disable CS0105
|
||||
{interfacesUsingsCode}
|
||||
#pragma warning restore CS0105
|
||||
|
||||
namespace Code.Infrastructure.SceneLoader
|
||||
{{
|
||||
public partial class SceneLoader{{
|
||||
partial void SetupScenesInfo(){{
|
||||
{dictionaryCode}
|
||||
}}
|
||||
}}
|
||||
{interfacesCode}
|
||||
}}
|
||||
";
|
||||
context.AddCode($"SceneLoader.Generated.cs", loaderCode);
|
||||
// var configsCode = "";
|
||||
// var configCode = "";
|
||||
// var configUsings = "";
|
||||
// var configFields = "";
|
||||
// var configAddCode = "";
|
||||
// var configReferencesCode = "";
|
||||
// var configReferencesUsingsCode = "";
|
||||
// var configOfConfigsCode = "";
|
||||
//
|
||||
// foreach (var cfg in configs)
|
||||
// {
|
||||
// var mem = cfg.GetFields();
|
||||
// var members = mem.Where(m => m.HasAttribute<ToConfig>()).ToList();
|
||||
// foreach (var m in members)
|
||||
// {
|
||||
// configUsings += $"using {m.FieldType.Namespace};\n";
|
||||
// configFields += $"public {m.FieldType.FullName} {m.Name};\n";
|
||||
// }
|
||||
//
|
||||
// var attribute = cfg.GetAttribute<Config>();
|
||||
//
|
||||
// configUsings += @"
|
||||
// using UnityEngine;
|
||||
// using UnityEngine.AddressableAssets;
|
||||
// ";
|
||||
// configCode = $@"
|
||||
// {configUsings}
|
||||
// namespace {cfg.Namespace}{{
|
||||
// [CreateAssetMenu(fileName = ""{cfg.Name}Config"", menuName = ""{attribute.MenuName}"")]
|
||||
// public class {cfg.Name}Config : ScriptableObject
|
||||
// {{
|
||||
// {configFields}
|
||||
// }}
|
||||
// }}
|
||||
// ";
|
||||
// context.AddCode($"{cfg.Name}Config.Generated.cs", configCode);
|
||||
//
|
||||
// configReferencesUsingsCode += $"using {cfg.Namespace};\n";
|
||||
//
|
||||
// if (attribute.Multiple)
|
||||
// {
|
||||
// configReferencesCode += $"public String {cfg.Name};\n";
|
||||
// configAddCode += $@"
|
||||
// _multipleConfigReferences.Add(typeof({cfg.FullName}), systemConfigsReferences.{cfg.Name});
|
||||
// ";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// configReferencesCode += $"public AssetReference {cfg.Name};\n";
|
||||
// configAddCode += $@"
|
||||
// _singleConfigReferences.Add(typeof({cfg.FullName}Config), systemConfigsReferences.{cfg.Name});
|
||||
// ";
|
||||
// }
|
||||
// }
|
||||
// configsCode += $@"
|
||||
// {configReferencesUsingsCode}
|
||||
// using UnityEngine;
|
||||
//
|
||||
// namespace Code.Infrastructure.Configs
|
||||
// {{
|
||||
//
|
||||
// public partial class ConfigLocator
|
||||
// {{
|
||||
// partial void LoadConfigs()
|
||||
// {{
|
||||
// SystemConfigsReferences systemConfigsReferences = Resources.Load<SystemConfigsReferences>(""SystemConfigsReferences"");
|
||||
// {configAddCode}
|
||||
// //_singleConfigReferences.Add(typeof(ScenesAssetReferences), systemConfigsReferences.scenesAssetReferences);
|
||||
// }}
|
||||
// }}
|
||||
// }}
|
||||
// ";
|
||||
// context.AddCode($"ConfigLocator.Generated.cs", configsCode);
|
||||
//
|
||||
// configOfConfigsCode += $@"
|
||||
// {configReferencesUsingsCode}
|
||||
// using UnityEngine.AddressableAssets;
|
||||
//
|
||||
// namespace Code.Infrastructure.Configs{{
|
||||
// public partial class SystemConfigsReferences
|
||||
// {{
|
||||
// {configReferencesCode}
|
||||
// }}
|
||||
// }}
|
||||
// ";
|
||||
// context.AddCode($"SystemConfigsReferences.Generated.cs", configOfConfigsCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92ec56ffd46d4a569bb9a7d436790439
|
||||
timeCreated: 1766423754
|
||||
@@ -1,131 +0,0 @@
|
||||
using System.Linq;
|
||||
using Unity.VisualScripting;
|
||||
using UnityCodeGen;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Code.Infrastructure.Generators
|
||||
{
|
||||
[Generator]
|
||||
public class StateMachineGenerator : ICodeGenerator
|
||||
{
|
||||
public void Execute(GeneratorContext context)
|
||||
{
|
||||
GenerateStates(context);
|
||||
|
||||
GenerateStateMachine(context);
|
||||
}
|
||||
|
||||
private void GenerateStateMachine(GeneratorContext context)
|
||||
{
|
||||
var stateMachines = TypeCache.GetTypesWithAttribute<StateMachine>();
|
||||
|
||||
foreach (var sm in stateMachines)
|
||||
{
|
||||
var attribute = sm.GetAttribute<StateMachine>();
|
||||
|
||||
var states = TypeCache.GetTypesWithAttribute<State>()
|
||||
.Where(st =>
|
||||
st.GetAttribute<State>().StateMachineContext.FullName ==
|
||||
attribute.StateMachineContextType.FullName);
|
||||
|
||||
var statesCode = "";
|
||||
var statesNamespacesCode = "";
|
||||
|
||||
foreach (var st in states)
|
||||
{
|
||||
statesNamespacesCode += $@"
|
||||
using {st.Namespace};
|
||||
";
|
||||
statesCode += $@"
|
||||
var state{st.Name} = new {st.Name}(StateMachineContext,eventBus);
|
||||
States.Add(state{st.Name}.myState, state{st.Name});
|
||||
";
|
||||
}
|
||||
|
||||
var stateMachineCode =
|
||||
$@"
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0105
|
||||
using Code.Infrastructure.StateMachine;
|
||||
{statesNamespacesCode}
|
||||
#pragma warning restore CS0105
|
||||
namespace {sm.Namespace}
|
||||
{{
|
||||
|
||||
public partial class {sm.Name} : AbstractStateMachine<{attribute.StateMachineEnumType.FullName},{attribute.StateMachineContextType.FullName}>
|
||||
{{
|
||||
|
||||
public {sm.Name}({attribute.StateMachineContextType.FullName} context, EventBus.EventBus eventBus) : base(context)
|
||||
{{
|
||||
{statesCode}
|
||||
}}
|
||||
|
||||
protected override bool CheckTransitionAllowed({attribute.StateMachineEnumType.FullName} nextState) => AllowedStates.HasFlag(nextState);
|
||||
protected override void ResetAllowedTransitions() => AllowedStates = 0;
|
||||
}}
|
||||
|
||||
public static class {sm.Name}Extensions
|
||||
{{
|
||||
public static AbstractStateMachine<{attribute.StateMachineEnumType.FullName}, {attribute.StateMachineContextType.FullName}> AllowStateTransition(
|
||||
this AbstractStateMachine<{attribute.StateMachineEnumType.FullName}, {attribute.StateMachineContextType.FullName}> stateMachine, {attribute.StateMachineEnumType.FullName} state)
|
||||
{{
|
||||
if (stateMachine == null) return null;
|
||||
|
||||
stateMachine.AllowedStates |= state;
|
||||
return stateMachine;
|
||||
}}
|
||||
}}
|
||||
}}
|
||||
|
||||
";
|
||||
|
||||
context.AddCode($"{sm.FullName}.Generated.cs", stateMachineCode);
|
||||
}
|
||||
}
|
||||
|
||||
private void GenerateStates(GeneratorContext context)
|
||||
{
|
||||
var states = TypeCache.GetTypesWithAttribute<State>();
|
||||
|
||||
var statesCode = "";
|
||||
foreach (var st in states)
|
||||
{
|
||||
var attribute = st.GetAttribute<State>();
|
||||
|
||||
var fireStatesCode = "";
|
||||
if(st.HasAttribute<StateRaisingEvent>()) fireStatesCode = $@"
|
||||
protected override void _fireEnterState()
|
||||
{{
|
||||
EventBus.RaiseEvent<IEnterStateHandle<{st.FullName}>>(h => h.EnterState());
|
||||
}}
|
||||
|
||||
protected override void _fireExitState()
|
||||
{{
|
||||
EventBus.RaiseEvent<IExitStateHandle<{st.FullName}>>(h => h.ExitState());
|
||||
}}
|
||||
";
|
||||
var genetics = "";
|
||||
if(!attribute.SilentBitch) genetics = $@" : BaseState<{attribute.StateEnum.FullName}, {attribute.StateMachineContext.FullName}>";
|
||||
|
||||
statesCode = $@"
|
||||
|
||||
// retard-generated
|
||||
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
namespace {st.Namespace}
|
||||
{{
|
||||
public partial class {st.Name} {genetics}
|
||||
{{
|
||||
{fireStatesCode}
|
||||
}}
|
||||
}}
|
||||
";
|
||||
|
||||
|
||||
context.AddCode($"{st.FullName}.Generated.cs", statesCode);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9fb4b6961cd0471d8183511316c15000
|
||||
timeCreated: 1765563824
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using Code.Infrastructure.Configs;
|
||||
using Code.Infrastructure.EventBus;
|
||||
using Code.Infrastructure.Generators;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Code.Infrastructure.Generators;
|
||||
|
||||
namespace Code.Infrastructure.SceneLoader
|
||||
{
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Code.Infrastructure.Configs;
|
||||
using Code.Infrastructure.EventBus;
|
||||
using Code.Infrastructure.Generators;
|
||||
using Code.Infrastructure.EventBus;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Code.Infrastructure.App;
|
||||
|
||||
namespace Code.Infrastructure.StateMachine
|
||||
{
|
||||
public abstract class BaseState<TEnum, TStateMachineContext>
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,59 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e1d53c76c82adb46902c4d2603e79c2
|
||||
labels:
|
||||
- RoslynAnalyzer
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 3
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 1
|
||||
validateReferences: 0
|
||||
platformData:
|
||||
Android:
|
||||
enabled: 0
|
||||
settings:
|
||||
AndroidLibraryDependee: UnityLibrary
|
||||
AndroidSharedLibraryType: Executable
|
||||
CPU: ARMv7
|
||||
Any:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 1
|
||||
Exclude Editor: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
Editor:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
Linux64:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
OSXUniversal:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
Win:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
Win64:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
WindowsStoreApps:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,26 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using Entities;
|
||||
|
||||
namespace InfraGens.Sample;
|
||||
|
||||
public class Examples
|
||||
{
|
||||
// Create generated entities, based on DDD.UbiquitousLanguageRegistry.txt
|
||||
public object[] CreateEntities()
|
||||
{
|
||||
return new object[]
|
||||
{
|
||||
new Customer(),
|
||||
new Employee(),
|
||||
new Product(),
|
||||
new Shop(),
|
||||
new Stock()
|
||||
};
|
||||
}
|
||||
|
||||
// Execute generated method Report
|
||||
public IEnumerable<string> CreateEntityReport(SampleEntity entity)
|
||||
{
|
||||
return entity.Report();
|
||||
}
|
||||
}
|
||||
// using System.Collections.Generic;
|
||||
// using Entities;
|
||||
//
|
||||
// namespace InfraGens.Sample;
|
||||
//
|
||||
// public class Examples
|
||||
// {
|
||||
// // Create generated entities, based on DDD.UbiquitousLanguageRegistry.txt
|
||||
// public object[] CreateEntities()
|
||||
// {
|
||||
// return new object[]
|
||||
// {
|
||||
// new Customer(),
|
||||
// new Employee(),
|
||||
// new Product(),
|
||||
// new Shop(),
|
||||
// new Stock()
|
||||
// };
|
||||
// }
|
||||
//
|
||||
// // Execute generated method Report
|
||||
// public IEnumerable<string> CreateEntityReport(SampleEntity entity)
|
||||
// {
|
||||
// return entity.Report();
|
||||
// }
|
||||
// }
|
||||
@@ -1,12 +1,56 @@
|
||||
using Generators;
|
||||
using System;
|
||||
|
||||
namespace InfraGens.Sample;
|
||||
[Config("Configs/Camera/CameraConfig")]
|
||||
public class GameCamera
|
||||
{
|
||||
[ToConfig] public int Camera;
|
||||
}
|
||||
public class StateMachine : Attribute
|
||||
{
|
||||
public Type StateMachineContextType;
|
||||
public Type StateMachineEnumType;
|
||||
|
||||
// This code will not compile until you build the project with the Source Generators
|
||||
public StateMachine(Type stateMachineContextType, Type stateMachineEnumType)
|
||||
{
|
||||
StateMachineContextType = stateMachineContextType;
|
||||
StateMachineEnumType = stateMachineEnumType;
|
||||
}
|
||||
}
|
||||
|
||||
[Report]
|
||||
public partial class SampleEntity
|
||||
public class State : Attribute
|
||||
{
|
||||
public Type StateEnum;
|
||||
public Type StateMachineContext;
|
||||
public bool SilentBitch; // Поэтому нейминг переменных очень важен
|
||||
|
||||
public State(Type stateEnum, Type stateMachineContext, bool silentBitch = false)
|
||||
{
|
||||
StateEnum = stateEnum;
|
||||
StateMachineContext = stateMachineContext;
|
||||
SilentBitch = silentBitch;
|
||||
}
|
||||
}
|
||||
|
||||
public class StateRaisingEvent : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public class Config : Attribute
|
||||
{
|
||||
public bool Multiple;
|
||||
public string MenuName;
|
||||
|
||||
public Config(string menuName, bool multiple = false)
|
||||
{
|
||||
Multiple = multiple;
|
||||
MenuName = menuName;
|
||||
}
|
||||
}
|
||||
|
||||
public class ToConfig : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public class SceneIdEnum : Attribute
|
||||
{
|
||||
public int Id { get; } = 42;
|
||||
public string? Name { get; } = "Sample";
|
||||
}
|
||||
BIN
Binary file not shown.
+1
-1
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("InfraGens.Sample")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a3cd3e86a161e3ee450256b1b37c6a4583c70840")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a4090547509ba65f8ba7b22442c10d06c15217e0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("InfraGens.Sample")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("InfraGens.Sample")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
ff49a1d065da3858c1224dae22c001fae5c9d17e1737f7b26cef44c567a20d60
|
||||
ef1fde298251b87291e3f53f6d50441cec1268cfc54dba8a1b093bc8be99164e
|
||||
+11
@@ -9,3 +9,14 @@ A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\o
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\obj\Debug\net8.0\refint\InfraGens.Sample.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\obj\Debug\net8.0\InfraGens.Sample.pdb
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\obj\Debug\net8.0\ref\InfraGens.Sample.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Sample\obj\Debug\net8.0\InfraGens.Sample.GeneratedMSBuildEditorConfig.editorconfig
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Sample\obj\Debug\net8.0\InfraGens.Sample.AssemblyInfoInputs.cache
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Sample\obj\Debug\net8.0\InfraGens.Sample.AssemblyInfo.cs
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Sample\obj\Debug\net8.0\InfraGens.Sample.csproj.CoreCompileInputs.cache
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Sample\obj\Debug\net8.0\InfraGens.Sample.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Sample\obj\Debug\net8.0\refint\InfraGens.Sample.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Sample\obj\Debug\net8.0\InfraGens.Sample.pdb
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Sample\bin\Debug\net8.0\InfraGens.Sample.deps.json
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Sample\bin\Debug\net8.0\InfraGens.Sample.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Sample\bin\Debug\net8.0\InfraGens.Sample.pdb
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Sample\obj\Debug\net8.0\ref\InfraGens.Sample.dll
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+67
-67
@@ -1,67 +1,67 @@
|
||||
using System.Linq;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Xunit;
|
||||
|
||||
namespace InfraGens.Tests;
|
||||
|
||||
public class SampleIncrementalSourceGeneratorTests
|
||||
{
|
||||
private const string VectorClassText = @"
|
||||
namespace TestNamespace;
|
||||
|
||||
[Generators.Report]
|
||||
public partial class Vector3
|
||||
{
|
||||
public float X { get; set; }
|
||||
public float Y { get; set; }
|
||||
public float Z { get; set; }
|
||||
}";
|
||||
|
||||
private const string ExpectedGeneratedClassText = @"// <auto-generated/>
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TestNamespace;
|
||||
|
||||
partial class Vector3
|
||||
{
|
||||
public IEnumerable<string> Report()
|
||||
{
|
||||
yield return $""X:{this.X}"";
|
||||
yield return $""Y:{this.Y}"";
|
||||
yield return $""Z:{this.Z}"";
|
||||
}
|
||||
}
|
||||
";
|
||||
|
||||
[Fact]
|
||||
public void GenerateReportMethod()
|
||||
{
|
||||
// Create an instance of the source generator.
|
||||
var generator = new SampleIncrementalSourceGenerator();
|
||||
|
||||
// Source generators should be tested using 'GeneratorDriver'.
|
||||
var driver = CSharpGeneratorDriver.Create(generator);
|
||||
|
||||
// We need to create a compilation with the required source code.
|
||||
var compilation = CSharpCompilation.Create(nameof(SampleSourceGeneratorTests),
|
||||
new[] { CSharpSyntaxTree.ParseText(VectorClassText) },
|
||||
new[]
|
||||
{
|
||||
// To support 'System.Attribute' inheritance, add reference to 'System.Private.CoreLib'.
|
||||
MetadataReference.CreateFromFile(typeof(object).Assembly.Location)
|
||||
});
|
||||
|
||||
// Run generators and retrieve all results.
|
||||
var runResult = driver.RunGenerators(compilation).GetRunResult();
|
||||
|
||||
// All generated files can be found in 'RunResults.GeneratedTrees'.
|
||||
var generatedFileSyntax = runResult.GeneratedTrees.Single(t => t.FilePath.EndsWith("Vector3.g.cs"));
|
||||
|
||||
// Complex generators should be tested using text comparison.
|
||||
Assert.Equal(ExpectedGeneratedClassText, generatedFileSyntax.GetText().ToString(),
|
||||
ignoreLineEndingDifferences: true);
|
||||
}
|
||||
}
|
||||
// using System.Linq;
|
||||
// using Microsoft.CodeAnalysis;
|
||||
// using Microsoft.CodeAnalysis.CSharp;
|
||||
// using Xunit;
|
||||
//
|
||||
// namespace InfraGens.Tests;
|
||||
//
|
||||
// public class SampleIncrementalSourceGeneratorTests
|
||||
// {
|
||||
// private const string VectorClassText = @"
|
||||
// namespace TestNamespace;
|
||||
//
|
||||
// [Generators.Report]
|
||||
// public partial class Vector3
|
||||
// {
|
||||
// public float X { get; set; }
|
||||
// public float Y { get; set; }
|
||||
// public float Z { get; set; }
|
||||
// }";
|
||||
//
|
||||
// private const string ExpectedGeneratedClassText = @"// <auto-generated/>
|
||||
//
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
//
|
||||
// namespace TestNamespace;
|
||||
//
|
||||
// partial class Vector3
|
||||
// {
|
||||
// public IEnumerable<string> Report()
|
||||
// {
|
||||
// yield return $""X:{this.X}"";
|
||||
// yield return $""Y:{this.Y}"";
|
||||
// yield return $""Z:{this.Z}"";
|
||||
// }
|
||||
// }
|
||||
// ";
|
||||
//
|
||||
// [Fact]
|
||||
// public void GenerateReportMethod()
|
||||
// {
|
||||
// // Create an instance of the source generator.
|
||||
// var generator = new SampleIncrementalSourceGenerator();
|
||||
//
|
||||
// // Source generators should be tested using 'GeneratorDriver'.
|
||||
// var driver = CSharpGeneratorDriver.Create(generator);
|
||||
//
|
||||
// // We need to create a compilation with the required source code.
|
||||
// var compilation = CSharpCompilation.Create(nameof(SampleSourceGeneratorTests),
|
||||
// new[] { CSharpSyntaxTree.ParseText(VectorClassText) },
|
||||
// new[]
|
||||
// {
|
||||
// // To support 'System.Attribute' inheritance, add reference to 'System.Private.CoreLib'.
|
||||
// MetadataReference.CreateFromFile(typeof(object).Assembly.Location)
|
||||
// });
|
||||
//
|
||||
// // Run generators and retrieve all results.
|
||||
// var runResult = driver.RunGenerators(compilation).GetRunResult();
|
||||
//
|
||||
// // All generated files can be found in 'RunResults.GeneratedTrees'.
|
||||
// var generatedFileSyntax = runResult.GeneratedTrees.Single(t => t.FilePath.EndsWith("Vector3.g.cs"));
|
||||
//
|
||||
// // Complex generators should be tested using text comparison.
|
||||
// Assert.Equal(ExpectedGeneratedClassText, generatedFileSyntax.GetText().ToString(),
|
||||
// ignoreLineEndingDifferences: true);
|
||||
// }
|
||||
// }
|
||||
+48
-48
@@ -1,48 +1,48 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using InfraGens.Tests.Utils;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Xunit;
|
||||
|
||||
namespace InfraGens.Tests;
|
||||
|
||||
public class SampleSourceGeneratorTests
|
||||
{
|
||||
private const string DddRegistryText = @"User
|
||||
Document
|
||||
Customer";
|
||||
|
||||
[Fact]
|
||||
public void GenerateClassesBasedOnDDDRegistry()
|
||||
{
|
||||
// Create an instance of the source generator.
|
||||
var generator = new SampleSourceGenerator();
|
||||
|
||||
// Source generators should be tested using 'GeneratorDriver'.
|
||||
var driver = CSharpGeneratorDriver.Create(new[] { generator },
|
||||
new[]
|
||||
{
|
||||
// Add the additional file separately from the compilation.
|
||||
new TestAdditionalFile("./DDD.UbiquitousLanguageRegistry.txt", DddRegistryText)
|
||||
});
|
||||
|
||||
// To run generators, we can use an empty compilation.
|
||||
var compilation = CSharpCompilation.Create(nameof(SampleSourceGeneratorTests));
|
||||
|
||||
// Run generators. Don't forget to use the new compilation rather than the previous one.
|
||||
driver.RunGeneratorsAndUpdateCompilation(compilation, out var newCompilation, out _);
|
||||
|
||||
// Retrieve all files in the compilation.
|
||||
var generatedFiles = newCompilation.SyntaxTrees
|
||||
.Select(t => Path.GetFileName(t.FilePath))
|
||||
.ToArray();
|
||||
|
||||
// In this case, it is enough to check the file name.
|
||||
Assert.Equivalent(new[]
|
||||
{
|
||||
"User.g.cs",
|
||||
"Document.g.cs",
|
||||
"Customer.g.cs"
|
||||
}, generatedFiles);
|
||||
}
|
||||
}
|
||||
// using System.IO;
|
||||
// using System.Linq;
|
||||
// using InfraGens.Tests.Utils;
|
||||
// using Microsoft.CodeAnalysis.CSharp;
|
||||
// using Xunit;
|
||||
//
|
||||
// namespace InfraGens.Tests;
|
||||
//
|
||||
// public class SampleSourceGeneratorTests
|
||||
// {
|
||||
// private const string DddRegistryText = @"User
|
||||
// Document
|
||||
// Customer";
|
||||
//
|
||||
// [Fact]
|
||||
// public void GenerateClassesBasedOnDDDRegistry()
|
||||
// {
|
||||
// // Create an instance of the source generator.
|
||||
// var generator = new SampleSourceGenerator();
|
||||
//
|
||||
// // Source generators should be tested using 'GeneratorDriver'.
|
||||
// var driver = CSharpGeneratorDriver.Create(new[] { generator },
|
||||
// new[]
|
||||
// {
|
||||
// // Add the additional file separately from the compilation.
|
||||
// new TestAdditionalFile("./DDD.UbiquitousLanguageRegistry.txt", DddRegistryText)
|
||||
// });
|
||||
//
|
||||
// // To run generators, we can use an empty compilation.
|
||||
// var compilation = CSharpCompilation.Create(nameof(SampleSourceGeneratorTests));
|
||||
//
|
||||
// // Run generators. Don't forget to use the new compilation rather than the previous one.
|
||||
// driver.RunGeneratorsAndUpdateCompilation(compilation, out var newCompilation, out _);
|
||||
//
|
||||
// // Retrieve all files in the compilation.
|
||||
// var generatedFiles = newCompilation.SyntaxTrees
|
||||
// .Select(t => Path.GetFileName(t.FilePath))
|
||||
// .ToArray();
|
||||
//
|
||||
// // In this case, it is enough to check the file name.
|
||||
// Assert.Equivalent(new[]
|
||||
// {
|
||||
// "User.g.cs",
|
||||
// "Document.g.cs",
|
||||
// "Customer.g.cs"
|
||||
// }, generatedFiles);
|
||||
// }
|
||||
// }
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+1
-1
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("InfraGens.Tests")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a3cd3e86a161e3ee450256b1b37c6a4583c70840")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a4090547509ba65f8ba7b22442c10d06c15217e0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("InfraGens.Tests")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("InfraGens.Tests")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
3aaef13ccdf955618089a7e1ba10db7b8d2ba79b04ae43d5944eef576921c84f
|
||||
cf82c0056596f228da5d08a995ac5821d42f1b461d942f674b0df67c66b18b23
|
||||
BIN
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
20dcaaedf8813ada1140488db29aa1ef6413aa5836273f056027b0a8f617abb7
|
||||
8f325882fdd7784b4c5a3360ebb617469b9c9290716a5f0b739ae2afc4f6b0fa
|
||||
+211
@@ -209,3 +209,214 @@ A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Tests\ob
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Tests\obj\Debug\net8.0\InfraGens.Tests.pdb
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Tests\obj\Debug\net8.0\InfraGens.Tests.genruntimeconfig.cache
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Tests\obj\Debug\net8.0\ref\InfraGens.Tests.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\testhost.exe
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\testhost.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\xunit.runner.visualstudio.dotnetcore.testadapter.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\xunit.runner.reporters.netcoreapp10.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\xunit.runner.utility.netcoreapp10.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\InfraGens.Tests.deps.json
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\InfraGens.Tests.runtimeconfig.json
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\InfraGens.Tests.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\InfraGens.Tests.pdb
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\DiffPlex.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Humanizer.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.Bcl.AsyncInterfaces.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.CodeAnalysis.Analyzer.Testing.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.CodeAnalysis.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.CodeAnalysis.CSharp.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.XUnit.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.CodeAnalysis.CSharp.Workspaces.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.CodeAnalysis.SourceGenerators.Testing.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.CodeAnalysis.Testing.Verifiers.XUnit.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.CodeAnalysis.Workspaces.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.VisualStudio.CodeCoverage.Shim.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.TestPlatform.CoreUtilities.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.TestPlatform.PlatformAbstractions.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.TestPlatform.CommunicationUtilities.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.TestPlatform.CrossPlatEngine.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.TestPlatform.Utilities.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.VisualStudio.TestPlatform.Common.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.VisualBasic.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.VisualStudio.Composition.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.VisualStudio.Composition.NetFxAttributes.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Microsoft.VisualStudio.Validation.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\Newtonsoft.Json.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\NuGet.Common.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\NuGet.Configuration.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\NuGet.Frameworks.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\NuGet.Packaging.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\NuGet.Protocol.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\NuGet.Resolver.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\NuGet.Versioning.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\System.ComponentModel.Composition.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\System.Composition.AttributedModel.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\System.Composition.Convention.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\System.Composition.Hosting.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\System.Composition.Runtime.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\System.Composition.TypedParts.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\System.IO.Pipelines.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\System.Security.Permissions.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\xunit.abstractions.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\xunit.assert.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\xunit.core.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\xunit.execution.dotnet.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\cs\Microsoft.CodeAnalysis.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\de\Microsoft.CodeAnalysis.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\es\Microsoft.CodeAnalysis.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\fr\Microsoft.CodeAnalysis.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\it\Microsoft.CodeAnalysis.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ja\Microsoft.CodeAnalysis.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ko\Microsoft.CodeAnalysis.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pl\Microsoft.CodeAnalysis.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pt-BR\Microsoft.CodeAnalysis.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ru\Microsoft.CodeAnalysis.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\tr\Microsoft.CodeAnalysis.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hans\Microsoft.CodeAnalysis.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hant\Microsoft.CodeAnalysis.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\cs\Microsoft.CodeAnalysis.CSharp.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\de\Microsoft.CodeAnalysis.CSharp.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\es\Microsoft.CodeAnalysis.CSharp.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\fr\Microsoft.CodeAnalysis.CSharp.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\it\Microsoft.CodeAnalysis.CSharp.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ja\Microsoft.CodeAnalysis.CSharp.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ko\Microsoft.CodeAnalysis.CSharp.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pl\Microsoft.CodeAnalysis.CSharp.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pt-BR\Microsoft.CodeAnalysis.CSharp.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ru\Microsoft.CodeAnalysis.CSharp.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\tr\Microsoft.CodeAnalysis.CSharp.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hans\Microsoft.CodeAnalysis.CSharp.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hant\Microsoft.CodeAnalysis.CSharp.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\cs\Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\de\Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\es\Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\fr\Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\it\Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ja\Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ko\Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pl\Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pt-BR\Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ru\Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\tr\Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hans\Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hant\Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\cs\Microsoft.CodeAnalysis.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\de\Microsoft.CodeAnalysis.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\es\Microsoft.CodeAnalysis.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\fr\Microsoft.CodeAnalysis.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\it\Microsoft.CodeAnalysis.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ja\Microsoft.CodeAnalysis.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ko\Microsoft.CodeAnalysis.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pl\Microsoft.CodeAnalysis.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pt-BR\Microsoft.CodeAnalysis.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ru\Microsoft.CodeAnalysis.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\tr\Microsoft.CodeAnalysis.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hans\Microsoft.CodeAnalysis.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hant\Microsoft.CodeAnalysis.Workspaces.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\cs\Microsoft.TestPlatform.CoreUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\cs\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\de\Microsoft.TestPlatform.CoreUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\de\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\es\Microsoft.TestPlatform.CoreUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\es\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\fr\Microsoft.TestPlatform.CoreUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\fr\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\it\Microsoft.TestPlatform.CoreUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\it\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ja\Microsoft.TestPlatform.CoreUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ja\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ko\Microsoft.TestPlatform.CoreUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ko\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pl\Microsoft.TestPlatform.CoreUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pl\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pt-BR\Microsoft.TestPlatform.CoreUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pt-BR\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ru\Microsoft.TestPlatform.CoreUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ru\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\tr\Microsoft.TestPlatform.CoreUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\tr\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hans\Microsoft.TestPlatform.CoreUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hans\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hant\Microsoft.TestPlatform.CoreUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hant\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\cs\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\cs\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\cs\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\de\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\de\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\de\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\es\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\es\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\es\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\fr\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\fr\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\fr\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\it\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\it\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\it\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ja\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ja\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ja\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ko\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ko\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ko\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pl\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pl\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pl\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pt-BR\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pt-BR\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pt-BR\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ru\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ru\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ru\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\tr\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\tr\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\tr\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hans\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hans\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hans\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hant\Microsoft.TestPlatform.CommunicationUtilities.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hant\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hant\Microsoft.VisualStudio.TestPlatform.Common.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\cs\Microsoft.VisualStudio.Composition.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\de\Microsoft.VisualStudio.Composition.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\es\Microsoft.VisualStudio.Composition.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\fr\Microsoft.VisualStudio.Composition.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\it\Microsoft.VisualStudio.Composition.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ja\Microsoft.VisualStudio.Composition.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ko\Microsoft.VisualStudio.Composition.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pl\Microsoft.VisualStudio.Composition.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pt-BR\Microsoft.VisualStudio.Composition.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ru\Microsoft.VisualStudio.Composition.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\tr\Microsoft.VisualStudio.Composition.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hans\Microsoft.VisualStudio.Composition.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hant\Microsoft.VisualStudio.Composition.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\cs\Microsoft.VisualStudio.Validation.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\de\Microsoft.VisualStudio.Validation.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\es\Microsoft.VisualStudio.Validation.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\fr\Microsoft.VisualStudio.Validation.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\it\Microsoft.VisualStudio.Validation.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ja\Microsoft.VisualStudio.Validation.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ko\Microsoft.VisualStudio.Validation.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pl\Microsoft.VisualStudio.Validation.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\pt-BR\Microsoft.VisualStudio.Validation.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\ru\Microsoft.VisualStudio.Validation.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\tr\Microsoft.VisualStudio.Validation.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hans\Microsoft.VisualStudio.Validation.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\zh-Hant\Microsoft.VisualStudio.Validation.resources.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\runtimes\unix\lib\netstandard1.3\System.Security.Cryptography.ProtectedData.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\runtimes\win\lib\netstandard1.3\System.Security.Cryptography.ProtectedData.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\InfraGens.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\bin\Debug\net8.0\InfraGens.pdb
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\obj\Debug\net8.0\InfraGens.Tests.csproj.AssemblyReference.cache
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\obj\Debug\net8.0\InfraGens.Tests.GeneratedMSBuildEditorConfig.editorconfig
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\obj\Debug\net8.0\InfraGens.Tests.AssemblyInfoInputs.cache
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\obj\Debug\net8.0\InfraGens.Tests.AssemblyInfo.cs
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\obj\Debug\net8.0\InfraGens.Tests.csproj.CoreCompileInputs.cache
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\obj\Debug\net8.0\InfraGen.322FFEE7.Up2Date
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\obj\Debug\net8.0\InfraGens.Tests.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\obj\Debug\net8.0\refint\InfraGens.Tests.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\obj\Debug\net8.0\InfraGens.Tests.pdb
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\obj\Debug\net8.0\InfraGens.Tests.genruntimeconfig.cache
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Tests\obj\Debug\net8.0\ref\InfraGens.Tests.dll
|
||||
BIN
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
7487cbb514ed8b26b20736e904ac9d522da435f685dccb560d0039466b4510a2
|
||||
027bd187cd72f6bda8e68f2bf08397d4be588fbf68a9b00c748fd972a7cd0f41
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
|
||||
public class StateMachine : Attribute
|
||||
{
|
||||
public Type StateMachineContextType;
|
||||
public Type StateMachineEnumType;
|
||||
|
||||
public StateMachine(Type stateMachineContextType, Type stateMachineEnumType)
|
||||
{
|
||||
StateMachineContextType = stateMachineContextType;
|
||||
StateMachineEnumType = stateMachineEnumType;
|
||||
}
|
||||
}
|
||||
|
||||
public class State : Attribute
|
||||
{
|
||||
public Type StateEnum;
|
||||
public Type StateMachineContext;
|
||||
public bool SilentBitch; // Поэтому нейминг переменных очень важен
|
||||
|
||||
public State(Type stateEnum, Type stateMachineContext, bool silentBitch = false)
|
||||
{
|
||||
StateEnum = stateEnum;
|
||||
StateMachineContext = stateMachineContext;
|
||||
SilentBitch = silentBitch;
|
||||
}
|
||||
}
|
||||
|
||||
public class StateRaisingEvent : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public class Config : Attribute
|
||||
{
|
||||
public bool Multiple;
|
||||
public string MenuName;
|
||||
|
||||
public Config(string menuName, bool multiple = false)
|
||||
{
|
||||
Multiple = multiple;
|
||||
MenuName = menuName;
|
||||
}
|
||||
}
|
||||
|
||||
public class ToConfig : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public class SceneIdEnum : Attribute
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,399 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
|
||||
[Generator]
|
||||
public class StateMachineGenerator : IIncrementalGenerator
|
||||
{
|
||||
public void Initialize(IncrementalGeneratorInitializationContext context)
|
||||
{
|
||||
// 1. Собираем все типы с атрибутом [StateMachine]
|
||||
var stateMachineTypes = context.SyntaxProvider
|
||||
.CreateSyntaxProvider(
|
||||
predicate: static (s, _) => IsStateMachineCandidate(s),
|
||||
transform: static (ctx, _) => GetStateMachineType(ctx))
|
||||
.Where(static m => m is not null)
|
||||
.Collect();
|
||||
|
||||
// 2. Собираем все типы с атрибутом [State]
|
||||
var stateTypes = context.SyntaxProvider
|
||||
.CreateSyntaxProvider(
|
||||
predicate: static (s, _) => IsStateCandidate(s),
|
||||
transform: static (ctx, _) => GetStateType(ctx))
|
||||
.Where(static m => m is not null)
|
||||
.Collect();
|
||||
|
||||
// 3. Получаем компиляцию для семантического анализа
|
||||
var compilation = context.CompilationProvider;
|
||||
|
||||
// 4. Объединяем все данные
|
||||
var combinedData = stateMachineTypes.Combine(stateTypes).Combine(compilation);
|
||||
|
||||
// 5. Регистрируем генерацию кода
|
||||
context.RegisterSourceOutput(combinedData, static (spc, source) =>
|
||||
Execute(spc, source.Left.Left, source.Left.Right, source.Right));
|
||||
}
|
||||
|
||||
private static bool IsStateMachineCandidate(SyntaxNode node)
|
||||
{
|
||||
return node is ClassDeclarationSyntax classDecl &&
|
||||
classDecl.AttributeLists.Count > 0;
|
||||
}
|
||||
|
||||
private static bool IsStateCandidate(SyntaxNode node)
|
||||
{
|
||||
return node is ClassDeclarationSyntax classDecl &&
|
||||
classDecl.AttributeLists.Count > 0;
|
||||
}
|
||||
|
||||
private static INamedTypeSymbol? GetStateMachineType(GeneratorSyntaxContext context)
|
||||
{
|
||||
var classDecl = (ClassDeclarationSyntax)context.Node;
|
||||
var classSymbol = context.SemanticModel.GetDeclaredSymbol(classDecl);
|
||||
|
||||
if (classSymbol == null) return null;
|
||||
|
||||
// Проверяем наличие атрибута [StateMachine]
|
||||
var stateMachineAttribute = context.SemanticModel.Compilation.GetTypeByMetadataName("StateMachine");
|
||||
if (stateMachineAttribute == null) return null;
|
||||
|
||||
return classSymbol.GetAttributes()
|
||||
.Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, stateMachineAttribute))
|
||||
? classSymbol
|
||||
: null;
|
||||
}
|
||||
|
||||
private static INamedTypeSymbol? GetStateType(GeneratorSyntaxContext context)
|
||||
{
|
||||
var classDecl = (ClassDeclarationSyntax)context.Node;
|
||||
var classSymbol = context.SemanticModel.GetDeclaredSymbol(classDecl);
|
||||
|
||||
if (classSymbol == null) return null;
|
||||
|
||||
// Проверяем наличие атрибута [State]
|
||||
var stateAttribute = context.SemanticModel.Compilation.GetTypeByMetadataName("State");
|
||||
if (stateAttribute == null) return null;
|
||||
|
||||
return classSymbol.GetAttributes()
|
||||
.Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, stateAttribute))
|
||||
? classSymbol
|
||||
: null;
|
||||
}
|
||||
|
||||
private static void Execute(
|
||||
SourceProductionContext context,
|
||||
ImmutableArray<INamedTypeSymbol> stateMachineTypes,
|
||||
ImmutableArray<INamedTypeSymbol> stateTypes,
|
||||
Compilation compilation)
|
||||
{
|
||||
if (stateMachineTypes.IsDefaultOrEmpty && stateTypes.IsDefaultOrEmpty)
|
||||
return;
|
||||
|
||||
var validStateMachines = stateMachineTypes.Where(t => t != null).ToList();
|
||||
var validStates = stateTypes.Where(t => t != null).ToList();
|
||||
|
||||
if (!validStateMachines.Any() && !validStates.Any())
|
||||
return;
|
||||
|
||||
// Получаем символы атрибутов
|
||||
var stateMachineAttributeSymbol = compilation.GetTypeByMetadataName("StateMachine");
|
||||
var stateAttributeSymbol = compilation.GetTypeByMetadataName("State");
|
||||
var stateRaisingEventAttributeSymbol = compilation.GetTypeByMetadataName("StateRaisingEvent");
|
||||
|
||||
if (stateMachineAttributeSymbol == null || stateAttributeSymbol == null)
|
||||
{
|
||||
context.ReportDiagnostic(Diagnostic.Create(
|
||||
new DiagnosticDescriptor("SMG001", "Missing attributes",
|
||||
"StateMachine or State attributes not found", "StateMachine", DiagnosticSeverity.Error, true),
|
||||
Location.None));
|
||||
return;
|
||||
}
|
||||
|
||||
// Генерируем код для StateMachine и States
|
||||
GenerateStateClasses(context, validStates, stateAttributeSymbol, stateRaisingEventAttributeSymbol, compilation);
|
||||
GenerateStateMachineClasses(context, validStateMachines, validStates, stateMachineAttributeSymbol, stateAttributeSymbol, compilation);
|
||||
}
|
||||
|
||||
private static void GenerateStateMachineClasses(
|
||||
SourceProductionContext context,
|
||||
List<INamedTypeSymbol> stateMachines,
|
||||
List<INamedTypeSymbol> allStates,
|
||||
INamedTypeSymbol stateMachineAttributeSymbol,
|
||||
INamedTypeSymbol stateAttributeSymbol,
|
||||
Compilation compilation)
|
||||
{
|
||||
// if (allStates.Count == 0) throw new Exception("RETARDED");
|
||||
foreach (var sm in stateMachines)
|
||||
{
|
||||
// Получаем параметры атрибута [StateMachine]
|
||||
var smAttribute = sm.GetAttributes()
|
||||
.FirstOrDefault(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, stateMachineAttributeSymbol));
|
||||
|
||||
if (smAttribute == null) continue;
|
||||
|
||||
var stateMachineContextType = GetNamedTypeArgument(smAttribute, "StateMachineContextType");
|
||||
var stateMachineEnumType = GetNamedTypeArgument(smAttribute, "StateMachineEnumType");
|
||||
|
||||
if (stateMachineContextType == null || stateMachineEnumType == null)
|
||||
{
|
||||
context.ReportDiagnostic(Diagnostic.Create(
|
||||
new DiagnosticDescriptor("SMG002", "Invalid StateMachine attribute",
|
||||
$"StateMachine {sm.Name} has invalid attribute parameters", "StateMachine", DiagnosticSeverity.Error, true),
|
||||
sm.Locations.FirstOrDefault()));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Находим все states для этого state machine
|
||||
var statesForThisMachine = allStates
|
||||
.Where(st =>
|
||||
{
|
||||
var stAttribute = st.GetAttributes()
|
||||
.FirstOrDefault(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, stateAttributeSymbol));
|
||||
|
||||
if (stAttribute == null) return false;
|
||||
|
||||
var stContextType = GetNamedTypeArgument(stAttribute, "StateMachineEnumType"); // БЛЯТЬ ИДИ НАХУЙ ПИДАРАС ТРАНСВИСТИТНЫЙ ПИЗДУЙ В ТАЙЛАНД
|
||||
// Сравниваем по полному имени типа, как в оригинальном коде
|
||||
return stContextType != null &&
|
||||
stContextType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) ==
|
||||
stateMachineContextType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
|
||||
})
|
||||
.ToList();
|
||||
|
||||
// Собираем пространства имен для states
|
||||
var stateNamespaces = new HashSet<string>();
|
||||
foreach (var st in statesForThisMachine)
|
||||
{
|
||||
if (st.ContainingNamespace != null && !st.ContainingNamespace.IsGlobalNamespace)
|
||||
{
|
||||
stateNamespaces.Add(st.ContainingNamespace.ToDisplayString());
|
||||
}
|
||||
}
|
||||
|
||||
// Отладка: проверяем, найдены ли стейты
|
||||
if (statesForThisMachine.Count == 0)
|
||||
{
|
||||
context.ReportDiagnostic(Diagnostic.Create(
|
||||
new DiagnosticDescriptor("SMG004", "No states found",
|
||||
$"No states found for StateMachine {sm.Name} with context {stateMachineContextType.Name}",
|
||||
"StateMachine", DiagnosticSeverity.Warning, true),
|
||||
sm.Locations.FirstOrDefault()));
|
||||
}
|
||||
|
||||
// Генерируем код для StateMachine
|
||||
var stateMachineCode = GenerateStateMachineClassCode(
|
||||
sm, stateMachineContextType, stateMachineEnumType, statesForThisMachine, stateNamespaces);
|
||||
|
||||
var fileName = $"{sm.ContainingNamespace?.ToDisplayString() ?? ""}.{sm.Name}.StateMachine.Generated.cs"
|
||||
.Replace("<", "_").Replace(">", "_").Replace("+", "_");
|
||||
|
||||
context.AddSource(fileName, SourceText.From(stateMachineCode, Encoding.UTF8));
|
||||
}
|
||||
}
|
||||
|
||||
private static void GenerateStateClasses(
|
||||
SourceProductionContext context,
|
||||
List<INamedTypeSymbol> states,
|
||||
INamedTypeSymbol stateAttributeSymbol,
|
||||
INamedTypeSymbol? stateRaisingEventAttributeSymbol,
|
||||
Compilation compilation)
|
||||
{
|
||||
foreach (var st in states)
|
||||
{
|
||||
var stateAttribute = st.GetAttributes()
|
||||
.FirstOrDefault(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, stateAttributeSymbol));
|
||||
|
||||
if (stateAttribute == null) continue;
|
||||
|
||||
var stateEnumType = GetNamedTypeArgument(stateAttribute, "StateEnum");
|
||||
var stateMachineContextType = GetNamedTypeArgument(stateAttribute, "StateMachineContext");
|
||||
var isSilent = GetBooleanArgument(stateAttribute, "SilentBitch");
|
||||
var hasRaisingEvent = stateRaisingEventAttributeSymbol != null &&
|
||||
st.HasAttribute(stateRaisingEventAttributeSymbol);
|
||||
|
||||
if (stateEnumType == null || stateMachineContextType == null)
|
||||
{
|
||||
context.ReportDiagnostic(Diagnostic.Create(
|
||||
new DiagnosticDescriptor("SMG003", "Invalid State attribute",
|
||||
$"State {st.Name} has invalid attribute parameters", "StateMachine", DiagnosticSeverity.Error, true),
|
||||
st.Locations.FirstOrDefault()));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Генерируем код для State
|
||||
var stateCode = GenerateStateClassCode(
|
||||
st, stateEnumType, stateMachineContextType, isSilent, hasRaisingEvent);
|
||||
|
||||
var fileName = $"{st.ContainingNamespace?.ToDisplayString() ?? ""}.{st.Name}.State.Generated.cs"
|
||||
.Replace("<", "_").Replace(">", "_").Replace("+", "_");
|
||||
|
||||
context.AddSource(fileName, SourceText.From(stateCode, Encoding.UTF8));
|
||||
}
|
||||
}
|
||||
|
||||
private static string GenerateStateMachineClassCode(
|
||||
INamedTypeSymbol sm,
|
||||
INamedTypeSymbol contextType,
|
||||
INamedTypeSymbol enumType,
|
||||
List<INamedTypeSymbol> states,
|
||||
HashSet<string> stateNamespaces)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine("// <auto-generated/>");
|
||||
sb.AppendLine("#pragma warning disable CS0105");
|
||||
sb.AppendLine("using Code.Infrastructure.StateMachine;");
|
||||
|
||||
// Добавляем using для всех пространств имен states
|
||||
foreach (var ns in stateNamespaces.OrderBy(n => n))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ns) && ns != sm.ContainingNamespace?.ToDisplayString())
|
||||
{
|
||||
sb.AppendLine($"using {ns};");
|
||||
}
|
||||
}
|
||||
|
||||
sb.AppendLine("#pragma warning restore CS0105");
|
||||
sb.AppendLine();
|
||||
|
||||
if (sm.ContainingNamespace != null && !sm.ContainingNamespace.IsGlobalNamespace)
|
||||
{
|
||||
sb.AppendLine($"namespace {sm.ContainingNamespace.ToDisplayString()}");
|
||||
sb.AppendLine("{");
|
||||
}
|
||||
|
||||
sb.AppendLine($"public partial class {sm.Name} : AbstractStateMachine<{enumType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}, {contextType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}>");
|
||||
sb.AppendLine("{");
|
||||
|
||||
// Конструктор с добавлением всех стейтов
|
||||
sb.AppendLine($" public {sm.Name}({contextType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)} context, EventBus.EventBus eventBus) : base(context)");
|
||||
sb.AppendLine(" {");
|
||||
|
||||
if (states.Count == 0) sb.AppendLine("//I am retarded");
|
||||
foreach (var state in states)
|
||||
{
|
||||
sb.AppendLine($" var state{state.Name} = new {state.Name}(StateMachineContext, eventBus);");
|
||||
sb.AppendLine($" States.Add(state{state.Name}.myState, state{state.Name});");
|
||||
}
|
||||
|
||||
sb.AppendLine(" }");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine($" protected override bool CheckTransitionAllowed({enumType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)} nextState) => AllowedStates.HasFlag(nextState);");
|
||||
sb.AppendLine(" protected override void ResetAllowedTransitions() => AllowedStates = 0;");
|
||||
sb.AppendLine("}");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine($"public static class {sm.Name}Extensions");
|
||||
sb.AppendLine("{");
|
||||
sb.AppendLine($" public static AbstractStateMachine<{enumType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}, {contextType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}> AllowStateTransition(");
|
||||
sb.AppendLine($" this AbstractStateMachine<{enumType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}, {contextType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}> stateMachine, {enumType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)} state)");
|
||||
sb.AppendLine(" {");
|
||||
sb.AppendLine(" if (stateMachine == null) return null;");
|
||||
sb.AppendLine(" stateMachine.AllowedStates |= state;");
|
||||
sb.AppendLine(" return stateMachine;");
|
||||
sb.AppendLine(" }");
|
||||
sb.AppendLine("}");
|
||||
|
||||
if (sm.ContainingNamespace != null && !sm.ContainingNamespace.IsGlobalNamespace)
|
||||
{
|
||||
sb.AppendLine("}");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static string GenerateStateClassCode(
|
||||
INamedTypeSymbol state,
|
||||
INamedTypeSymbol stateEnumType,
|
||||
INamedTypeSymbol contextType,
|
||||
bool isSilent,
|
||||
bool hasRaisingEvent)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine("// <auto-generated/>");
|
||||
sb.AppendLine("using Code.Infrastructure.StateMachine;");
|
||||
sb.AppendLine();
|
||||
|
||||
if (state.ContainingNamespace != null && !state.ContainingNamespace.IsGlobalNamespace)
|
||||
{
|
||||
sb.AppendLine($"namespace {state.ContainingNamespace.ToDisplayString()}");
|
||||
sb.AppendLine("{");
|
||||
}
|
||||
|
||||
var fireStatesCode = "";
|
||||
if (hasRaisingEvent)
|
||||
{
|
||||
fireStatesCode = $@"
|
||||
protected override void _fireEnterState()
|
||||
{{
|
||||
EventBus.RaiseEvent<IEnterStateHandle<{state.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}>>(h => h.EnterState());
|
||||
}}
|
||||
|
||||
protected override void _fireExitState()
|
||||
{{
|
||||
EventBus.RaiseEvent<IExitStateHandle<{state.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}>>(h => h.ExitState());
|
||||
}}
|
||||
";
|
||||
}
|
||||
|
||||
var genetics = "";
|
||||
if (!isSilent)
|
||||
{
|
||||
// ИСПРАВЛЕНО: Поменяны местами аргументы шаблона - сначала контекст, потом enum
|
||||
genetics = $@" : BaseState<{contextType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}, {stateEnumType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}>";
|
||||
}
|
||||
|
||||
sb.AppendLine($"public partial class {state.Name}{genetics}");
|
||||
sb.AppendLine("{");
|
||||
sb.AppendLine(fireStatesCode);
|
||||
sb.AppendLine("}");
|
||||
|
||||
if (state.ContainingNamespace != null && !state.ContainingNamespace.IsGlobalNamespace)
|
||||
{
|
||||
sb.AppendLine("}");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static INamedTypeSymbol? GetNamedTypeArgument(AttributeData attribute, string argumentName)
|
||||
{
|
||||
// Проверяем именованные аргументы
|
||||
foreach (var namedArg in attribute.NamedArguments)
|
||||
{
|
||||
if (namedArg.Key == argumentName && namedArg.Value.Value is INamedTypeSymbol namedType)
|
||||
return namedType;
|
||||
}
|
||||
|
||||
// Проверяем конструкторные аргументы
|
||||
var constructorArgs = attribute.ConstructorArguments;
|
||||
if (constructorArgs.Length >= 2 && constructorArgs[0].Value is INamedTypeSymbol firstType &&
|
||||
constructorArgs[1].Value is INamedTypeSymbol secondType)
|
||||
{
|
||||
// Для StateMachineAttribute и StateAttribute порядок параметров в конструкторе:
|
||||
// [StateMachine(typeof(ContextType), typeof(EnumType))]
|
||||
// [State(typeof(ContextType), typeof(EnumType))]
|
||||
if (argumentName == "StateMachineContextType" || argumentName == "StateMachineContext")
|
||||
return firstType;
|
||||
if (argumentName == "StateMachineEnumType" || argumentName == "StateEnum")
|
||||
return secondType;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static bool GetBooleanArgument(AttributeData attribute, string argumentName)
|
||||
{
|
||||
foreach (var namedArg in attribute.NamedArguments)
|
||||
{
|
||||
if (namedArg.Key == argumentName && namedArg.Value.Value is bool boolValue)
|
||||
return boolValue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+310
-96
@@ -1,130 +1,344 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
|
||||
|
||||
namespace InfraGens;
|
||||
|
||||
/// <summary>
|
||||
/// A sample source generator that creates a custom report based on class properties. The target class should be annotated with the 'Generators.ReportAttribute' attribute.
|
||||
/// When using the source code as a baseline, an incremental source generator is preferable because it reduces the performance overhead.
|
||||
/// </summary>
|
||||
[Generator]
|
||||
public class SampleIncrementalSourceGenerator : IIncrementalGenerator
|
||||
public class ConfigGenerator : IIncrementalGenerator
|
||||
{
|
||||
private const string Namespace = "Generators";
|
||||
private const string AttributeName = "ReportAttribute";
|
||||
|
||||
private const string AttributeSourceCode = $@"// <auto-generated/>
|
||||
|
||||
namespace {Namespace}
|
||||
{{
|
||||
[System.AttributeUsage(System.AttributeTargets.Class)]
|
||||
public class {AttributeName} : System.Attribute
|
||||
{{
|
||||
}}
|
||||
}}";
|
||||
|
||||
public void Initialize(IncrementalGeneratorInitializationContext context)
|
||||
{
|
||||
// Add the marker attribute to the compilation.
|
||||
context.RegisterPostInitializationOutput(ctx => ctx.AddSource(
|
||||
"ReportAttribute.g.cs",
|
||||
SourceText.From(AttributeSourceCode, Encoding.UTF8)));
|
||||
|
||||
// Filter classes annotated with the [Report] attribute. Only filtered Syntax Nodes can trigger code generation.
|
||||
var provider = context.SyntaxProvider
|
||||
// 1. Собираем все типы с атрибутом [Config]
|
||||
var configTypes = context.SyntaxProvider
|
||||
.CreateSyntaxProvider(
|
||||
(s, _) => s is ClassDeclarationSyntax,
|
||||
(ctx, _) => GetClassDeclarationForSourceGen(ctx))
|
||||
.Where(t => t.reportAttributeFound)
|
||||
.Select((t, _) => t.Item1);
|
||||
predicate: static (s, _) => IsConfigCandidate(s),
|
||||
transform: static (ctx, _) => GetConfigType(ctx))
|
||||
.Where(static m => m is not null)
|
||||
.Collect();
|
||||
|
||||
// Generate the source code.
|
||||
context.RegisterSourceOutput(context.CompilationProvider.Combine(provider.Collect()),
|
||||
((ctx, t) => GenerateCode(ctx, t.Left, t.Right)));
|
||||
// 2. Получаем компиляцию для семантического анализа
|
||||
var compilation = context.CompilationProvider;
|
||||
|
||||
// 3. Объединяем данные и генерируем код
|
||||
var combinedData = configTypes.Combine(compilation);
|
||||
|
||||
context.RegisterSourceOutput(combinedData, static (spc, source) => Execute(spc, source.Left, source.Right));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the Node is annotated with the [Report] attribute and maps syntax context to the specific node type (ClassDeclarationSyntax).
|
||||
/// </summary>
|
||||
/// <param name="context">Syntax context, based on CreateSyntaxProvider predicate</param>
|
||||
/// <returns>The specific cast and whether the attribute was found.</returns>
|
||||
private static (ClassDeclarationSyntax, bool reportAttributeFound) GetClassDeclarationForSourceGen(
|
||||
GeneratorSyntaxContext context)
|
||||
private static bool IsConfigCandidate(SyntaxNode node)
|
||||
{
|
||||
var classDeclarationSyntax = (ClassDeclarationSyntax)context.Node;
|
||||
return node is ClassDeclarationSyntax classDecl &&
|
||||
classDecl.AttributeLists.Count > 0;
|
||||
}
|
||||
|
||||
// Go through all attributes of the class.
|
||||
foreach (AttributeListSyntax attributeListSyntax in classDeclarationSyntax.AttributeLists)
|
||||
foreach (AttributeSyntax attributeSyntax in attributeListSyntax.Attributes)
|
||||
private static INamedTypeSymbol? GetConfigType(GeneratorSyntaxContext context)
|
||||
{
|
||||
var classDecl = (ClassDeclarationSyntax)context.Node;
|
||||
var classSymbol = context.SemanticModel.GetDeclaredSymbol(classDecl);
|
||||
|
||||
if (classSymbol == null) return null;
|
||||
|
||||
// Проверяем наличие атрибута [Config]
|
||||
var configAttribute = context.SemanticModel.Compilation.GetTypeByMetadataName("Config");
|
||||
if (configAttribute == null) return null;
|
||||
|
||||
return classSymbol.GetAttributes()
|
||||
.Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, configAttribute))
|
||||
? classSymbol
|
||||
: null;
|
||||
}
|
||||
|
||||
private static void Execute(SourceProductionContext context, ImmutableArray<INamedTypeSymbol> configTypes,
|
||||
Compilation compilation)
|
||||
{
|
||||
if (configTypes.IsDefaultOrEmpty) return;
|
||||
|
||||
var validConfigTypes = configTypes.Where(t => t != null).ToList();
|
||||
if (!validConfigTypes.Any()) return;
|
||||
|
||||
var configAttributeSymbol = compilation.GetTypeByMetadataName("Config");
|
||||
var toConfigAttributeSymbol = compilation.GetTypeByMetadataName("ToConfig");
|
||||
|
||||
if (configAttributeSymbol == null || toConfigAttributeSymbol == null)
|
||||
{
|
||||
if (context.SemanticModel.GetSymbolInfo(attributeSyntax).Symbol is not IMethodSymbol attributeSymbol)
|
||||
continue; // if we can't get the symbol, ignore it
|
||||
|
||||
string attributeName = attributeSymbol.ContainingType.ToDisplayString();
|
||||
|
||||
// Check the full name of the [Report] attribute.
|
||||
if (attributeName == $"{Namespace}.{AttributeName}")
|
||||
return (classDeclarationSyntax, true);
|
||||
context.ReportDiagnostic(Diagnostic.Create(
|
||||
new DiagnosticDescriptor("CFG001", "Missing attributes",
|
||||
"Config or ToConfig attribute not found", "Configuration", DiagnosticSeverity.Error, true),
|
||||
Location.None));
|
||||
return;
|
||||
}
|
||||
|
||||
return (classDeclarationSyntax, false);
|
||||
GenerateConfigFiles(context, validConfigTypes, configAttributeSymbol, toConfigAttributeSymbol, compilation);
|
||||
GenerateConfigLocator(context, validConfigTypes, configAttributeSymbol, compilation);
|
||||
GenerateSystemConfigsReferences(context, validConfigTypes, configAttributeSymbol, compilation);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate code action.
|
||||
/// It will be executed on specific nodes (ClassDeclarationSyntax annotated with the [Report] attribute) changed by the user.
|
||||
/// </summary>
|
||||
/// <param name="context">Source generation context used to add source files.</param>
|
||||
/// <param name="compilation">Compilation used to provide access to the Semantic Model.</param>
|
||||
/// <param name="classDeclarations">Nodes annotated with the [Report] attribute that trigger the generate action.</param>
|
||||
private void GenerateCode(SourceProductionContext context, Compilation compilation,
|
||||
ImmutableArray<ClassDeclarationSyntax> classDeclarations)
|
||||
private static void GenerateConfigFiles(
|
||||
SourceProductionContext context,
|
||||
List<INamedTypeSymbol> configTypes,
|
||||
INamedTypeSymbol configAttributeSymbol,
|
||||
INamedTypeSymbol toConfigAttributeSymbol,
|
||||
Compilation compilation)
|
||||
{
|
||||
// Go through all filtered class declarations.
|
||||
foreach (var classDeclarationSyntax in classDeclarations)
|
||||
foreach (var cfg in configTypes)
|
||||
{
|
||||
// We need to get semantic model of the class to retrieve metadata.
|
||||
var semanticModel = compilation.GetSemanticModel(classDeclarationSyntax.SyntaxTree);
|
||||
var configUsings = new HashSet<string>();
|
||||
var configFields = new StringBuilder();
|
||||
|
||||
// Symbols allow us to get the compile-time information.
|
||||
if (semanticModel.GetDeclaredSymbol(classDeclarationSyntax) is not INamedTypeSymbol classSymbol)
|
||||
continue;
|
||||
// Собираем поля с атрибутом [ToConfig]
|
||||
foreach (var member in cfg.GetMembers().OfType<IFieldSymbol>())
|
||||
{
|
||||
if (member.GetAttributes().Any(attr =>
|
||||
SymbolEqualityComparer.Default.Equals(attr.AttributeClass, toConfigAttributeSymbol)))
|
||||
{
|
||||
// Добавляем namespace типа поля
|
||||
if (member.Type.ContainingNamespace != null &&
|
||||
!member.Type.ContainingNamespace.IsGlobalNamespace)
|
||||
{
|
||||
configUsings.Add($"using {member.Type.ContainingNamespace.ToDisplayString()};");
|
||||
}
|
||||
|
||||
var namespaceName = classSymbol.ContainingNamespace.ToDisplayString();
|
||||
// Генерируем поле
|
||||
var fieldType = GetTypeDisplayName(member.Type, compilation);
|
||||
configFields.AppendLine($"public {fieldType} {member.Name};");
|
||||
}
|
||||
}
|
||||
|
||||
// 'Identifier' means the token of the node. Get class name from the syntax node.
|
||||
var className = classDeclarationSyntax.Identifier.Text;
|
||||
// Добавляем обязательные using для Unity
|
||||
configUsings.Add("using UnityEngine;");
|
||||
configUsings.Add("using UnityEngine.AddressableAssets;");
|
||||
|
||||
// Go through all class members with a particular type (property) to generate method lines.
|
||||
var methodBody = classSymbol.GetMembers()
|
||||
.OfType<IPropertySymbol>()
|
||||
.Select(p =>
|
||||
$@" yield return $""{p.Name}:{{this.{p.Name}}}"";"); // e.g. yield return $"Id:{this.Id}";
|
||||
// Получаем значение атрибута [Config]
|
||||
var configAttribute = cfg.GetAttributes()
|
||||
.FirstOrDefault(attr =>
|
||||
SymbolEqualityComparer.Default.Equals(attr.AttributeClass, configAttributeSymbol));
|
||||
|
||||
// Build up the source code
|
||||
var code = $@"// <auto-generated/>
|
||||
string menuName = "Configuration/Custom";
|
||||
bool isMultiple = false;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
if (configAttribute != null)
|
||||
{
|
||||
var menuNameArg =
|
||||
configAttribute.ConstructorArguments.FirstOrDefault(arg => arg.Type?.Name == "String");
|
||||
if (menuNameArg.Value != null)
|
||||
{
|
||||
menuName = menuNameArg.Value.ToString() ?? menuName;
|
||||
}
|
||||
|
||||
namespace {namespaceName};
|
||||
var multipleArg = configAttribute.NamedArguments.FirstOrDefault(arg => arg.Key == "Multiple");
|
||||
if (multipleArg.Value.Value != null)
|
||||
{
|
||||
isMultiple = (bool)multipleArg.Value.Value;
|
||||
}
|
||||
}
|
||||
|
||||
partial class {className}
|
||||
{{
|
||||
public IEnumerable<string> Report()
|
||||
{{
|
||||
{string.Join("\n", methodBody)}
|
||||
}}
|
||||
}}
|
||||
";
|
||||
// Генерируем код конфига
|
||||
var namespaceName = cfg.ContainingNamespace.IsGlobalNamespace
|
||||
? ""
|
||||
: cfg.ContainingNamespace.ToDisplayString();
|
||||
var className = $"{cfg.Name}Config";
|
||||
var fileName = $"{className}.Generated.cs";
|
||||
|
||||
// Add the source code to the compilation.
|
||||
context.AddSource($"{className}.g.cs", SourceText.From(code, Encoding.UTF8));
|
||||
var configCode = new StringBuilder();
|
||||
configCode.AppendLine("#pragma warning disable CS0105");
|
||||
foreach (var usingDirective in configUsings.OrderBy(u => u))
|
||||
{
|
||||
configCode.AppendLine(usingDirective);
|
||||
}
|
||||
|
||||
configCode.AppendLine("#pragma warning restore CS0105");
|
||||
configCode.AppendLine();
|
||||
|
||||
if (!string.IsNullOrEmpty(namespaceName))
|
||||
{
|
||||
configCode.AppendLine($"namespace {namespaceName}");
|
||||
configCode.AppendLine("{");
|
||||
}
|
||||
|
||||
configCode.AppendLine($"[CreateAssetMenu(fileName = \"{className}\", menuName = \"{menuName}\")]");
|
||||
configCode.AppendLine($"public class {className} : ScriptableObject");
|
||||
configCode.AppendLine("{");
|
||||
configCode.Append(configFields.ToString());
|
||||
configCode.AppendLine("}");
|
||||
|
||||
if (!string.IsNullOrEmpty(namespaceName))
|
||||
{
|
||||
configCode.AppendLine("}");
|
||||
}
|
||||
|
||||
context.AddSource(fileName, configCode.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void GenerateConfigLocator(
|
||||
SourceProductionContext context,
|
||||
List<INamedTypeSymbol> configTypes,
|
||||
INamedTypeSymbol configAttributeSymbol,
|
||||
Compilation compilation)
|
||||
{
|
||||
var configReferencesUsings = new HashSet<string>();
|
||||
var configAddCode = new StringBuilder();
|
||||
|
||||
foreach (var cfg in configTypes)
|
||||
{
|
||||
var namespaceName = cfg.ContainingNamespace.IsGlobalNamespace
|
||||
? ""
|
||||
: cfg.ContainingNamespace.ToDisplayString();
|
||||
if (!string.IsNullOrEmpty(namespaceName))
|
||||
{
|
||||
configReferencesUsings.Add($"using {namespaceName};");
|
||||
}
|
||||
|
||||
var configAttribute = cfg.GetAttributes()
|
||||
.FirstOrDefault(attr =>
|
||||
SymbolEqualityComparer.Default.Equals(attr.AttributeClass, configAttributeSymbol));
|
||||
|
||||
bool isMultiple = false;
|
||||
if (configAttribute != null)
|
||||
{
|
||||
var multipleArg = configAttribute.NamedArguments.FirstOrDefault(arg => arg.Key == "Multiple");
|
||||
if (multipleArg.Value.Value != null)
|
||||
{
|
||||
isMultiple = (bool)multipleArg.Value.Value;
|
||||
}
|
||||
}
|
||||
|
||||
var configClassName = $"{cfg.Name}Config";
|
||||
var fullName = cfg.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)
|
||||
.Replace("global::", "")
|
||||
.Replace("<", "_")
|
||||
.Replace(">", "_");
|
||||
|
||||
if (isMultiple)
|
||||
{
|
||||
configAddCode.AppendLine(
|
||||
$"_multipleConfigReferences.Add(typeof({fullName}Config), systemConfigsReferences.{cfg.Name});");
|
||||
}
|
||||
else
|
||||
{
|
||||
configAddCode.AppendLine(
|
||||
$"_singleConfigReferences.Add(typeof({fullName}Config), systemConfigsReferences.{cfg.Name});");
|
||||
}
|
||||
}
|
||||
|
||||
configReferencesUsings.Add("using UnityEngine;");
|
||||
|
||||
var locatorCode = new StringBuilder();
|
||||
locatorCode.AppendLine("#pragma warning disable CS0105");
|
||||
foreach (var usingDirective in configReferencesUsings.OrderBy(u => u))
|
||||
{
|
||||
locatorCode.AppendLine(usingDirective);
|
||||
}
|
||||
|
||||
locatorCode.AppendLine("#pragma warning restore CS0105");
|
||||
locatorCode.AppendLine();
|
||||
locatorCode.AppendLine("namespace Code.Infrastructure.Configs");
|
||||
locatorCode.AppendLine("{");
|
||||
locatorCode.AppendLine(" public partial class ConfigLocator");
|
||||
locatorCode.AppendLine(" {");
|
||||
locatorCode.AppendLine(" partial void LoadConfigs()");
|
||||
locatorCode.AppendLine(" {");
|
||||
locatorCode.AppendLine(
|
||||
" SystemConfigsReferences systemConfigsReferences = Resources.Load<SystemConfigsReferences>(\"SystemConfigsReferences\");");
|
||||
locatorCode.Append(configAddCode.ToString());
|
||||
locatorCode.AppendLine(" }");
|
||||
locatorCode.AppendLine(" }");
|
||||
locatorCode.AppendLine("}");
|
||||
|
||||
context.AddSource("ConfigLocator.Generated.cs", locatorCode.ToString());
|
||||
}
|
||||
|
||||
private static void GenerateSystemConfigsReferences(
|
||||
SourceProductionContext context,
|
||||
List<INamedTypeSymbol> configTypes,
|
||||
INamedTypeSymbol configAttributeSymbol,
|
||||
Compilation compilation)
|
||||
{
|
||||
var configReferencesUsings = new HashSet<string>();
|
||||
var configReferencesCode = new StringBuilder();
|
||||
|
||||
foreach (var cfg in configTypes)
|
||||
{
|
||||
var namespaceName = cfg.ContainingNamespace.IsGlobalNamespace
|
||||
? ""
|
||||
: cfg.ContainingNamespace.ToDisplayString();
|
||||
if (!string.IsNullOrEmpty(namespaceName))
|
||||
{
|
||||
configReferencesUsings.Add($"using {namespaceName};");
|
||||
}
|
||||
|
||||
var configAttribute = cfg.GetAttributes()
|
||||
.FirstOrDefault(attr =>
|
||||
SymbolEqualityComparer.Default.Equals(attr.AttributeClass, configAttributeSymbol));
|
||||
|
||||
bool isMultiple = false;
|
||||
if (configAttribute != null)
|
||||
{
|
||||
var multipleArg = configAttribute.NamedArguments.FirstOrDefault(arg => arg.Key == "Multiple");
|
||||
if (multipleArg.Value.Value != null)
|
||||
{
|
||||
isMultiple = (bool)multipleArg.Value.Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (isMultiple)
|
||||
{
|
||||
configReferencesCode.AppendLine($"public string {cfg.Name};");
|
||||
}
|
||||
else
|
||||
{
|
||||
configReferencesUsings.Add("using UnityEngine.AddressableAssets;");
|
||||
configReferencesCode.AppendLine($"public AssetReference {cfg.Name};");
|
||||
}
|
||||
}
|
||||
|
||||
var referencesCode = new StringBuilder();
|
||||
referencesCode.AppendLine("#pragma warning disable CS0105");
|
||||
foreach (var usingDirective in configReferencesUsings.OrderBy(u => u))
|
||||
{
|
||||
referencesCode.AppendLine(usingDirective);
|
||||
}
|
||||
|
||||
referencesCode.AppendLine("#pragma warning restore CS0105");
|
||||
referencesCode.AppendLine();
|
||||
referencesCode.AppendLine("namespace Code.Infrastructure.Configs");
|
||||
referencesCode.AppendLine("{");
|
||||
referencesCode.AppendLine(" public partial class SystemConfigsReferences");
|
||||
referencesCode.AppendLine(" {");
|
||||
referencesCode.Append(configReferencesCode.ToString());
|
||||
referencesCode.AppendLine(" }");
|
||||
referencesCode.AppendLine("}");
|
||||
|
||||
context.AddSource("SystemConfigsReferences.Generated.cs", referencesCode.ToString());
|
||||
}
|
||||
|
||||
private static string GetTypeDisplayName(ITypeSymbol typeSymbol, Compilation compilation)
|
||||
{
|
||||
// Обрабатываем generics и вложенные типы
|
||||
if (typeSymbol is INamedTypeSymbol namedType && namedType.IsGenericType)
|
||||
{
|
||||
var typeArguments = namedType.TypeArguments
|
||||
.Select(t => GetTypeDisplayName(t, compilation))
|
||||
.ToArray();
|
||||
|
||||
var constructedName =
|
||||
namedType.ConstructedFrom.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat);
|
||||
return $"{constructedName}<{string.Join(", ", typeArguments)}>";
|
||||
}
|
||||
|
||||
return typeSymbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat);
|
||||
}
|
||||
}
|
||||
|
||||
// Вспомогательные методы для работы с атрибутами
|
||||
internal static partial class SymbolExtensions
|
||||
{
|
||||
public static bool HasAttribute(this ISymbol symbol, INamedTypeSymbol attributeSymbol)
|
||||
{
|
||||
return symbol.GetAttributes().Any(attr =>
|
||||
SymbolEqualityComparer.Default.Equals(attr.AttributeClass, attributeSymbol));
|
||||
}
|
||||
}
|
||||
@@ -1,56 +1,119 @@
|
||||
using System.IO;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace InfraGens;
|
||||
|
||||
/// <summary>
|
||||
/// A sample source generator that creates C# classes based on the text file (in this case, Domain Driven Design ubiquitous language registry).
|
||||
/// When using a simple text file as a baseline, we can create a non-incremental source generator.
|
||||
/// </summary>
|
||||
[Generator]
|
||||
public class SampleSourceGenerator : ISourceGenerator
|
||||
namespace Code.Infrastructure.Generators
|
||||
{
|
||||
public void Initialize(GeneratorInitializationContext context)
|
||||
[Generator]
|
||||
public class SceneLoaderGenerator : IIncrementalGenerator
|
||||
{
|
||||
// No initialization required for this generator.
|
||||
}
|
||||
|
||||
public void Execute(GeneratorExecutionContext context)
|
||||
{
|
||||
// If you would like to put some data to non-compilable file (e.g. a .txt file), mark it as an Additional File.
|
||||
|
||||
// Go through all files marked as an Additional File in file properties.
|
||||
foreach (var additionalFile in context.AdditionalFiles)
|
||||
public void Initialize(IncrementalGeneratorInitializationContext context)
|
||||
{
|
||||
if (additionalFile == null)
|
||||
continue;
|
||||
// Получаем все синтаксические деревья
|
||||
var provider = context.SyntaxProvider
|
||||
.CreateSyntaxProvider(
|
||||
predicate: static (s, _) => IsSyntaxTargetForGeneration(s),
|
||||
transform: static (ctx, _) => GetSemanticTargetForGeneration(ctx))
|
||||
.Where(static m => m is not null)
|
||||
.Collect();
|
||||
|
||||
// Check if the file name is the specific file that we expect.
|
||||
if (Path.GetFileName(additionalFile.Path) != "DDD.UbiquitousLanguageRegistry.txt")
|
||||
continue;
|
||||
// Регистрируем действие для генерации кода
|
||||
context.RegisterSourceOutput(provider, static (spc, source) => Execute(spc, source));
|
||||
}
|
||||
|
||||
var text = additionalFile.GetText();
|
||||
if (text == null)
|
||||
continue;
|
||||
private static bool IsSyntaxTargetForGeneration(SyntaxNode node)
|
||||
{
|
||||
// Ищем объявления enum
|
||||
return node is EnumDeclarationSyntax enumDecl;
|
||||
}
|
||||
|
||||
foreach (var line in text.Lines)
|
||||
private static INamedTypeSymbol? GetSemanticTargetForGeneration(GeneratorSyntaxContext context)
|
||||
{
|
||||
var enumDecl = (EnumDeclarationSyntax)context.Node;
|
||||
var enumSymbol = context.SemanticModel.GetDeclaredSymbol(enumDecl);
|
||||
|
||||
if (enumSymbol is null || enumSymbol.TypeKind != TypeKind.Enum)
|
||||
return null;
|
||||
|
||||
// Проверяем наличие атрибута SceneIdEnum
|
||||
var sceneIdEnumAttribute = context.SemanticModel.Compilation.GetTypeByMetadataName("SceneIdEnum");
|
||||
if (sceneIdEnumAttribute is null)
|
||||
return null;
|
||||
|
||||
// Проверяем, есть ли у enum атрибут SceneIdEnum
|
||||
if (enumSymbol.GetAttributes().Any(attr =>
|
||||
SymbolEqualityComparer.Default.Equals(attr.AttributeClass, sceneIdEnumAttribute)))
|
||||
{
|
||||
var className = line.ToString().Trim();
|
||||
|
||||
// Build up the source code.
|
||||
string source = $@"// <auto-generated/>
|
||||
|
||||
namespace Entities
|
||||
{{
|
||||
public partial class {className}
|
||||
{{
|
||||
}}
|
||||
}}
|
||||
";
|
||||
|
||||
// Add the source code to the compilation.
|
||||
context.AddSource($"{className}.g.cs", source);
|
||||
return enumSymbol;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void Execute(SourceProductionContext context, ImmutableArray<INamedTypeSymbol> enums)
|
||||
{
|
||||
if (enums.IsDefaultOrEmpty)
|
||||
return;
|
||||
|
||||
var sceneIdEnums = enums.Where(e => e is not null).Cast<INamedTypeSymbol>().ToList();
|
||||
|
||||
if (!sceneIdEnums.Any())
|
||||
return;
|
||||
|
||||
var loaderCode = new StringBuilder();
|
||||
var dictionaryCode = new StringBuilder();
|
||||
var interfacesCode = new StringBuilder();
|
||||
|
||||
foreach (var enumSymbol in sceneIdEnums)
|
||||
{
|
||||
if (enumSymbol.TypeKind != TypeKind.Enum)
|
||||
continue;
|
||||
|
||||
// Получаем все члены enum
|
||||
foreach (var member in enumSymbol.GetMembers().OfType<IFieldSymbol>())
|
||||
{
|
||||
if (!member.IsStatic || member.Type?.Equals(enumSymbol, SymbolEqualityComparer.Default) == false)
|
||||
continue;
|
||||
|
||||
string memberName = member.Name;
|
||||
|
||||
interfacesCode.AppendLine($@"
|
||||
public interface IOn{memberName}SceneLoadedHandler : IGlobalSubscriber
|
||||
{{
|
||||
void On{memberName}SceneLoaded();
|
||||
}}");
|
||||
|
||||
dictionaryCode.AppendLine($@"
|
||||
_scenesActions.Add({enumSymbol.ContainingNamespace}.{enumSymbol.Name}.{memberName}, () => _eventBus.RaiseEvent<IOn{memberName}SceneLoadedHandler>(h => h.On{memberName}SceneLoaded()));
|
||||
");
|
||||
}
|
||||
}
|
||||
|
||||
loaderCode.AppendLine($@"#nullable enable
|
||||
#pragma warning disable CS0105
|
||||
using Code.Infrastructure.EventBus;
|
||||
#pragma warning restore CS0105
|
||||
|
||||
namespace Code.Infrastructure.SceneLoader
|
||||
{{
|
||||
public partial class SceneLoader
|
||||
{{
|
||||
partial void SetupScenesInfo()
|
||||
{{
|
||||
{dictionaryCode}
|
||||
}}
|
||||
}}
|
||||
|
||||
{interfacesCode}
|
||||
}}
|
||||
");
|
||||
|
||||
// Добавляем сгенерированный файл
|
||||
context.AddSource("SceneLoader.Generated.g.cs", SourceText.From(loaderCode.ToString(), Encoding.UTF8));
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-296
@@ -18,23 +18,10 @@
|
||||
"InfraGens.dll": {}
|
||||
}
|
||||
},
|
||||
"Humanizer.Core/2.14.1": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Humanizer.dll": {
|
||||
"assemblyVersion": "2.14.0.0",
|
||||
"fileVersion": "2.14.1.48190"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Humanizer.Core/2.14.1": {},
|
||||
"Microsoft.Bcl.AsyncInterfaces/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Threading.Tasks.Extensions": "4.5.4"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Analyzers/3.3.4": {},
|
||||
@@ -47,105 +34,11 @@
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
|
||||
"System.Text.Encoding.CodePages": "6.0.0",
|
||||
"System.Threading.Tasks.Extensions": "4.5.4"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.CodeAnalysis.dll": {
|
||||
"assemblyVersion": "4.3.0.0",
|
||||
"fileVersion": "4.300.22.43017"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/netstandard2.0/cs/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/netstandard2.0/de/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/netstandard2.0/es/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/netstandard2.0/fr/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/netstandard2.0/it/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/netstandard2.0/ja/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/netstandard2.0/ko/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/netstandard2.0/pl/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/netstandard2.0/pt-BR/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/netstandard2.0/ru/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/netstandard2.0/tr/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/netstandard2.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/netstandard2.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp/4.3.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.CodeAnalysis.Common": "4.3.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.CodeAnalysis.CSharp.dll": {
|
||||
"assemblyVersion": "4.3.0.0",
|
||||
"fileVersion": "4.300.22.43017"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/netstandard2.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/netstandard2.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/netstandard2.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/netstandard2.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/netstandard2.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/netstandard2.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/netstandard2.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/netstandard2.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/netstandard2.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/netstandard2.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/netstandard2.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/netstandard2.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/netstandard2.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp.Workspaces/4.3.0": {
|
||||
@@ -154,53 +47,6 @@
|
||||
"Microsoft.CodeAnalysis.CSharp": "4.3.0",
|
||||
"Microsoft.CodeAnalysis.Common": "4.3.0",
|
||||
"Microsoft.CodeAnalysis.Workspaces.Common": "4.3.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll": {
|
||||
"assemblyVersion": "4.3.0.0",
|
||||
"fileVersion": "4.300.22.43017"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/netstandard2.0/cs/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/netstandard2.0/de/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/netstandard2.0/es/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/netstandard2.0/fr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/netstandard2.0/it/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/netstandard2.0/ja/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/netstandard2.0/ko/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/netstandard2.0/pl/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/netstandard2.0/pt-BR/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/netstandard2.0/ru/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/netstandard2.0/tr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/netstandard2.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/netstandard2.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Workspaces.Common/4.3.0": {
|
||||
@@ -210,53 +56,6 @@
|
||||
"Microsoft.CodeAnalysis.Common": "4.3.0",
|
||||
"System.Composition": "6.0.0",
|
||||
"System.IO.Pipelines": "6.0.3"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.CodeAnalysis.Workspaces.dll": {
|
||||
"assemblyVersion": "4.3.0.0",
|
||||
"fileVersion": "4.300.22.43017"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/netstandard2.0/cs/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/netstandard2.0/de/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/netstandard2.0/es/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/netstandard2.0/fr/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/netstandard2.0/it/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/netstandard2.0/ja/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/netstandard2.0/ko/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/netstandard2.0/pl/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/netstandard2.0/pt-BR/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/netstandard2.0/ru/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/netstandard2.0/tr/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/netstandard2.0/zh-Hans/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/netstandard2.0/zh-Hant/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.NETCore.Platforms/1.1.0": {},
|
||||
@@ -265,24 +64,11 @@
|
||||
"Microsoft.NETCore.Platforms": "1.1.0"
|
||||
}
|
||||
},
|
||||
"System.Buffers/4.5.1": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Buffers.dll": {
|
||||
"assemblyVersion": "4.0.3.0",
|
||||
"fileVersion": "4.6.28619.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Buffers/4.5.1": {},
|
||||
"System.Collections.Immutable/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Memory": "4.5.4",
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Collections.Immutable.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition/6.0.0": {
|
||||
@@ -294,55 +80,23 @@
|
||||
"System.Composition.TypedParts": "6.0.0"
|
||||
}
|
||||
},
|
||||
"System.Composition.AttributedModel/6.0.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Composition.AttributedModel.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition.AttributedModel/6.0.0": {},
|
||||
"System.Composition.Convention/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Composition.AttributedModel": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Composition.Convention.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition.Hosting/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Composition.Runtime": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Composition.Hosting.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition.Runtime/6.0.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Composition.Runtime.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition.Runtime/6.0.0": {},
|
||||
"System.Composition.TypedParts/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Composition.AttributedModel": "6.0.0",
|
||||
"System.Composition.Hosting": "6.0.0",
|
||||
"System.Composition.Runtime": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Composition.TypedParts.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.IO.Pipelines/6.0.3": {
|
||||
@@ -350,12 +104,6 @@
|
||||
"System.Buffers": "4.5.1",
|
||||
"System.Memory": "4.5.4",
|
||||
"System.Threading.Tasks.Extensions": "4.5.4"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.IO.Pipelines.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.522.21309"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Memory/4.5.4": {
|
||||
@@ -363,62 +111,24 @@
|
||||
"System.Buffers": "4.5.1",
|
||||
"System.Numerics.Vectors": "4.4.0",
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Memory.dll": {
|
||||
"assemblyVersion": "4.0.1.1",
|
||||
"fileVersion": "4.6.28619.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Numerics.Vectors/4.4.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Numerics.Vectors.dll": {
|
||||
"assemblyVersion": "4.1.3.0",
|
||||
"fileVersion": "4.6.25519.3"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Numerics.Vectors/4.4.0": {},
|
||||
"System.Reflection.Metadata/5.0.0": {
|
||||
"dependencies": {
|
||||
"System.Collections.Immutable": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Reflection.Metadata.dll": {
|
||||
"assemblyVersion": "5.0.0.0",
|
||||
"fileVersion": "5.0.20.51904"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/6.0.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/6.0.0": {},
|
||||
"System.Text.Encoding.CodePages/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Memory": "4.5.4",
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Text.Encoding.CodePages.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Threading.Tasks.Extensions/4.5.4": {
|
||||
"dependencies": {
|
||||
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": {
|
||||
"assemblyVersion": "4.2.0.1",
|
||||
"fileVersion": "4.6.28619.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
Binary file not shown.
+1
-1
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("InfraGens")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a3cd3e86a161e3ee450256b1b37c6a4583c70840")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a4090547509ba65f8ba7b22442c10d06c15217e0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("InfraGens")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("InfraGens")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
4d7b04418b2c47b7b94b1a5f45dde776f61dbc290d8ac0d36d9bd928c45d8e46
|
||||
bcabcaf3c249ae33cc89859b7a823a64fc0953094cafd41dbc46110a15cef167
|
||||
+1
-1
@@ -1 +1 @@
|
||||
34f467799bbdb1e93c09f58be677e4b18b9b7bf76f27dba5589aac397a1cfee1
|
||||
f8913c040e82af0961f443a8e28887f6c9fd2d43dd3fd686c1c929597ca99122
|
||||
+10
@@ -8,3 +8,13 @@ A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens\obj\Debu
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens\obj\Debug\netstandard2.0\InfraGens.csproj.CoreCompileInputs.cache
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens\obj\Debug\netstandard2.0\InfraGens.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens\obj\Debug\netstandard2.0\InfraGens.pdb
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens\obj\Debug\netstandard2.0\InfraGens.csproj.AssemblyReference.cache
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens\obj\Debug\netstandard2.0\InfraGens.GeneratedMSBuildEditorConfig.editorconfig
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens\obj\Debug\netstandard2.0\InfraGens.AssemblyInfoInputs.cache
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens\obj\Debug\netstandard2.0\InfraGens.AssemblyInfo.cs
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens\obj\Debug\netstandard2.0\InfraGens.csproj.CoreCompileInputs.cache
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens\obj\Debug\netstandard2.0\InfraGens.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens\obj\Debug\netstandard2.0\InfraGens.pdb
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens\bin\Debug\netstandard2.0\InfraGens.deps.json
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens\bin\Debug\netstandard2.0\InfraGens.dll
|
||||
A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens\bin\Debug\netstandard2.0\InfraGens.pdb
|
||||
BIN
Binary file not shown.
@@ -1,40 +0,0 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using System;
|
||||
using Code.Infrastructure.Camera;
|
||||
using UnityEngine;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace Code.Infrastructure.Camera{
|
||||
#pragma warning restore CS0105
|
||||
[CreateAssetMenu(fileName = "CameraSettingsConfig", menuName = "Configs/Camera/CameraSettings")]
|
||||
public class CameraSettingsConfig : ScriptableObject
|
||||
{
|
||||
public System.Single defaultDistance;
|
||||
public System.Single minDistance;
|
||||
public System.Single maxDistance;
|
||||
public System.Single distanceMovementSpeed;
|
||||
public System.Single rotationSpeed;
|
||||
public System.Single rotationSharpness;
|
||||
public System.Single followSharpness;
|
||||
public System.Single minVerticalAngle;
|
||||
public System.Single maxVerticalAngle;
|
||||
public System.Single defaultVerticalAngle;
|
||||
public System.Single fov;
|
||||
public Code.Infrastructure.Camera.CameraMode cameraMode;
|
||||
public UnityEngine.Vector3 defaultFollowPosition;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c88ecd63428fe3c41ae0fe17948d931e
|
||||
@@ -1,49 +0,0 @@
|
||||
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0105
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
using Code.Infrastructure.App.States;
|
||||
|
||||
using Code.Infrastructure.App.States;
|
||||
|
||||
using Code.Infrastructure.App.States;
|
||||
|
||||
#pragma warning restore CS0105
|
||||
namespace Code.Infrastructure.App
|
||||
{
|
||||
|
||||
public partial class AppStateMachine : AbstractStateMachine<Code.Infrastructure.App.AppStates,Code.Infrastructure.App.AppStateMachineContext>
|
||||
{
|
||||
|
||||
public AppStateMachine(Code.Infrastructure.App.AppStateMachineContext context, EventBus.EventBus eventBus) : base(context)
|
||||
{
|
||||
|
||||
var stateBootstrapState = new BootstrapState(StateMachineContext,eventBus);
|
||||
States.Add(stateBootstrapState.myState, stateBootstrapState);
|
||||
|
||||
var stateGameplayState = new GameplayState(StateMachineContext,eventBus);
|
||||
States.Add(stateGameplayState.myState, stateGameplayState);
|
||||
|
||||
var stateMainMenuState = new MainMenuState(StateMachineContext,eventBus);
|
||||
States.Add(stateMainMenuState.myState, stateMainMenuState);
|
||||
|
||||
}
|
||||
|
||||
protected override bool CheckTransitionAllowed(Code.Infrastructure.App.AppStates nextState) => AllowedStates.HasFlag(nextState);
|
||||
protected override void ResetAllowedTransitions() => AllowedStates = 0;
|
||||
}
|
||||
|
||||
public static class AppStateMachineExtensions
|
||||
{
|
||||
public static AbstractStateMachine<Code.Infrastructure.App.AppStates, Code.Infrastructure.App.AppStateMachineContext> AllowStateTransition(
|
||||
this AbstractStateMachine<Code.Infrastructure.App.AppStates, Code.Infrastructure.App.AppStateMachineContext> stateMachine, Code.Infrastructure.App.AppStates state)
|
||||
{
|
||||
if (stateMachine == null) return null;
|
||||
|
||||
stateMachine.AllowedStates |= state;
|
||||
return stateMachine;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a6c59a69440bf440a166390c52d5c65
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
|
||||
|
||||
// retard-generated
|
||||
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
namespace Code.Infrastructure.App.States
|
||||
{
|
||||
public partial class BootstrapState : BaseState<Code.Infrastructure.App.AppStates, Code.Infrastructure.App.AppStateMachineContext>
|
||||
{
|
||||
|
||||
protected override void _fireEnterState()
|
||||
{
|
||||
EventBus.RaiseEvent<IEnterStateHandle<Code.Infrastructure.App.States.BootstrapState>>(h => h.EnterState());
|
||||
}
|
||||
|
||||
protected override void _fireExitState()
|
||||
{
|
||||
EventBus.RaiseEvent<IExitStateHandle<Code.Infrastructure.App.States.BootstrapState>>(h => h.ExitState());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7addc3cce102d548b48a5714208d030
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
|
||||
|
||||
// retard-generated
|
||||
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
namespace Code.Infrastructure.App.States
|
||||
{
|
||||
public partial class GameplayState : BaseState<Code.Infrastructure.App.AppStates, Code.Infrastructure.App.AppStateMachineContext>
|
||||
{
|
||||
|
||||
protected override void _fireEnterState()
|
||||
{
|
||||
EventBus.RaiseEvent<IEnterStateHandle<Code.Infrastructure.App.States.GameplayState>>(h => h.EnterState());
|
||||
}
|
||||
|
||||
protected override void _fireExitState()
|
||||
{
|
||||
EventBus.RaiseEvent<IExitStateHandle<Code.Infrastructure.App.States.GameplayState>>(h => h.ExitState());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea098a6fe9bfd164895db3056277a55d
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
|
||||
|
||||
// retard-generated
|
||||
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
namespace Code.Infrastructure.App.States
|
||||
{
|
||||
public partial class MainMenuState : BaseState<Code.Infrastructure.App.AppStates, Code.Infrastructure.App.AppStateMachineContext>
|
||||
{
|
||||
|
||||
protected override void _fireEnterState()
|
||||
{
|
||||
EventBus.RaiseEvent<IEnterStateHandle<Code.Infrastructure.App.States.MainMenuState>>(h => h.EnterState());
|
||||
}
|
||||
|
||||
protected override void _fireExitState()
|
||||
{
|
||||
EventBus.RaiseEvent<IExitStateHandle<Code.Infrastructure.App.States.MainMenuState>>(h => h.ExitState());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 99e53d28eb79b4a44bae11561b625594
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0105
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
using Code.Infrastructure.Camera.CameraStates;
|
||||
|
||||
using Code.Infrastructure.Camera.CameraStates;
|
||||
|
||||
#pragma warning restore CS0105
|
||||
namespace Code.Infrastructure.Camera
|
||||
{
|
||||
|
||||
public partial class CameraStateMachine : AbstractStateMachine<Code.Infrastructure.Camera.CameraMode,Code.Infrastructure.Camera.CameraStateMachineContext>
|
||||
{
|
||||
|
||||
public CameraStateMachine(Code.Infrastructure.Camera.CameraStateMachineContext context, EventBus.EventBus eventBus) : base(context)
|
||||
{
|
||||
|
||||
var stateNoneCameraState = new NoneCameraState(StateMachineContext,eventBus);
|
||||
States.Add(stateNoneCameraState.myState, stateNoneCameraState);
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected override bool CheckTransitionAllowed(Code.Infrastructure.Camera.CameraMode nextState) => AllowedStates.HasFlag(nextState);
|
||||
protected override void ResetAllowedTransitions() => AllowedStates = 0;
|
||||
}
|
||||
|
||||
public static class CameraStateMachineExtensions
|
||||
{
|
||||
public static AbstractStateMachine<Code.Infrastructure.Camera.CameraMode, Code.Infrastructure.Camera.CameraStateMachineContext> AllowStateTransition(
|
||||
this AbstractStateMachine<Code.Infrastructure.Camera.CameraMode, Code.Infrastructure.Camera.CameraStateMachineContext> stateMachine, Code.Infrastructure.Camera.CameraMode state)
|
||||
{
|
||||
if (stateMachine == null) return null;
|
||||
|
||||
stateMachine.AllowedStates |= state;
|
||||
return stateMachine;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 345063e937b7f8b47a0a476ba4be3cae
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
|
||||
|
||||
// retard-generated
|
||||
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
namespace Code.Infrastructure.Camera.CameraStates
|
||||
{
|
||||
public partial class FirstPersonCameraState
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 54a17374a26438b4390b3146d07da638
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
|
||||
|
||||
// retard-generated
|
||||
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
namespace Code.Infrastructure.Camera.CameraStates
|
||||
{
|
||||
public partial class NoneCameraState
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27063949209437c4cb218fb0225384ed
|
||||
@@ -1,32 +0,0 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
using Code.Infrastructure.Input;
|
||||
using Code.Infrastructure.Camera;
|
||||
using Code.Infrastructure.Camera;
|
||||
|
||||
using UnityEngine;
|
||||
#pragma warning restore CS0105
|
||||
|
||||
namespace Code.Infrastructure.Configs
|
||||
{
|
||||
|
||||
public partial class ConfigLocator
|
||||
{
|
||||
partial void LoadConfigs()
|
||||
{
|
||||
SystemConfigsReferences systemConfigsReferences = Resources.Load<SystemConfigsReferences>("SystemConfigsReferences");
|
||||
|
||||
_multipleConfigReferences.Add(typeof(Code.Infrastructure.SceneLoader.SceneInfoConfig), systemConfigsReferences.SceneInfo);
|
||||
|
||||
_singleConfigReferences.Add(typeof(Code.Infrastructure.Input.InputServiceConfig), systemConfigsReferences.InputService);
|
||||
|
||||
_multipleConfigReferences.Add(typeof(Code.Infrastructure.Camera.CameraSettingsConfig), systemConfigsReferences.CameraSettings);
|
||||
|
||||
_singleConfigReferences.Add(typeof(Code.Infrastructure.Camera.GameCameraConfig), systemConfigsReferences.GameCamera);
|
||||
|
||||
//_singleConfigReferences.Add(typeof(ScenesAssetReferences), systemConfigsReferences.scenesAssetReferences);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b516a9c04f1000e43936564c38e25cfb
|
||||
@@ -1,25 +0,0 @@
|
||||
|
||||
using UnityEngine.AddressableAssets;
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using System;
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
#pragma warning restore CS0105
|
||||
namespace Code.Example{
|
||||
[CreateAssetMenu(fileName = "DebugClassConfig", menuName = "Configs/DebugClassConfig")]
|
||||
public class DebugClassConfig : ScriptableObject
|
||||
{
|
||||
public UnityEngine.AddressableAssets.AssetReference SceneAsset;
|
||||
public Code.Infrastructure.SceneLoader.SceneId SceneId;
|
||||
public System.Int32 _a;
|
||||
public Code.Infrastructure.SceneLoader.SceneLoader _b;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bdfef8d142a3e1438c89da242d2be2f
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace Code.Infrastructure.Camera{
|
||||
#pragma warning restore CS0105
|
||||
[CreateAssetMenu(fileName = "GameCameraConfig", menuName = "Configs/Camera/CameraConfig")]
|
||||
public class GameCameraConfig : ScriptableObject
|
||||
{
|
||||
public UnityEngine.AddressableAssets.AssetReference Camera;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e423434f8bbcbc24e9b8c71840daf6f1
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace Code.Infrastructure.Input{
|
||||
#pragma warning restore CS0105
|
||||
[CreateAssetMenu(fileName = "InputServiceConfig", menuName = "Configs/InputService")]
|
||||
public class InputServiceConfig : ScriptableObject
|
||||
{
|
||||
public UnityEngine.InputSystem.InputActionAsset inputActionAsset;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab6d921463750b04aaccb1bf3b2d9608
|
||||
@@ -1,18 +0,0 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using UnityEngine.AddressableAssets;
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace Code.Infrastructure.SceneLoader{
|
||||
#pragma warning restore CS0105
|
||||
[CreateAssetMenu(fileName = "SceneInfoConfig", menuName = "Configs/SceneConfig")]
|
||||
public class SceneInfoConfig : ScriptableObject
|
||||
{
|
||||
public UnityEngine.AddressableAssets.AssetReference SceneAsset;
|
||||
public Code.Infrastructure.SceneLoader.SceneId SceneId;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2d19619e7539f14ea973463204f542c
|
||||
@@ -1,32 +0,0 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
|
||||
using Code.Infrastructure.EventBus;
|
||||
|
||||
#pragma warning restore CS0105
|
||||
|
||||
namespace Code.Infrastructure.SceneLoader
|
||||
{
|
||||
public partial class SceneLoader{
|
||||
partial void SetupScenesInfo(){
|
||||
|
||||
|
||||
_scenesActions.Add(SceneId.MainMenu,() => _eventBus.RaiseEvent<IOnMainMenuSceneLoadedHandler>(h=> h.OnMainMenuSceneLoaded()));
|
||||
|
||||
|
||||
_scenesActions.Add(SceneId.Gameplay,() => _eventBus.RaiseEvent<IOnGameplaySceneLoadedHandler>(h=> h.OnGameplaySceneLoaded()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public interface IOnMainMenuSceneLoadedHandler : IGlobalSubscriber
|
||||
{
|
||||
void OnMainMenuSceneLoaded();
|
||||
}
|
||||
|
||||
public interface IOnGameplaySceneLoadedHandler : IGlobalSubscriber
|
||||
{
|
||||
void OnGameplaySceneLoaded();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5687485408450064f98da1725a20926b
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
#pragma warning disable CS0105
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
using Code.Infrastructure.Input;
|
||||
using Code.Infrastructure.Camera;
|
||||
using Code.Infrastructure.Camera;
|
||||
|
||||
using UnityEngine.AddressableAssets;
|
||||
#pragma warning restore CS0105
|
||||
|
||||
namespace Code.Infrastructure.Configs{
|
||||
public partial class SystemConfigsReferences
|
||||
{
|
||||
public string SceneInfo;
|
||||
public AssetReference InputService;
|
||||
public string CameraSettings;
|
||||
public AssetReference GameCamera;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e3bd6b172c28ca48b40dd639ef19caf
|
||||
Reference in new issue
Block a user