[
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_size = 4\nindent_style = space\ninsert_final_newline = true\ntab_width = 4\ntrim_trailing_whitespace = true\n\n[*.sln]\nindent_style = tab\n\n[*.csproj]\nindent_size = 2\nij_xml_space_inside_empty_tag = true\n\n[*.DotSettings]\nindent_style = tab\nij_xml_attribute_wrap = off\n\n[*.yml]\nindent_size = 2\n\n# [*.cs]\n# entitas_generator.component.cleanup_systems = false\n# entitas_generator.component.component_index = false\n# entitas_generator.component.context_extension = false\n# entitas_generator.component.context_initialization_method = false\n# entitas_generator.component.entity_extension = false\n# entitas_generator.component.entity_index_extension = false\n# entitas_generator.component.events = false\n# entitas_generator.component.event_systems_extension = false\n# entitas_generator.component.matcher = false\n# \n# entitas_generator.context.component_index = false\n# entitas_generator.context.context = false\n# entitas_generator.context.entity = false\n# entitas_generator.context.matcher = false\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm having issues when [...]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\nA clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/question.md",
    "content": "---\nname: Question\nabout: Ask a question and get help from the community\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Ask a question**\nA clear and concise question. Ex. How to do xyz?\n"
  },
  {
    "path": ".github/workflows/build.yml",
    "content": "name: Build\n\non: [ workflow_call, workflow_dispatch ]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: \"Checkout\"\n        uses: actions/checkout@v3\n        with:\n          submodules: recursive\n\n      - name: \"Build\"\n        run: |\n          dotnet build -c Release \\\n            -p:UnityEditor=/home/runner/work/Entitas/Entitas/unity/Unity-2021.3.0f1/UnityEditor.dll \\\n            -p:UnityEngine=/home/runner/work/Entitas/Entitas/unity/Unity-2021.3.0f1/UnityEngine.dll\n\n      - name: \"Test\"\n        run: dotnet test -c Release --no-build --collect:\"XPlat Code Coverage\"\n\n      - name: \"Publish\"\n        run: dotnet publish -c Release --no-build -p:UseAppHost=false -p:PublishDir=/home/runner/work/Entitas/Entitas/dist/Assemblies\n\n      - name: \"Upload assemblies\"\n        uses: actions/upload-artifact@v3\n        with:\n          name: ${{ github.event.repository.name }} Assemblies\n          path: dist/Assemblies\n\n      - name: \"Pack\"\n        run: dotnet pack -c Release --no-build -o dist/NuGet\n\n      - name: \"Upload packages\"\n        uses: actions/upload-artifact@v3\n        with:\n          name: ${{ github.event.repository.name }} NuGet Packages\n          path: dist/NuGet\n\n      - name: \"Generate coverage report\"\n        run: |\n          dotnet tool install -g dotnet-reportgenerator-globaltool\n          reportgenerator \"-assemblyfilters:-Entitas*.Tests*\" \"-reports:tests/**/TestResults/**/coverage.cobertura.xml\" \"-targetdir:coverage\" \"-reporttypes:Html;lcov\"\n\n      - name: \"Upload coverage report\"\n        uses: actions/upload-artifact@v3\n        with:\n          name: ${{ github.event.repository.name }} Coverage Report\n          path: coverage\n\n      - name: Coveralls\n        uses: coverallsapp/github-action@master\n        with:\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n          path-to-lcov: \"coverage/lcov.info\"\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: CI\n\non:\n  push:\n    branches: [ main ]\n  pull_request:\n    branches: [ main ]\n\njobs:\n  build:\n    uses: sschmid/Entitas/.github/workflows/build.yml@main\n"
  },
  {
    "path": ".github/workflows/release.yml",
    "content": "name: Release\n\non: workflow_dispatch\n\njobs:\n  build:\n    uses: sschmid/Entitas/.github/workflows/build.yml@main\n  release:\n    needs: build\n    runs-on: ubuntu-latest\n    steps:\n      - name: \"Download packages\"\n        uses: actions/download-artifact@v3\n        with:\n          name: ${{ github.event.repository.name }} NuGet Packages\n\n      - name: \"Push to NuGet\"\n        run: |\n          dotnet nuget push \"*.nupkg\" \\\n            --api-key ${{ secrets.NUGET_API_KEY }} \\\n            --skip-duplicate \\\n            --source https://api.nuget.org/v3/index.json\n"
  },
  {
    "path": ".gitignore",
    "content": "# OS\n.DS_Store\nThumbs.db\n\n# Solution\nobj\nbin\n*.userprefs\n*.user\nTestResults\n\n# IDEs\n.idea\n.vs\n.vscode\n**/Assets/Plugins/Editor/JetBrains\n**/Assets/Plugins/Editor/JetBrains.meta\n\n# Unity\nLibrary\nTemp\nLogs\nUserSettings\n*.unitypackage\n\n# Custom\n*.userproperties\nbuild\nsamples/Unity/.sln.dotsettings\nsamples/Unity/*.sln*\nsamples/Unity/*.csproj\nsamples/Unity/Assets/Plugins\nsamples/Unity/Assets/Generated\ncoverage\ndist\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"unity/Unity-2021.3.0f1\"]\n\tpath = unity/Unity-2021.3.0f1\n\turl = https://github.com/sschmid/Unity-2021.3.0f1.git\n"
  },
  {
    "path": ".sln.dotsettings/.gitignore",
    "content": ".DS_Store\nThumbs.db\n"
  },
  {
    "path": ".sln.dotsettings/CodeStyle.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_INTERNAL_MODIFIER/@EntryValue\">Implicit</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_PRIVATE_MODIFIER/@EntryValue\">Implicit</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/OBJECT_CREATION_WHEN_TYPE_EVIDENT/@EntryValue\">ExplicitlyTyped</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/OBJECT_CREATION_WHEN_TYPE_NOT_EVIDENT/@EntryValue\">ExplicitlyTyped</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/EMPTY_BLOCK_STYLE/@EntryValue\">TOGETHER_SAME_LINE</s:String>\n\t<s:Int64 x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue\">1</s:Int64>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_EXISTING_ATTRIBUTE_ARRANGEMENT/@EntryValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/LINE_FEED_AT_FILE_END/@EntryValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINES/@EntryValue\">False</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeStyle/Naming/CSharpNaming/ApplyAutoDetectedRules/@EntryValue\">False</s:Boolean>\n\t<s:String x:Key=\"/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PublicFields/@EntryIndexedValue\">&lt;Policy Inspect=\"True\" Prefix=\"\" Suffix=\"\" Style=\"AaBb\"&gt;&lt;ExtraRule Prefix=\"_\" Suffix=\"\" Style=\"aaBb\" /&gt;&lt;/Policy&gt;</s:String>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>\n"
  },
  {
    "path": ".sln.dotsettings/InspectionSettings.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:String x:Key=\"/Default/CodeInspection/Highlighting/InspectionSeverities/=NotAccessedVariable/@EntryIndexedValue\">ERROR</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantUsingDirective_002EGlobal/@EntryIndexedValue\">ERROR</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantUsingDirective/@EntryIndexedValue\">ERROR</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedLabel/@EntryIndexedValue\">ERROR</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedParameterInPartialMethod/@EntryIndexedValue\">ERROR</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedPositionalParameterCompiler/@EntryIndexedValue\">ERROR</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedTypeParameter/@EntryIndexedValue\">ERROR</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedVariable_002ECompiler/@EntryIndexedValue\">ERROR</s:String>\n\t<s:String x:Key=\"/Default/CodeInspection/Highlighting/InspectionSeverities/=UnusedVariable/@EntryIndexedValue\">ERROR</s:String></wpf:ResourceDictionary>"
  },
  {
    "path": ".sln.dotsettings/PatternsAndTemplates.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/PatternsAndTemplates/LiveTemplates/Template/=F654DC29CBB2734FAFCF41B7244C1C1B/@KeyIndexDefined\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/PatternsAndTemplates/LiveTemplates/Template/=F654DC29CBB2734FAFCF41B7244C1C1B/Applicability/=Live/@EntryIndexedValue\">True</s:Boolean>\n\t<s:String x:Key=\"/Default/PatternsAndTemplates/LiveTemplates/Template/=F654DC29CBB2734FAFCF41B7244C1C1B/Description/@EntryValue\">xUnit test</s:String>\n\t<s:Boolean x:Key=\"/Default/PatternsAndTemplates/LiveTemplates/Template/=F654DC29CBB2734FAFCF41B7244C1C1B/Field/=Fails/@KeyIndexDefined\">True</s:Boolean>\n\t<s:Int64 x:Key=\"/Default/PatternsAndTemplates/LiveTemplates/Template/=F654DC29CBB2734FAFCF41B7244C1C1B/Field/=Fails/Order/@EntryValue\">0</s:Int64>\n\t<s:Boolean x:Key=\"/Default/PatternsAndTemplates/LiveTemplates/Template/=F654DC29CBB2734FAFCF41B7244C1C1B/Reformat/@EntryValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/PatternsAndTemplates/LiveTemplates/Template/=F654DC29CBB2734FAFCF41B7244C1C1B/Scope/=C3001E7C0DA78E4487072B7E050D86C5/@KeyIndexDefined\">True</s:Boolean>\n\t<s:String x:Key=\"/Default/PatternsAndTemplates/LiveTemplates/Template/=F654DC29CBB2734FAFCF41B7244C1C1B/Scope/=C3001E7C0DA78E4487072B7E050D86C5/CustomProperties/=minimumLanguageVersion/@EntryIndexedValue\">2.0</s:String>\n\t<s:String x:Key=\"/Default/PatternsAndTemplates/LiveTemplates/Template/=F654DC29CBB2734FAFCF41B7244C1C1B/Scope/=C3001E7C0DA78E4487072B7E050D86C5/Type/@EntryValue\">InCSharpFile</s:String>\n\t<s:String x:Key=\"/Default/PatternsAndTemplates/LiveTemplates/Template/=F654DC29CBB2734FAFCF41B7244C1C1B/Shortcut/@EntryValue\">fact</s:String>\n\t<s:Boolean x:Key=\"/Default/PatternsAndTemplates/LiveTemplates/Template/=F654DC29CBB2734FAFCF41B7244C1C1B/ShortenQualifiedReferences/@EntryValue\">True</s:Boolean>\n\t<s:String x:Key=\"/Default/PatternsAndTemplates/LiveTemplates/Template/=F654DC29CBB2734FAFCF41B7244C1C1B/Text/@EntryValue\">[Fact]\npublic void $Fails$()\n{\n    false.Should().BeTrue();$END$\n}\n</s:String></wpf:ResourceDictionary>"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n## [1.14.2] - 2022-11-11\n\n### Other\n- Use version ranges for package references in all projects\n- Upgrade all NuGet packages\n- Restructure project using tests folder\n- Use `Version` instead of `PackageVersion`\n- Add GitHub actions\n\n### bee\n- Upgrade to bee 1.3.1\n\n## [1.14.1] - 2022-09-26\n\n### Entitas\n- Add `[ThreadStaticAtribute]` at static fields for multi-threaded game servers #919\n\n### Entitas.CodeGeneration.Plugins\n- Revert \"Remove CodeDom\" to support reserved C# keywords in component names #1032\n- Update jenny standalone checks to test for `Jenny.Generator.Cli` namespace\n\n### Entitas.VisualDebugging.Unity\n- Fix entities order in visual debugging #1027\n- Create `Entitas.properties` with all required keys #1031\n- Set default systemWarningThreshold if `Entitas.properties` doesn't exists #1031\n\n### Entitas.VisualDebugging.CodeGeneration.Plugins\n- Prevent #963: Extend generator with adding debug log of exception when registering observers\n\n### DesperateDevs\n- See [CHANGELOG.md](https://github.com/sschmid/DesperateDevs/blob/main/CHANGELOG.md#2022-09-27)\n\n### Other\n- Move projects from `Addons` to `src` folder\n- Remove top-level folder in projects\n- Convert concatenation to interpolation\n- Migrate unit tests from nspec to xunit\n- Remove travis.yml\n- Remove old Tests project\n- Remove PerformanceTests\n- Move Entitas.VisualDebugging.* to Entitas.Unity solution folder\n- Add `Entitas.CodeGeneration.Program` project\n- Apply formatting and syntax updates to Entitas\n- Update Desperate Devs packages\n- Update packages\n\n### bee\n- Upgrade to bee 1.2.0\n- Add `entitas::new`\n- Add `entitas::new_benchmark`\n- Add `entitas::nuget`\n- Add `entitas::nuget_local`\n- Add `entitas::publish`\n\n## [1.14.0] - 2022-09-02\n\n### Notes\n- Rename the repository to Entitas: https://github.com/sschmid/Entitas\n- Desperate Devs 1.0 is now open-source. Please find changes and upgrade guides here: [CHANGELOG.md](https://github.com/sschmid/DesperateDevs/blob/main/CHANGELOG.md)\n- Started migration to a modern SDK-style project structure using [.NET project SDKs](https://docs.microsoft.com/en-us/dotnet/core/project-sdk/overview)\n- All projects have been updated to `.NET 6.0` and `.NET Standard 2.1`.\n- `Entitas.Roslyn.CodeGeneration.Plugins` is now open-source and part of this Entitas repository\n- `main` is new default branch and `master` is obsolete\n\n### Upgrade\n- Rename `CodeGeneratorExtentions` to `CodeGeneratorExtensions`\n- Update `Jenny.properties` and rename to `Entitas.CodeGeneration.Plugins.EventListenerInterfaceGenerator`\n- `mono Jenny/Jenny.exe` is obsolete. Use `dotnet Jenny/Jenny.Generator.Cli.dll` (requires dotnet)\n- Run `dotnet Jenny/Jenny.Generator.Cli.dll auto-import -s` and follow instructions\n- Consider using at least these search paths in `Jenny.properties`:\n```\nJenny.SearchPaths = Jenny/Plugins/Entitas, \\\n                    Jenny/Plugins/Jenny, \\\n                    Assets/Entitas\n```\n- Some keys in `Jenny.properties` have changed due to renamed namespaces:\n```\nJenny.SearchPaths\nJenny.Plugins\nJenny.PreProcessors\nJenny.DataProviders\nJenny.CodeGenerators\nJenny.PostProcessors\nJenny.Server.Port\nJenny.Client.Host\nJenny.Plugins.ProjectPath\nJenny.Plugins.TargetDirectory\n```\n- For reference, see [Match-One Jenny.properties](https://github.com/sschmid/Match-One/blob/main/Jenny.properties)\n- Generate using `dotnet Jenny/Jenny.Generator.Cli.dll gen`\n\n### Entitas\n- Add `systems.Remove()`\n\n### Entitas.CodeGeneration.Plugins\n- Fix typo in `CodeGeneratorExtensions`\n- Fix typo in `EventListenerInterfaceGenerator`\n- Remove CodeDom\n\n### Entitas.Unity.Editor\n- Link chat to [Entitas Discord](https://discord.gg/uHrVx5Z)\n\n### Other\n- Use Desperate Devs 1.0.0\n- Use nuget and delete dependencies\n- Remove docs\n- Remove doxygen\n- Remove tree\n\n### bee\n- Migrate to bee 1.1.0\n- Remove generated folder from VisualDebugging project\n\n## [1.13.0] - 2019-02-20\n### Added\n- Update roslyn\n- Update hierarchy icons\n\n### Changed\n- Change Preferences minified and doubleQuoteMode api\n\n### Fixed\n- Fix hierarchy icon null warning\n\n## [1.12.2] - 2018-12-15\n### Fixed\n- Fix EntityLinkHierarchyIcon #843\n\n## [1.12.1] - 2018-12-09\n### Added\n- Fix Jenny.exe load default `Jenny.properties` when not specified\n\n## [1.12.0] - 2018-12-09\n### Added\n- Add Preferences require concrete properties path\n- Add CodeGeneratorPreferencesWindow\n- Add EntitasEntityLinkHierarchyIcon\n\n### Changed\n- Move Jenny Unity Preferences to its own editor window `Tools/Jenny/Preferences...`\n\n### Removed\n- Remove EntitasCache\n\n### Upgrade\n- Jenny has been decoupled from Entitas even more\n- Jenny now stores its config in Jenny.properties by default\n- Entitas now stores its config in Entitas.properties by default\n- Please split Preferences.properties into Entitas.properties and Jenny.properties or delete them to automatically create new default files\n\n## [1.11.0] - 2018-11-19\n### Added\n- Add support for multiple event attributes with different event target #810\n\n### Upgrade\n- All listener interfaces with `EventTarget.Any` need to be renamed\n  - `IPositionListener` -> `IAnyPositionListener`\n  - `OnPosition` -> `OnAnyPosition`\n\n## [1.10.0] - 2018-11-14\n### Changed\n- Remove IContext from EntityLink.Link() method signature\n\n### Upgrade\n- Remove IContext from EntityLink.Link() method signature\n\n## [1.9.2] - 2018-11-04\n### Added\n- Hotfix for Unity Asset Store missing mono hosted msbuild\n\n## [1.9.1] - 2018-11-03\n### Added\n- Fix MultiReactive system retaining entities multiple times #818\n\n## [1.9.0] - 2018-11-03\n### Added\n- Optimize generated code #780\n  - This increases entity and component creation performance\n- Optimize Visual Debugging performance #799\n  - This increases the performance especially when having thousands of entities\n- Generate XML documentation #792\n  - This will show documentation in the IDE\n- Using latest [bee](https://github.com/sschmid/bee)\n\n### Changed\n- Context ctor signature changed. Generate to fix compiler errors.\n  If you don't use the [Entitas.Roslyn plugins](http://u3d.as/NuJ) from the Unity Asset Store,\n  you have to manually fix the affected generated context classes.  E.g. `Generated/Game/GameContext.cs`,\n  add `() => new GameEntity()` as a last argument\n\n```csharp\npublic sealed partial class GameContext : Entitas.Context<GameEntity> {\n\n    public GameContext()\n        : base(\n            GameComponentsLookup.TotalComponents,\n            0,\n            new Entitas.ContextInfo(\n                \"Game\",\n                GameComponentsLookup.componentNames,\n                GameComponentsLookup.componentTypes\n            ),\n            (entity) =>\n\n#if (ENTITAS_FAST_AND_UNSAFE)\n                new Entitas.UnsafeAERC(),\n#else\n                new Entitas.SafeAERC(entity),\n#endif\n            () => new GameEntity() // <---------- update here\n        ) {\n    }\n}\n```\n\n- Release retained entities when ReactiveSystem.Execute() has an exception #812\n  - This fixes spamming the Unity console with error messages\n\n# 1.8.2\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttp://u3d.as/NuJ\n\n### Entitas\n⚙️ Add \"@\" in front of component name if it is a C# keyword #744 #756 @roygear\n⚙️ Added convenience ctor to JobSystem to use all available threads on the device\n⚙️ JobSystem.Execute() is now virtual\n\n\n### Jenny\n🛠 Fixed delays when running `jenny server`\n🆕 `jenny wiz` beta. Running Jenny.exe without args will automatically run `jenny wiz`\n🆕 `jenny help` aka man page\n\nJenny Wizard is wip. If you have feedback or feature request, please add a comment here\nhttps://github.com/sschmid/Entitas/issues/778\n\n\n# 1.8.1\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Entitas\n⚙️ Add \"@\" in front of component name if it is a C# keyword #744 #756 @roygear\n⚙️ Added convenience ctor to JobSystem to use all available threads on the device\n⚙️ JobSystem.Execute() is now virtual\n\n\n### Jenny\n🛠 Fixed delays when running `jenny server`\n🆕 `jenny wiz` beta. Running Jenny.exe without args will automatically run `jenny wiz`\n🆕 `jenny help` aka man page\n\nJenny Wizard is wip. If you have feedback or feature request, please add a comment here\nhttps://github.com/sschmid/Entitas/issues/778\n\n\n# 1.8.0\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Entitas\n⚙️ Enabled [Event] for non components #743\n⚠️ Renamed `CustomComponentNameAttribute` to `ComponentNameAttribute`\n\n\n### Jenny\n⚙️ Added more logs to `gen` command\n```csharp\nGenerating using /Users/sschmid/Dev/C#/Half-life3/Jenny.properties\nGenerating done (13220 files in 4 seconds)\n```\n⚙️ Added group to ICommand to support grouped usage overview\n### Asset Store Version\n\n\n# 1.7.0\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Visual Debugging\n⚙️ StringTypeDrawer now uses EditorGUILayout.DelayedTextField\n\n### Code Generator\n🆕 Added CleanupAttribute\n⚠️ Renamed `UniquePrefixAttribute` to `FlagPrefixAttribute`\n\n### Asset Store Version\n🆕 Cleanup Data Providers and Code Generators\n\nInstead of manually writing custom systems to remove components or destroy\nentities, you can now use the new `[Cleanup]` attribute to automatically\ngenerate `<Context>CleanupSystems` for you.\n\nE.g. adding the `[Cleanup]` attribute to a `DestroyedComponent` can replace\nyour custom `DestroyEntitySystem`.\n\n```csharp\n[Cleanup(CleanupMode.DestroyEntity)]\npublic sealed class DestroyedComponent : IComponent {\n}\n```\n\nThere are currently two options:\n- CleanupMode.DestroyEntity\n- CleanupMode.RemoveComponent\n\n`CleanupMode.DestroyEntity` will generate a system that destroys all\nentities which have this component.\n\n`CleanupMode.RemoveComponent` will generate a system that will remove\nthis component from all entities which have this component.\n\n\n# 1.6.1\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Entitas\n🛠 Fixed context.Reset() which doesn't remove event handlers anymore #725\n🛠 Updated EntitasStats to exclude JobSystem and Feature\n\n### Jenny\n🛠 Fixed Jenny dropdown UI to not show 'mixed...' anymore\n⚙️ Added Jenny Server toggle to UI\n⚙️ Added dry run option\n⚠️ Removed EnsureStandalonePreProcessor\n🆕 Added WarnIfCompilationErrorsPreProcessor\n\n\n# 1.6.0\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### General\n⚠️ Changed Entitas Asset Store package structure by separating Desperate Devs dlls into their own folder\nPlease run `jenny auto-import -s` or modify `Preferences.properties` to update the paths to the plugins if necessary\n\n\n### Entitas\n🛠 Added support to remove event listeners within event callback #698\n\n⚠️ Improved Entitas Event API `[Event(bool)]` #717\nUse \"find and replace\" to update all your EventAttribute usages\n`[Event(true)]` is now `[Event(EventTarget.Self)]`\n`[Event(false)]` is now `[Event(EventTarget.Any)]`\n\n⚙️ Added support for `[DontDrawComponent]` for all components #678\n💄 Updated comments for `group.RemoveAllEventHandlers()` #684\n🛠 Fixed check for updates\n\n\n### DesperateDevs\n⚙️ Updated `TargetFrameworkProfilePreProcessor` #721\n🛠 Added `str.ToUnixPath()`\n\n\n# 1.5.2\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Entitas\n🛠 Fixed EventSystemsGenerator generated EventSystems per context but those systems contained EventSystems from all context\n\n### DesperateDevs\n🛠 Added TcpMessageParser to reliably receive separate messages from a tcp stream\n\n\n\n# 1.5.1\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### DesperateDevs\n⚙️ Added better error message to EnsureStandalonePreProcessor\n\nWhen EnsureStandalonePreProcessor is activated it will prevent you from accidentally generating in Unity.\nTo generate in Unity make sure EnsureStandalonePreProcessor is not activated.\n\n\n# 1.5.0\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Entitas\n🆕 Added JobSystem for multi threading as a proof of concept.\n\n```csharp\npublic sealed class RotateSystem : JobSystem<GameEntity> {\n\n    public RotateSystem(GameContext context, int threads) :\n        base(context.GetGroup(GameMatcher.AllOf(GameMatcher.Rotation, GameMatcher.RotationVector)), threads) {\n    }\n\n    protected override void Execute(GameEntity entity) {\n        entity.rotation.value = entity.rotation.value * Quaternion.Euler(entity.rotationVector.value);\n    }\n}\n```\n\nLimitations:\n- Don't use generated methods like Add() and Replace()\n- Modify component values directly\nSee https://github.com/sschmid/Entitas/issues/325#issuecomment-373961878\n\nThis is not a general purpose solution for all problems. It can be used to solve certain performance intense areas in your game. It can be very useful if there's a very large number of entities that have to be processed, or if the data transformation involves heavy calulations.\n\n⚠️ EventSystemsGenerator generates EventSystems per context now.\n🛠 Removed dependency on Entitas.CodeGeneration.Plugins from Entitas.VisualDebugging.Unity.Editor #312\n\n### DesperateDevs\n🆕 Added EnsureStandalonePreProcessor to prevent accidentally generating in Unity\n\n\n# 1.4.2\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\nThis is a hotfix release to patch the bugs introduced by the code generator refactoring from 1.4.0.\n\n### Entitas\n🛠 Fixed needing to generate code twice to when event got removed #620\n⚙️ Added group.AsEnumerable() to support linq\n⚙️ Added partial keyword to ComponentEntityApiInterfaceGenerator #607\n⚙️ Changed EntityLink exception to be a warning\n⚙️ ComponentData can clone CodeGeneratorData\n\n### Jenny\n🆕 Added ValidateProjectPathPreProcessor #572 #563\n\n### DesperateDevs\n⚙️ Added logger.Reset()\n\n\n# 1.4.1\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\nThis is a hotfix release to patch the bugs introduced by the code generator refactoring from 1.4.0.\n\n### Entitas\n🛠 Fixed component name generation for EventType.Removed #631 (thanks to @hegi25)\n\n### Jenny\n🛠 Fixed jenny \"Collection was modified; enumeration operation may not execute.\" #628\n🛠 Fixed jenny \"Index was outside the bounds of the array.\" #628\n\n\n\n# 1.4.0\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\nBreaking changes are marked with ⚠️️\n\n### Entitas\n🆕 Added group.GetEntities(buffer) #624\n🆕 Made group iteration alloc free #624\n⚙️ Added support for multiple events per component\n⚙️ Added `removeComponentWhenEmpty` to optionally remove or keep empty listener component\n🛠 Fixed accessing non existing component in generated event system for EventType.Removed\n🛠 Fixed events inheriting unique attribute from component\n⚠️ Removed EventType.AddedOrRemoved\n💄 Refactored and simplified all code generators\n\n# 1.3.0\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\nThis update improves the new Entitas Events introduced in 1.1.0\n\nBreaking changes are marked with ⚠️️\n\n### Entitas\n⚙️ Added support for multiple event listeners per entity\n⚙️ EventInterfaceGenerator generates correct filename matching the class name. Thanks to @c0ffeeartc\n⚠️️ Renamed some generators. Please use `auto-import` to update the generator names\n\n\n# 1.2.0\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\nThis update improves the new Entitas Events introduced in 1.1.0\n\nBreaking changes are marked with ⚠️️\n\n### Entitas\n⚙️ Added support for multiple contexts for events. Context prefix will be skipped if a component only has one context in favour of a nicer API\n⚠️️ Passing sender entity as first argument in event delegate\n🆕 Added new optional event types `EventType.Added`, `EventType.Removed`, `EventType.AddedOrRemoved`\n🛠 Fixed typo `_listsners` in event generator Thanks to @FNGgames\n\n\n### Jenny\n🛠 Fixed `scan` command\n\n\n# 1.1.0\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Entitas\n🆕 Added Events aka Reactive-UI #591\n⚠️ Changed `ComponentEntityInterfaceGenerator` to generate `IXyzEntity` insetad of `IXyz` to avoid name collisions with `EventInterfaceGenerator`\n⚙️ Added enum support for Code Generator Attributes\n⚙️ Removed `partial` keyword from ComponentGenerator\n⚙️ Removed attributes from generated components\n\n### Jenny\n🆕 Added `Jenny-Auto-Import` scripts to reducde terminal interaction\n⚙️ Added silent `-s` info to Jenny help page\n⚙️ Using Console.WriteLine when prompting user input to support silent mode\n⚙️ CodeGeneratorData can now be cloned\n\n\n# 1.0.0\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Jenny\n🛠 Workaround for Unity 2017.3 GUI mask bug (still shows `Mixed...` instead of `Everything` -> Unity bug) #569\n\n\n# 0.47.9\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Jenny\n🛠 Fixed issue with Entitas.Roslyn plugin and non-components with context attibute #564\n🛠 Fixed `auto-import` not making relative search paths on Windows\n\n### Other\n⚙️ Included readme files in zip\n⚙️ Updated CONTRIBUTING.md and updated bee 🐝\n\n\n# 0.47.8\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Jenny\n🛠 Fixed `The given assembly name or codebase was invalid` on windows #561\n\n\n# 0.47.7\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Jenny\n🛠 Auto-Import properly handles paths with spaces #555\n\n\n# 0.47.6\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Jenny\n- Using correct properties file for each Unity project by saving only the filename instead of full path\n\n\n# 0.47.5\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Entitas\n- Hotfix for EntityLink throwing errors OnApplicationQuit\n\n\n# 0.47.4\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\n### Entitas\n- Hotfix for broken EntityLink (thanks to @c0ffeeartc for reporting so quickly)\n\n\n# 0.47.3\n\nAs always, the Unity Asset Store version might take a few days to be processed\nand accepted by Unity. Please check for updates in 2 - 4 days here:\nhttps://www.assetstore.unity3d.com/#!/content/87638\n\nSee and discuss changes in [Milestone 0.47.3](https://github.com/sschmid/Entitas/milestone/17?closed=1)\n\n(Finally went back to Milestone development :) Transparency FTW!)\n\n### Entitas\n- EntityLink will immediately throw an exception if the gameObject is destroyed but still linked to an entity #470\n- Fixed VisualDebugging Toggle in the Entitas Preferences Window #540\n\n### Jenny\n- Even more support for multiple properties, see #550\n\n\n# 0.47.2\n\nAs always, the Unity Asset Store version might take a few days to be processed and accepted by Unity.\nPlease check for updates in 2 - 4 days here: https://www.assetstore.unity3d.com/#!/content/87638\n\nHere's another update to improve the code generator experience. Thanks again for all your great feedback!\nAnd thanks for going through this with me :) We're almost there!\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### Entitas\n- Added migration 0.47.2\n\n### Jenny\n- Added silent mode for `jenny fix` to simplify `jenny auto-import` experience. Use `-s`, e.g `jenny auto-import -s`\n- Added a potential fix for `jenny client gen` command never completes #546\n- Renamed keys from `CodeGenerator.*` to `Jenny.*`. Please apply migration 0.47.2\n- Added support to run CLI from any location\n- Warning when no properties found\n- Removed leading \"./\" from added searchPaths added by `jenny auto-import`\n- The Roslyn foundation moved to DesperateDevs\n- Using the latest Roslyn libs\n\n### Other\n- Entitas project cleanup and maintenance\n- Added more automation tasks to bee 🐝\n\n# 0.47.1\n\nAs always, the Unity Asset Store version might take a few days to be processed and accepted by Unity.\nPlease check for updates in 2 - 4 days here: https://www.assetstore.unity3d.com/#!/content/87638\n\n### Jenny\n- Handling BadImageFormatException\n- Not showing warnings for unresolved assemblies anymore\n- Fixed closing AssemblyResolver before all plugin dependencies were loaded\n- Fixed jenny server construction not complete before executing client command\n\n\n# 0.47.0\n\n### General\n- Brand new build automation workflow (bee 🐝)\n- Completely automated build, sync and release flow for faster future updates (bzzz 🐝)\n- Only Entitas.zip is attached to GitHub releases\n- Jenny CLI is only bundled in Asset Store version\n- Added Assets folder to Entitas.zip #535\n- More flexible plugin-based CLI architecture\n\n### Jenny\n- Unity support for multiple properties files by adding switch button to Entitas Preferences in case multiple properties files exist #536\n- Better CLI support for multiple properties files by showing a warning in case multiple properties files exist #536\n- Fixes for server / client errors (ObjectDisposedException) #529\n- Renamed key `CodeGenerator.CLI.Ignore.UnusedKeys` to `Ignore.Keys`\n- `auto-import` reflects assemblies and sets plugins based on content instead of name\n- `auto-import` automatically detects custom plugins in Unity project without manually setting up searchPaths\n- Added visual lines to `dump`\n- Renamed `ICodeGeneratorBase` to `ICodeGenerationPlugin`\n- Fixed `IConfigurable` commands not getting configured\n- Added minified properties support\n\n### Asset Store\n- Fix for NullReferenceException (Entitas.Roslyn.SymbolExtension.ToCompilableString) #534\n- Support for WrapperComponent #532\n\n# 0.46.3\n\nAs always, the Unity Asset Store version might take a few days to be processed and accepted by Unity.\nPlease check for updates in 2 - 4 days.\n\n### Code Generation\n- Added `IPreProcessor`\n- Added TargetFrameworkProfilePreProcessor\n- Fixed problems with Roslyn Generator and Visual Studio on Windows #503\n\n\n# 0.46.2\n\nAs always, the Unity Asset Store version might take a few days to be processed and accepted by Unity.\nPlease check for updates in 2 - 4 days.\n\n### Code Generation\n- Added `IDoctor` for custom diagnosis and custom symptoms treatment :) Will help improving the\n  code generator setup experience that is aimimg for a one-click setup\n- Implemented IDoctor for ComponentDataProvider, EntityIndexDataProvider and DebugLogPostProcessor\n- Removed `isEnabledByDefault`from all plugins\n\n### TCPezy\n- ResolveHost returns IPv4 address to fix issue with server / client mode on windows\n\n\n# 0.46.1\n\nAs always, the Unity Asset Store version might take a few days to be processed and accepted by Unity.\nPlease check for updates in 2 - 4 days.\n\n### Entitas.VisualDebugging.CodeGeneration.Plugins\n-  Added deep device profiling support to generated Feature class #497\n\n### Unity\n- Added buttons to generate DefaultInstanceDrawer and TypeDrawer\n- Added deep device profiling toggle to Entitas Preferences\n\n<img width=\"415\" alt=\"Entitas - Deep Device Profiling\" src=\"https://user-images.githubusercontent.com/233700/33909162-f4e1a684-df8a-11e7-89d9-1e910554b954.png\">\n\n\n# 0.46.0\n\nAs always, the Unity Asset Store version might take a few days to be processed and accepted by Unity.\nPlease check for updates in 2 - 4 days.\n\nThis release is a maintenance release as announced here:\n\nhttps://github.com/sschmid/Entitas/issues/508\n\nAs the project got more mature the Entitas repository not only contained the ECS core but also a few other\nmodules like Logging, Serialization, Networking, Code Generator, Common Utils and more.\nThe goal of this refactoring was to extract reusable modules and increase the focus of the Entitas repository\non ECS. Reusable modules have been successfully extracted to their own standalone projects. Overall, with the\nincreased focus that is achieved by having standalone projects I expect the quality to raise, too. This is\ngenerally the case when you have reusable code that is battle tested in multiple different scenarios.\n\nAs mentioned in #508 those projects all have the `DesperateDevs` namespace. You maybe already know about\nDesperate Devs because of the new YouTube channel where I will upload more and more Video on ECS,\nbest practices and Software Architecture. Subscribe if you don't want to miss future videos.\n\nhttps://www.youtube.com/channel/UC2q7q7tcrwWHu5GSGyt_JEQ\n\nAs a result of this refactoring I was able to remove a lot of noise from the Entitas repository and I could\neasily fix platform depended bugs without any distraction.\n\n<img width=\"385\" alt=\"entitas-desperatedevs\" src=\"https://user-images.githubusercontent.com/233700/33746219-2011570a-dbbc-11e7-9631-4e8730fa7847.png\">\n\nEntitas will benefit from having the Desperate Devs dependencies as it enforces modularity and reusability.\nAdditionally, it will be possible to use awesome tools like TCPezy (DesperateDev.Networking) and Jenny (DesperateDevs.CodeGeneration) independently.\n\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### Obsolete notice\n- Removed methods marked obsolete in 0.42.0 from April 2017\n- Blueprints are now completely removed from the zip files (sources still available)\n\n### Preferences\n- Showing properties name in Edit Button\n\n### Jenny (aka Code Generator)\n- CodeGeneratorPreferencesDrawer will keep unavailable plugins #496\n- Added Display Dialog for auto import\n- Added a secret and hidden cli command, can you find it? ❤️\n\n### TCPezy (aka entitas server)\n- Fixed Unhandled Exception (appeared on Windows only) #489\n\n### Other\n- Changed language level of all projects to C# 4.0\n- Deleted CodeGenerator Unity Test project\n\n\n# 0.45.1\n\nAs always, the Unity Asset Store version might take a few days to be processed and accepted by Unity.\nPlease check for updates in 2 - 4 days.\n\n### CodeGenerator\n- Added Auto Import Button to Entitas Preferences. This will detect plugins and automatically set them in Entitas.properties\n\n\n# 0.45.0\n\nThanks for the feedback on the new code generator so far. This update contains a lot of great improvments.\nAs always, the Unity Asset Store version might take a few days to be processed and accepted by Unity.\nPlease check for updates in 2 - 4 days.\n\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n\n### Entitas\n- Fixed flag components increasing the componentPool stack #445\n- Logging all retained entities in ContextStillHasRetainedEntitiesException #448\n- Added support for multiple indexed members per component #464\n\n```\npublic sealed class MyComponent : IComponent {\n\n  // Multiple fields are now supported\n\n  [EntityIndex]\n  public int value;\n\n  [EntityIndex]\n  public int otherValue;\n}\n\n// will generate\ncontext.GetEntitiesWithMyValue(...);\ncontext.GetEntitiesWithMyOtherValue(...);\n```\n\n\n### CodeGenerator\n- Displaying more prominent popup in Unity when trying to generate with compile errors #463\n\n![entitas-codegenerator-compileerrorpopup](https://user-images.githubusercontent.com/233700/32519395-e8dccbdc-c40c-11e7-8a6c-08f176b23244.png)\n\n- AssemblyResolver won't append dll to exe extension\n- Changed code generator keys and removed default values\n- Changed code generator cli keys and removed default values\n- Added auto-import command. Use `entitas auto-import` to automatically populate Entitas.properties\n- `entitas status` command will detect potential collisions, e.g. duplicate providers from the default plugins and the roslyn plugins\n- `entitas fix` can resolve plugin collisions\n- `entitas fix` command will tell you to press any key\n- Removed `-a` keepAlive in favour of `entitas server` and `entitas client`\n- Fixed client only sending first command to server #482\n- Default Plugins are now in folder called Entitas\n- Refactored all commands and simplified many utils methods\n- `Entitas.exe` now with capital E\n\n\n### Roslyn\n- Added custom support for multi-dimensional arrays types like `int[,,]` #481\nLet me know if more types need custom support.\n\n### Migration\n- Added migration for 0.45.0\n\n\n# 0.44.0\n\nAs always, the Unity Asset Store version might take a few days to be processed and accepted by Unity.\nPlease check for updates in 2 - 4 days.\n\n### Unity CodeGenerator\n- Added new menu item which connects to an external code generator server instance\n\n### CodeGenerator CLI\n- Added server command\n- Added client command\n- Added startCodeGenerator files for macOS and Windows\n\n### Example\nStart the code generator server by double clicking `startCodeGenerator` on macOS or `startCodeGenerator.bat` on Windows, or use the terminal\n\n```\n$ mono CodeGenerator/entitas.exe server\n```\n\nYou can now either use the new Unity menu item `Tools/Entitas/Generate with external Code Generator`\nwhich connects to a running server and sends the `gen` command or connect yourself like this\n\n```\n$ mono CodeGenerator/entitas.exe client gen\n```\n\nThis will connect to a running server and send the `gen` command. This is useful if you want to add your own custom commands\nin your IDE like Visual Studio or Rider (or others).\n\nUsing the code generator server and client is optional but can greatly improve your workflow and\ncan drastically reduce the overhead of generating new files.\n\n\n# 0.43.0\n\nAs always, the Unity Asset Store version might take a few days to be processed and accepted by Unity.\nPlease check for updates in 2 - 4 days.\n\n### Breaking changes\nThe new code generator is part of `Entitas.Roslyn`. The Roslyn Plugins are now called `Entitas.Roslyn.CodeGeneration.Plugins`. If you already tested the new code generator beta, please update Entitas.properties\n- `Entitas.Roslyn.CodeGeneration.Plugins`\n- `Entitas.Roslyn.CodeGeneration.Plugins.ComponentDataProvider`\n- `Entitas.Roslyn.CodeGeneration.Plugins.EntityIndexDataProvider`\n\nNew mandatory keys have been added to Entitas.properties. You can automatically add them by running `entitas fix`\n\n### CodeGenerator\n- Added `ICodeGeneratorCachable` to cache and share objects between multiple plugins to avoid redundant calculations\n- Using the objectCache to share the AssemblyResolver between all plugins\n- Added CodeGenerator to default searchPaths\n- Added Unity menu item to generate with CLI\n\n<img width=\"242\" alt=\"entitas-unity-cli\" src=\"https://user-images.githubusercontent.com/233700/32442888-4c457022-c2fd-11e7-8665-bc9b7619e3f9.png\">\n\n### CodeGenerator CLI\n- Updated New command to use preferences\n- Added CLIConfig with new key `Entitas.CodeGeneration.CodeGenerator.CLI.Ignore.UnusedKeys` to add keys that should be ignored when running `entitas status` or `entitas doctor`. You can automatically ignore keys by pressing `i`\n\n<img width=\"906\" alt=\"entitas-cli-ignoreunusedkeys\" src=\"https://user-images.githubusercontent.com/233700/32444739-f3d660c0-c303-11e7-96ce-a111c9de2d89.png\">\n\n- Added support for custom properties files. Each command optionally accepts a path to a properties file. This way you can have multiple different configs how to run the code generator, e.g. one with the reflection-based code generator and one with the roslyn code generator.\n\n```csharp\nentitas gen My.properties\n```\n- Pretty CLI\n\n### Unity\n- Added Edit Button to Entitas Preferences\n\n<img width=\"449\" alt=\"entitas-preferences-editbutton\" src=\"https://user-images.githubusercontent.com/233700/32421256-c8e4fa88-c296-11e7-8c14-8d075444ed51.png\">\n\n### Asset Store Version\n- Changed project structure. The Plugins are now called `Entitas.Roslyn.CodeGeneration.Plugins`\n- Using the objectCache to share the ProjectParser between all plugins which speeds up the code generation process\n- Updated all packages to latest version and downgraded all projects from .NET 4.6.1 to .NET 4.6\n- Added more dependencies to remove warnings when running `entitas doctor` or `entitas gen`\n\n<img width=\"640\" alt=\"entitas-roslyn-nowarnings\" src=\"https://user-images.githubusercontent.com/233700/32421230-8766467a-c296-11e7-898a-0eaaa98c4e5a.png\">\n\n\n# 0.42.5\n\n### General\n- Refactored Preferences to fully embrace Entitas.properties and User.properties\n\n### CodeGenerator CLI\n- Added format command\n- keepAlive argument which will keep the process alive. This is very useful when using the new roslyn code generator to avoid reloading the whole parsing infrastructure. Using this argument ith roslyn results in super fast generation time\n\n```csharp\n$ entitas gen -a\n```\n\n\n# 0.42.4\n\n### Notes\nEntitas development is back on track again and the wait is over. This is probably one of the last updates before Entitas reaches 1.0.0.\nThis verion has been tested successfully in combination with the new code generator that will work even when the code is not compiling.\n\n### General\n- Added support for User.properties. You can now either overwrite values sepcified in Entitas.properties or use placeholders\n\nCreate a new file called User.properties and specify the keys and values that should be overwritten.\nYou can also specify placeholers like this `${myPlaceholder}` and specify the key either in Entitas.properties or User.properties.\nsee: [Match One - Entitas.properties](https://github.com/sschmid/Match-One/blob/master/Entitas.properties)\nsee: [Match One - User.properties](https://github.com/sschmid/Match-One/blob/master/User.properties)\n\n### Entitas\n- Groups are now enumerable to iterate over groups circumventing the internal caching and potentially reducing memory allocations #408\n\n```csharp\nforeach (var e in group) {\n  // Look closely: no group.GetEntities()\n}\n```\n\n### CodeGenerator CLI\n- Added commands add, set, remove, dump\n\n### VisualDebugging\n- Fixed Entitas Stats not ignoring built-in MultiReactiveSystem in systems count\n- VisualDebugging only lets you add components that the entity doesn't already have\n- GUI fixes\n\n### Other\n- Properties are now formatted by default for better readability\n- Ensuring dependencies in build scripts\n\n\n# 0.42.3\n\nHotfix release for\n- Fix Code Generation NullReferenceException in Unity 2017 #414\n\n\n# 0.42.2\n\nSee and discuss changes in [Milestone 0.42.2](https://github.com/sschmid/Entitas/milestone/16)\n\n### CodeGenerator\n- Fix Code Generation NullReferenceException in Unity 2017 #414\n- EntityIndexGenerator is sorting entity indices\n- CodeGenerator fix command runs recursively #409\n- Code Generator CLI maintenance\n\n### VisualDebugging\n- Update EntityDrawer to draw correct object type #399 #406\n\n\n# 0.42.1\n\n## Top new features:\nAdded missing support for flag components in ComponentEntityInterfaceGenerator\n\n### General\n- CodeGenerator CLI + Plugins are now included in zips and not deployed as separate zips\n\n### CodeGenerator\n- Added support for flag components in ComponentEntityInterfaceGenerator\n- Removed GameState from default contexts. Defaults are now Game and Input\n\n\n# 0.42.0\n\nSee and discuss changes in [Milestone 0.42.0](https://github.com/sschmid/Entitas/milestone/15)\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n- Removed Entitas.Blueprints.Unity.*\n- Changed ReactiveSystem.GetTrigger method signature\n- Marked obsolete: `context.DestroyEntity(entity)`. Use `entity.Destroy()` instead\n- Marked obsolete: `context.CreateCollector(matcher, event)`, use new `context.CreateCollector(triggerOnEvent)` when you need `.Removed` or `.AddedOrRemoved` (e.g. GameMatcher.View.Removed())\n\n## Top new features:\n- Use MultiReactiveSystem to process entities from different contexts in one system (see [Test Example](https://github.com/sschmid/Entitas/blob/develop/Tests/Unity/VisualDebugging/Assets/Examples/VisualDebugging/Systems/SomeMultiReactiveSystem.cs))\n- Use `entity.Destroy()` instead of `context.DestroyEntity(entity)`\n- Unit Testing in external console works on Windows now\n\n### General\n- Moved Entitas menu item under the Tools tab\n- Removed Entitas.Blueprints.Unity.* from zips\n- Creating new zip for code generator default plugins\n- UX improvements\n\n### Entitas\n- Added MultiReactiveSystem to support reactive systems observing different contexts #303\n- Added TriggerOnEvent\n- Renamed `entity.Destroy()` to `entity.InternalDestroy()` to reduce confusion\n- Added `entity.Destroy()` instead of `context.DestroyEntity(entity)` #254\n\n### CodeGenerator\n- Added ComponentEntityInterfaceGenerator #303\n- Updated ContextObserverGenerator to avoid `System.Security.SecurityException` on Windows #375\n- .ToSafeDirectory() supports empty string and “.” to specify current directory\n\n\n# 0.41.2\n\nAfter installing please check your Entitas.properties. Due to the addition of `IConfigurable` for code generator plugins\nsome keys in Entitas.properties changed. `entitas.exe doctor`, `entitas.exe status` and `entitas.exe fix` can help you\nfixing any issues. A new default Entitas.properties file will be created if none is found. The default Entitas.properties\nshould work with Unity without modification. For reference take a look at [Match-One - Entitas.properties](https://github.com/sschmid/Match-One/blob/master/Entitas.properties)\n\nExiting limitation mentioned in the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md) still apply (Entitas.Blueprints.CodeGeneration.Plugins is not supported in the code generator CLI)\n\n## Top new features:\n- UpdateCSProjPostProcessor will update your project.csproj. Generated methods are available immediately without switching to Unity and waiting for the project to be updated. This feels even better when using the new code generator (roslyn coming soon) where you don't even have to compile your project anymore - super fast feedback loops!\n- Better out-of-the-box experience when starting a new Unity project. Everything will work without any manual setup. Just generate :)\n- Great code generator CLI experience with helpful commands like `status` and `fix` which will let you modify Entitas.properties interactively\n- Logo refinements based on magic numbers (1.618 - golden ratio) :D\n\n### CodeGenerator\n- Added `IConfigurable` interface to easily create customizable and configurable code generator plugins\n- Fixed `ignoreNamespaces` by using the new `IConfigurable` #376\n- Added UpdateCSProjPostProcessor which updates project.csproj so you don't need to wait for Unity to update your project\n- Greatly improved the code generator CLI. `status` and `fix` command will help you a lot to spot and fix problems in Entitas.properties\n- Added `Compile.cs` to ensure `Assembly-CSharp.dll` in Unity\n- CodeGenFile converts to unix line endings when setting fileContent #352\n- Added progress indicator to code generator CLI when running with `-v` in verbose mode\n- Added multiple smaller sub configs for TargetDirectory, ContextNames, Assemblies, ProjectPath, IgnoreNamespaces\n- Placeholder `${myPlaceHolder}` in properties will remain even when overwriting\n- Caching AssemblyResolver\n\n### VisualDebugging\n- Drawing generic text labels for configurables found in Entitas.properties\n- Better error handling when Entitas.properties has problems\n\n### General\n- Refined logo. More pleasant to the eye and more readable in smaller icons\n\n\n# 0.41.1\n\nSee and discuss changes in [Milestone 0.41.1](https://github.com/sschmid/Entitas/milestone/14)\n\n### CodeGenerator\n- Added ContextMatcherGenerator #358 #358 @marczaku\n\n```csharp\n// instead of\nMatcher<GameEntity>.AllOf(GameMatcher.Position, GameMatcher.View);\n\n// you can write\nGameMatcher.AllOf(GameMatcher.Position, GameMatcher.View);\n```\n\n- Added option to ignore namespace in generated api\n  - Simply add `Entitas.CodeGeneration.Plugins.IgnoreNamespaces = true` to your Entitas.properties\n  - You can run `entitas status` to see if any plugins require additional keys\n\n```\n$ entitas status\nMissing key: Entitas.CodeGeneration.Plugins.IgnoreNamespaces\n```\n\n- Added `IConfigurable` to support optional keys needed in Entitas.properties\n\n### Other\n- Added properties.ToDictionary()\n\n\n# 0.41.0\n\nSee and discuss changes in [Milestone 0.41.0](https://github.com/sschmid/Entitas/milestone/13)\n\nThis milestone paves the way for a more customizable version of Entitas. A streamlined and modular project structure enables\ndeploying Entitas as Dlls which opens the door for 3rd party Addons and the extendable command line code generator.\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n- Renamed Entitas.properties config keys\n- Removed context.DeactivateAndRemoveEntityIndices()\n- Removed context.ClearGroups()\n- New namespaces as a consequence of project restructuring\n\n### General\n- Project restructuring. All Entitas projects are now in Entitas.sln, including all Addons and Unity projects\n- Deploying Entitas as Dlls instead of source code which has multiple benefits, e.g.\n  - Entitas Unity menu appears even if code doesn't compile\n  - Enables 3rd party Addons and Plugins\n  - Enables command line code generator\n\n### Entitas\n- Extracted Automatic Entity Reference Counting (AERC) as a strategy which can be set per context\n- Better exception handling for Entitas.properties config\n- Renamed config keys\n- Removed context.DeactivateAndRemoveEntityIndices()\n- Removed context.ClearGroups()\n\n### CodeGenerator\n- Added command line code generator #158 #353\n  - Unsupported Plugins: Entitas.Blueprints.CodeGeneration.Plugins, Entitas.CodeGeneration.Unity.Editor\n- ContextObserverGenerator puts VisualDebugging in try-catch to support Unit Testing #362\n- Added FeatureClassGenerator and removed Feature class from Entitas to support conditional compilation with `#if UNITY_EDITOR`\n- Added MethodData instead of using System.Reflection.MethodInfo\n- Added CleanTargetDirectoryPostProcessor\n\n### VisualDebugging\n- Removed Feature class\n- UX improvements\n- Better exception handling for Entitas.properties config\n\n\n# 0.40.0\n\nSee and discuss changes in [Milestone 0.40.0](https://github.com/sschmid/Entitas/milestone/12)\n\n### Note\nPlease update Entitas.properties by opening Entitas Preferences. Added `assemblyPath` and `codeGeneratorAssemblyPath`\nto code generator config. When not selected already, navigate to `Library/ScriptAssemblies/` in your Unity project\nand select `Assembly-CSharp.dll` for the assembly and `Assembly-CSharp-Editor.dll` for the code generator assembly.\n\n### Entitas.CodeGenerator\n- Add ConsoleWriteLinePostProcessor #342\n- Make EntitasPreferences.CONFIG_PATH public field in order to customize the path to the config file #342\n- Add CodeGeneratorUtil to simplify creating an instance based on Entitas.properties\n- Add `assemblyPath` and `codeGeneratorAssemblyPath` to code generator config\n\n### Entitas.Unity.VisualDebugging\n- Added SystemWarningThreshold to visualize slow systems\n- Tinting slow systems red\n- Systems list unfolded by default\n\n\n# 0.39.2\n\nSee and discuss changes in [Milestone 0.39.2](https://github.com/sschmid/Entitas/milestone/11)\n\n### Entitas\n- Optimize group update performance for component add/remove #321\n- Ignore indexed properties in PublicMemberInfo #339\n- More explicit EntityIndex.ToString()\n- More explicit EntityLink.ToString()\n\n### Entitas.Unity.VisualDebugging\n- Automatically draw types. No TypeDrawers #327\n\n\n# 0.39.1\n\nSee and discuss changes in [Milestone 0.39.1](https://github.com/sschmid/Entitas/milestone/10)\n\n### Entitas\n- Added `entityIndex.ToString()` with name #329\n\n### Entitas.CodeGenerator\n- Add ContextObserverGenerator #337\n- Simplified EntityIndexGenerator getKey\n\n### Entitas.Unity.VisualDebugging\n- Optimize DebugSystemsInspector #338\n\n### Entitas.Unity.Blueprints\n- Blueprints not persistent after changes to components. #331\n\n\n# 0.39.0\n\nSee and discuss changes in [Milestone 0.39.0](https://github.com/sschmid/Entitas/milestone/9)\n\n### Entitas\n- Added `entityIndex.ToString()` with name #329\n\n### Entitas.CodeGenerator\n- Add `contexts.Reset()` (#317)\n- Removed ComponentDataProvider without namespace #323\n- Don't generate EntityIndex when not specified #326\n- Cache static component index lookup into local var #316\n- Review and check for namespace awareness #328\n\n\n# 0.38.0\n\nSee and discuss changes in [Milestone 0.38.0](https://github.com/sschmid/Entitas/milestone/8)\n\nThis seems to be the release of enhancements! Lots of useful improvments and features have been added to\nincrease productivity and ease of use.\n\n### Breaking changes\n- Removed HideInBlueprintsInspector (#270 #306)\n- Changed interface `ITypeDrawer`\n- Added Contexts constructor (#286)\n\n# Entitas\n- Using ToString on subclassed components, too (#290)\n- Fixed cached entity ToString() wasn’t updated when calling entity.Release()\n- Fixed typo `TEntitiy` to `TEntity`(#291)\n\n# Entitas.Unity\n- Simplified DrawTexture\n- Refactored EntitasLayout\n\n# Entitas.CodeGenerator\n- Generating Entity Indices (#75 #319)\n- Added priority to ICodeGenFilePostProcessor\n- Move logic to DebugLogPostProcessor to speed up code generation\n- Added MergeFilesPostProcessor (#301)\n- Added Contexts constructor (#286)\n- Added default context (#288)\n- Using MemberData instead of PublicMemberInfo in DataProviders (#280)\n- Added progess report to code generator\n\n# Entitas.Unity.CodeGenerator\n- Added cancellable progess bar when generating\n\n# Entitas.Unity.VisualDebugging\n- Redesigned Entitas Preferences Window\n- Redesigned DebugSystemsInspector\n- Redesigned Type Drawers\n- Added component member search (#298)\n- Added search field to DictionaryTypeDrawer (#299)\n- Better UX, better Buttons\n- Entitaslayout.SearchTextField won’t affect GUI.change\n- Fixed Hashset changes didn’t replace component\n- Added `context.FindContextObserver()` for getting ContextObserver (#295)\n- Added default constructor to Feature class (#293)\n- Added Entitas Stats Dialog\n- EntityDrawer will use pooled components\n- Simplified EntityDrawer and TypeDrawers\n- Removed TypeEqualityComparer (#289)\n- Drawing public fields of unsupported types\n- Updated code templates for TypeDrawer and DefaultInstanceCreators (#297)\n\n# Entitas.Unity.Migration\n- Redesigned Entitas Migration Window\n\n# General\n- Using HD header textures\n\n\n# 0.37.0\n\nSee and discuss changes in [Milestone 0.37.0](https://github.com/sschmid/Entitas/milestone/7)\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\nThe deed is done. Entitas went type-safe! This was a huge task and I'm happy to finally share this with you guys!\nThis feature makes Entitas safer and more managable in growing code bases and will eliminate certain kind of bugs. Thanks to @mstrchrstphr\nfor starting the conversation and proposing solutions.\n\n### Entitas\n- Entitas went type-safe! (#257 #266)\n- Entity API doesn't return Entity anymore (e.g. e.AddComponent())\n- Fixed matchers not recalculating hash when changed\n- Added EntityIndex support for multiple keys (#279 #281)\n- Removed as many virtual keywords as possible\n\n### Entitas.CodeGenerator\n- Entitas went type-safe! (#257 #266)\n- Rewrote code generator architecture (#265 #274 #275)\n- ComponentsGenerator doesn't generate `e.IsMoveble(value)`. Only `e.isMoveble = value`\n- ComponentsGenerator Entity API doesn't return Entity anymore (e.g. e.AddPosition())\n- Added additional ComponentGenerator which respects namespaces (#274)\n\n### Entitas.Blueprints\n- Entitas went type-safe! (#257 #266)\n\n### Entitas.Migration\n- Automatically embedding all migrations to Entitas.Migration.exe\n\n### Entitas.Unity.Codegenerator\n- Added sloc (Source Lines Of Code) and loc (Lines Of Code) info\n\n### Entitas.Unity.VisualDebugging\n- Entitas went type-safe! (#257 #266)\n- Added EntityLink (#271)\n- Prettier search fields that support multiple search strings\n\n### Other\n- New folder structure with Entitas as the core and everything else as Addons\n- Complete reorganization of the project structure (more modular and easier to reason about)\n\n\n# 0.36.0\n\nSee and discuss changes in [Milestone 0.36.0](https://github.com/sschmid/Entitas/milestone/6)\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### Entitas\n- Removed pool.CreateSystem() (#233 #237)\n- Removed `IEnsureComponents`, `IExcludeComponents`, `ISetPools`, `ISetPool`, `IReactiveSystem`, `IMultiReactiveSystem`, `IEntityCollectorSystem`\n- Changed the ReactiveSystem to be an abstract class instead of `IReactiveSystem`. You need to override `GetTrigger`, `Filter` and `Execute`.\nThis enables filtering entities based on component values (#234)\n- Renamed the term Pool to Context (#99 #250)\n- Renamed `EntityCollector` to `Collector` (#252 #253)\n- Renamed `GroupEventType` to `GroupEvent` and removed the prefix `OnEntity`\n- entity.ToString uses component.ToString(). Override ToString() in your components\nto get a nice description, e.g. `Health(42)` (#203 #196)\n\n### Entitas.CodeGenerator\n- Removed OldPoolsGenerator\n- Fixed code generator line ending for header\n\n### Entitas.Unity.VisualDebugging\n- Improved VisualDebugging performance by reusing StringBuilders\n- Added support for `ICleanupSystem` and `ITearDownSystem`\n- Changed SystemsMonitor.axisRounding to 1\n- Fix error when turning visual debugging on/off in Unity 5.4 or newer (#222)\n- Changed default blueprint creation location (#206 #248)\n\n### Other\n- Simplified build pipeline\n\n\n# 0.35.0\n\nSee and discuss changes in [Milestone 0.35.0](https://github.com/sschmid/Entitas/milestone/5)\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### Entitas\n- Fixed adding disabled entities to groups (#192, #193)\n- Removed matcher with filter (#194, #195)\n\n### Other\n- Maintenance, cleanup and formatting\n- Completely new build system to create new releases\n\n\n# 0.34.0\n\nSee and discuss changes in [Milestone 0.34.0](https://github.com/sschmid/Entitas/milestone/4)\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### Entitas\n- Added api to clone entities (#178, #182)\n  - `pool.CloneEntity(e);`\n  - `entity.CopyTo(target);`\n\n- Added EntityIndex constructor with EqualityComparer (#170, #186)\n- Rename GroupObserver to EntityCollector (#168, #188)\n- Added filter condition to matchers (#165, #189)\n  - `Matcher.Position.Where(e => e.position.x > 10);`\n\n### Entitas.Serialization.Blueprints\n- Added HideInBlueprintInspectorAttribute (#185)\n\n### Other\n- Improved snippets\n- Added Visual Studio snippets (#172)\n- Added TestRunner to support test debugging (#175, #176)\n- Updated build scripts (#173, #177)\n- Added tests for code formatting\n\n\n# 0.33.0\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### Entitas\n- Added pools.CreateSystem()\n- Added ObjectPool and ObjectCache and updated EntitasCache to use ObjectCache (#157)\n- Added entityIndex.Activate() and removing entity indices from pool (#163)\n- Renamed IDeinitializeSystem to ITearDownSystem (#164)\n\n### Entitas.CodeGenerator\n- TypeReflectionProvider sorts pool names and ToUppercaseFirst() (#155)\n- CodeGeneratorConfig doesn't add default pool anymore (#156)\n\n### Other\n- Added repository icon\n- Added snippets (see Snippets folder)\n\n\n# 0.32.0\n\nSummer break is over! Entitas development is back on track!\nThanks all of you guys for using and contributing to Entitas.\nThis release is packed with improvements from all of you, thanks for that!\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### General\n- Lots of maintenance, refactoring, documentation and cleanup. Checked every class and every test ;)\n- Removed unused usings (#134 @thematthopkins )\n- Added script to generate docset and included it in build script (#141 @mstrchrstphr)\n- Updated policy.mdpolicy to support latest Xamarin Studio\n- Fixed inconsistent Line endings (#116 @ParagonFable)\n\n### Entitas\n- Added new `Pools` class. There is no static Pools anymore but an instance.\n- Added `ISetPools` to inject the shared pools instance\n- Removed `pool.CreateSystem<T>()` and `pool.CreateSystem(Type type)` (Apply migration 0.32.0)\n- Fixed `pool.CreateSystem()` not creating a ReactiveSystem for IGroupObserverSystem\n- Added `EntityIndex` (#154)\n- `pool.Reset()` removes all event handlers\n- Fixed retain / release didn't update entity toString cache\n- Added `EntitasCache` for object pooling of collections to reduce memory allocations\n- Updated Entity, Matcher and Pool to use EntitasCache (less garbage :heart:)\n- Added `ICleanupSystem`\n- Added `IDeinitializeSystem`\n- Pushing removed component to component pool after dispatching event\n\n### Entitas.CodeGenerator\n- Fixed ComponentIndicesGenerator with multiple pools (#124)\n- CodeGeneratorConfig will add default pool\n- Fixed pools order if default pool exists\n\n### Entitas.Unity.CodeGenerator\n- CodeGenerator Preferences is using MaskField instead of Toggles now\n\n### Entitas.Unity.VisualDebugging\n- Less editor repaints for DebugSystemsInspector to improve performance\n- Fixed system stats (Log stats) not ignoring Feature class\n- Add ITypeDrawer for doubles (#132 @bddckr)\n- Added support for enum masks (#132 @bddckr)\n- Adjusted foldout spacing in custom inspector (#149 @ByteSheep)\n\n### Other\n- Updated keys for Entitas.properties and moved files from Entitas.Unity to Entitas.Serialization.Configuration\n- Moved Properties from Entitas.Unity to Entitas.Serialization\n\n\n# 0.31.2\n\n### Entitas.CodeGenerator\n- All attributes can now be used for classes, interfaces and structs\n\n\n# 0.31.1\n\n### Entitas.CodeGenerator\n- Improved component generation for classes and interfaces and added support for default pool [Pool]\n- Added support to CustomComponentNameAttribute to generate multiple components with different names for one class or interface\n\n```csharp\n// This will automatically generate PositionComponent and VelocityComponent for you\n[Pool, CustomComponentName(\"Position\", \"Velocity\")]\npublic struct IntVector2 {\n  public int x;\n  public int y;\n}\n```\n\n- Added support for generating components for structs\n- Not generating obsolete pool attributes for generated classes\n\n\n# 0.31.0\n\n### General\n- Removed obsolete code\n\n### Entitas.CodeGenerator\n- Generating components for attributed classes and interfaces\n\n```csharp\n// will automatically generate SomeClassComponent for you\n[Core]\npublic class SomeClass {\n    public string name;\n\n    public SomeClass(string name) {\n        this.name = name;\n    }\n}\n```\n\n- Added support to add empty PoolAttribute to assign component to default pool\n\n```csharp\n// using [Pool] will also add this component to Pools.pool\n[Core, Pool]\npublic class SomeComponent : IComponent {\n}\n```\n\n### Entitas.Unity.VisualDebugging\n- Added IComponentDrawer which can draw the whole component\n- Added EntitasEntityErrorHierarchyIcon to indicate retained entities in the hierarchy\n- Added CharTypeDrawer\n- Fixed components not updating in the inspector (#107)\n- Improved SystemsMonitor and added average line\n\n![Entitas-SystemsMonitor](https://cloud.githubusercontent.com/assets/233700/15198441/a515d764-17d7-11e6-965c-83c027fa89f7.png)\n\n### Entitas.Unity.Serialization.Blueprints\n- Fixed finding all BinaryBlueprints even when not loaded\n- Correctly saving Blueprints when setting all BinaryBlueprints\n- Added BlueprintsNotFoundException\n- BinaryBlueprintInspector creates new pools instead of using one of Pools.allPools\n- Fixed pool not shown when entering play-mode while a blueprint was selected in the project view\n- Not caching blueprints when UNITY_EDITOR to enable live edit\n\n# 0.30.3\n\n### Entitas.CodeGenerator\n- Added support for whitespace, '-' and braces in blueprint names\n\n### Entitas.Unity.Serialization.Blueprints\n- Blueprints.FindAllBlueprints orders all blueprints by name\n- Fixed pool not shown in hierarchy\n\n\n# 0.30.2\n\n### Note\nThis release introduces Blueprints for Entitas (Beta). Update if you want to\nuse and play with Blueprints. [Read more...](https://github.com/sschmid/Entitas/wiki/Blueprints-(Beta))\n\n### Entitas.CodeGenerator\n- Only creating PoolObserver when Application.isPlaying\n- Added BlueprintsGenerator\n\n### Entitas.Unity.VisualDebugging\n- Added more options for sorting systems in the inspector\n- Removing event handlers from pool observer when leaving play-mode\n\n### Entitas.Serialization.Blueprints\n- Added Blueprints (and more)\n\n### Entitas.Unity.Serialization.Blueprints\n- Added BlueprintInspector (and more)\n\n### Other\n- Moved build scripts into a folder\n\n\n# 0.30.1\n\n### Entitas.Unity.VisualDebugging\n- Fixed GameObjectDestroyExtension.DestroyGameObject() compile time error (#91)\n- Improved SystemsMonitor.Draw() to use correct available width even with scrollbars\n- Tweaked drawing systems list\n- Added EntitasPoolErrorHierarchyIcon to visualize when there are erros\n\n### Other\n- Updated build_commands.sh to generate C# project from Unity\n\n\n# 0.30.0\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### Entitas\n- Added IGroupObserverSystem which allows ReactiveSystems to observe multiple pools\n- Added pools.CreateGroupObserver() to simplify creating a GroupObserver for multiple pools\n\n### Entitas.CodeGenerator\n- TypeReflectionProvider ignores abstract IComponents (#88)\n- Renamed ComponentsGenerator to ComponentExtensionsGenerator\n- Renamed PoolAttributeGenerator to PoolAttributesGenerator\n\n### Entitas.Unity\n- Moved Assets/Entitas.Unity to Assets/Entitas/Unity\n- Simplified folder structure in Entitas-Unity.zip\n\n### Entitas.Unity.CodeGenerator\n- Ignoring obsolete code generators\n- Generate button changes size depending on generators list height\n\n### Entitas.Unity.VisualDebugging\n- Added Feature class which inherits from Systems or DebugSystems for you, so you don't have to care anymore\n- Fixed MissingReferenceException occurring occasionally when stopping game (#71)\n- Added support for editing entities in EditorMode (non-playing mode)\n- Fixed bug when components are added on entity creation (#87)\n- Added clear buttons to search textfields\n- Improved DateTimeTypeDrawer\n- Added new hierarchy icons for pool and systems\n\n### Entitas.Migration\n- Added M0300\n- Moving Entitas.Migration into Entitas/Migration/Editor when creating Entitas-Unity.zip\n\n\n# 0.29.1\n\n### Entitas.CodeGenerator\n- Added missing support for components with properties\n- Updated ComponentsGenerator to use entity.CreateComponent()\n\n### Entitas.Unity.CodeGenerator\n- Added missing support for components with properties\n\n\n# 0.29.0\n\n### Obsolete\nMarked old PoolMetaData constructor obsolete. If you encounter compile errors please apply Migration 0.26.0, open C# project and generate again.\n\n### General\n- Unified Entitas sub projects into a single project\n- Unified all Unity projects into a single project\n- Documentation maintenance\n\n### Entitas\n- Removing all event handler for entity.OnEntityReleased after event got dispatched\n- Printing entity in EntityIsNotDestroyedException\n- Added TypeExtension.ImplementsInterface()\n- Added component types to PoolMetaData\n- Made all methods in Systems virtual\n- Added auto generated header to generated files\n\n```\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by Entitas.CodeGenerator.ComponentsGenerator.\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n```\n\n### Entitas.CodeGenerator\n- Using pool specific componentIds lookup when generating matchers for components with multiple pools\n- TypeReflectionProvider ignores interfaces\n\n### Entitas.Serialization\n- Added Entitas.Serialization\n- Added PublicMemberInfo\n\n### Entitas.Unity.CodeGenerator\n- Compile errors won't block code generation anymore\n- Printing total generated file count when generating\n\n### Entitas.Unity.VisualDebugging\n- Destroying EntityBahviour when entity got released\n- Using entity component pool and providing correct previous and new component\n- Added unique color for each component in EntityInspector\n- Added component search field in EntityInspector\n\n<img alt=\"Entitas-Component-Search\" src=\"https://cloud.githubusercontent.com/assets/233700/13554841/98141fac-e3b2-11e5-81ef-4ef39cf2bb4c.gif\" width=\"417\" />\n\n- 'Destroy Entity' Buttons are now red\n- Simplified EntityInspector and made methods static\n- Unfolded components info is now shared between entities within same pool\n- Added shortcuts to Entitas Preferences and Generate\n- Improved TypeDrawers\n- Stepper UI tweaks\n\n![Entitas.Unity.VisualDebugging-Systems](https://cloud.githubusercontent.com/assets/233700/13554882/9c0bd7c0-e3b3-11e5-89ec-65fa888f0a48.png)\n\n- Renamed 'Script Call Optimization' to 'Optimizations'\n- Added EntitasEditorLayout\n\n\n# 0.28.2\n\n### Entitas\n- Added ReactiveSystem destructor to prevent memory leaks\n- Added GroupObserver destructor to prevent memory leaks\n\n### Entitas.Unity.VisualDebugging\n- EntityInspector now supports dropping UnityEngine.Object into fields that are null\n\n![Entitas.Unity.VisualDebugging-DefaultInstanceCreator](https://cloud.githubusercontent.com/assets/233700/12884636/ea8c468c-ce5f-11e5-91a9-0fdf83de7252.png)\n\n- UI tweaks\n\n\n# 0.28.1\n\n### Entitas.Unity\n- Added \"Script Call Optimization\" to Entitas Preferences Window\n- Added priority to IEntitasPreferencesDrawer\n- Tweaked UI\n\n![Entitas.Unity-ScriptCallOptimization](https://cloud.githubusercontent.com/assets/233700/12832387/e893b3ec-cb99-11e5-8ccb-d3478ca0c6dc.png)\n\n### Entitas.Unity.VisualDebugging\n- Added toggle to Entitas Preferences to enable or disable Visual Debugging\n- Tweaked UI\n\n![Entitas.Unity.VisualDebugging-Toggle](https://cloud.githubusercontent.com/assets/233700/12832391/ec74d2e8-cb99-11e5-87b3-f76e2e9ea58d.png)\n\n\n# 0.28.0\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### Entitas\n- Added documentation (#55)\n- Added an object pool for components (#58)\n- Added pool.ClearComponentPool(index) and pool.ClearComponentPools()\n- Added ENTITAS_FAST_AND_UNSAFE compiler flag. When set it will speed up e.Retain() and e.Release() (#59)\n\n### Entitas.CodeGenerator\n- Generated component extensions are now reusing components using a component object pool when destroying entities (#58)\n- Added tests for testing the logic of generated files\n- Decoupling code generation logic by adding Code Generator Intermediate Format (#62)\n- Added TypeReflectionProvider\n- Supporting components with namespace\n- Simplified linq expressions\n- Removed generated systems\n- The Code Generator is not depending on Entitas anymore\n\n### Entitas.CodeGenerator.TypeReflection\n- Added Entitas.CodeGenerator.TypeReflection project\n\n### Entitas.Unity\n- Added `keys` and `values` getter to Properties\n\n### Entitas.Unity.VisualDebugging\n- Added system search field to DebugSystemsInspector\n- UI tweaks and performance optimizations\n- Fixed logging wrong system stats\n- Added header image and current version label to Entitas Preferences Window\n\n![Entitas.Unity.Visualdebugging-preferences](https://cloud.githubusercontent.com/assets/233700/12795069/a13e5b6e-cab8-11e5-937d-870790e2bfe1.png)\n\n### Entitas.Unity.Migration\n- Added Entitas.Unity.Migration which provides an easy way to migrate source files\n- Added header image and current version label to Entitas Migration Window\n\n![Entitas.Unity.Migration](https://cloud.githubusercontent.com/assets/233700/12795026/6acf24b4-cab8-11e5-90e3-98a103676d50.png)\n\n### Other\n- Removed redundant files and gitignored Entitas in all Unity projects (#63)\n- Removed Unity projects from Entitas.sln\n- Removed warnings\n\n\n# 0.27.0\n\n### Note\nIf you're using Entitas with Unity, please open the Entitas preferences and make sure that all your desired code generators are activated. Due to some code generator renamings the ComponentLookupGenerator and the ComponentsGenerator are inactive. Activate them (if desired) and generate.\n\n### Entitas\n- Added `pool.Reset()` which clears all groups, destroys all entities and resets creationIndex\n\n### Entitas.CodeGenerator\n- Renamed some code generators\n- Added `CustomPrefixAttribute` to support custom prefixes for flag components\n```\n[CustomPrefix(\"flag\")]\npublic class DestroyComponent : IComponent {\n}\n\n// default\nentity.isDestroy = true;\n\n// with CustomPrefixAttribute\nentity.flagDestroy = true;\n```\n\n### Entitas.Unity\n- Added \"Feedback\" menu item to report bugs, request features, join the chat, read the wiki and donate\n\n### Entitas.Unity.CodeGenerator\n- Removing invalid code generator names from Entitas.properties\n\n### Entitas.Unity.VisualDebugging\n- Lots of UI tweaks\n- Added toggle to sort systems by execution duration\n- Added toggle to hide empty systems\n- ReactiveSystems are highlighted with a white font color\n- Added Clear Groups Button\n- Added Entity Release Button\n- Splitted systems list into initialize and execute systems and visualizing them separately\n- Improved stepper UI\n\n### Entitas.Migration\n- All migrations now contain information about on which folder they should be applied\n\n```\n0.26.0\n  - Deactivates code to prevent compile erros\n  - Use on folder, where generated files are located\n```\n\n### Other\n- Added Commands.GenerateProjectFiles and using it in build.sh\n- Updated build.sh and build_commands.sh to include latest MigrationAssistant.exe\n\n\n# 0.26.1\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n\n# 0.26.0\n\n### General\n- Updated projects to Unity 5.3\n- Improved all error messages and added hints\n- Changed and applied policy.mdpolicy to all sources\n\n### Entitas.Unity\n- Moved Entitas Preferences to its own Editor Window\n\n![Entitas.Unity - Entitas Preferences Window](https://cloud.githubusercontent.com/assets/233700/12222689/9492611a-b7c3-11e5-880d-c4cc83c9234e.png)\n\n### Other\n- Added runTests.bat for running test on windows (#49)\n- Updated license\n\n\n# 0.25.0\n\n### Entitas\n- Improved AERC performance\n- Added group.RemoveAllEventHandlers()\n- Added pool.ClearGroups() to remove all groups and remove all their event handlers\n- Added pool.ResetCreationIndex()\n- Throwing exception when there are retained entities and pool.DestroyAllEntities() is called\n- Renamed entity.refCount to entity.retainCount\n\n### Entitas.Unity.VisualDebugging\n- Fixed creating entities\n- Showing warning when there are retained entities\n\n### Other\n- Added UnityTests project with Unity Test Tools to fix a Unity specific HashSet bug\n\n\n# 0.24.6\n\n### Entitas\n- Changed entity.Retain() to accept an owner object\n\n### Entitas.Unity.VisualDebugging\n- Added VisualDebugging support for displaying owners of entities\n\n![Entitas.Unity.VisualDebugging-RefrenceCount](https://cloud.githubusercontent.com/assets/233700/11320810/0463033a-90a7-11e5-931b-5074b50d7e62.png)\n\n\n# 0.24.5\n\n### Entitas\n- Fixed dispatching group events after all groups are updated\n\n### Entitas.CodeGenerator\n- Supporting ENTITAS_DISABLE_VISUAL_DEBUGGING compiler flag\n\n\n# 0.24.4\n\n### Entitas\n- Added entity.componentNames. This field is set by Entitas.Unity.VisualDebugging to provide better error messages\n- Added matcher.componentNames. This field is set by Entitas.Unity.CodeGenerator to provide better error messages\n- entity.ToString() now removes ComponentSuffix\n- Fixed typo\n\n### Entitas.Unity.CodeGenerator\n- ComponentExtensionsGenerator sets matcher.componentNames\n- Removed generating unused using in ComponentExtensionsGenerator\n\n### Other\n- Added update_project_dependencies.sh\n- Refactored build commands into build_commands.sh\n\n\n# 0.24.3\n\n### Entitas\n- Added systems.ActivateReactiveSystems() and systems.DeactivateReactiveSystems which should be called when you don't use systems anymore\n\n### Other\n- Merged shell scripts\n\n\n# 0.24.2\n\n### General\n- Renamed XyzEditor to XyzInspector\n- Streamlined naming\n\n### Entitas.Unity.VisualDebugging\n- Simplified adding a component at runtime\n\n### Other\n- buildPackage.sh now creates Entitas-CSharp.zip and Entitas-Unity.zip\n\n\n# 0.24.1\n\n### Entitas.Unity.VisualDebugging\n- Added support for adding components to multiple entities at once at runtime\n\n![Entitas.Unity.VisualDebugging-Entity](https://cloud.githubusercontent.com/assets/233700/10293066/d4668120-6bb2-11e5-895e-cfdd25cc2e74.png)\n\n\n# 0.24.0\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### Entitas.Unity.CodeGenerator\n- Throwing exception when attempting to generate while Unity is still compiling or assembly won't compile\n\n### Entitas.Unity.VisualDebugging\n- Added support for creating entities and adding components at runtime\n\n![Entitas.Unity.VisualDebugging-PoolObserver](https://cloud.githubusercontent.com/assets/233700/10291395/d83c3ec4-6ba9-11e5-9c1d-3e18fe2c6370.png)\n\n![Entitas.Unity.VisualDebugging-Entity](https://cloud.githubusercontent.com/assets/233700/10291401/e15d29be-6ba9-11e5-8fc1-87767430342c.png)\n\n\n# 0.23.0\n\n### Breaking changes\nBefore updating, please follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n- Gerneral\n  - Updated and applied policy\n\n### Entitas\n- Reimplemented new matcher AnyOf and NoneOf\n\n```csharp\nMatcher.AllOf(Matcher.A, Matcher.B)\n       .AnyOf(Matcher.C, Matcher.D)\n       .NoneOf(Matcher.E, Matcher.F);\n\n```\n\n### Entitas.CodeGenerator\n- Updated generators to work with new matchers\n- PoolsGenerator generates Pools.allPools (#39)\n- Code Generators convert local newline to unix newline\n\n### Entitas.Unity.CodeGenerator\n- Changed CodeGeneratorConfig.disabledCodeGenerators to CodeGeneratorConfig.enabledCodeGenerators\n\n\n# 0.22.3\n\n### Entitas\n- Added reactiveSystem.Clear() and systems.ClearReactiveSystems()\n- Added IClearReactiveSystem. When implemented, clears reactive system after execute finished\n\n\n# 0.22.2\n\n### Fixes\n- Entitas\n  - GroupObserver retains entities only once\n\n### Entitas.Unity.VisualDebugging\n- PoolObserver now shows retained entities\n- Destroying EntityBehaviour e.OnEntityReleased instead of e.OnComponentRemoved\n\n### Other\n- New logo\n\n\n# 0.22.1\n\n### Entitas\n- Throwing an exception when releasing an entity that is not destroyed yet (#32)\n\n### Entitas.Unity.VisualDebugging\n- Added hierarchy icon\n- Renamed DebugSystems related classes\n\n### Other\n- buildPackage.sh includes HierarchyIcon.png.meta\n\n\n# 0.22.0\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n- Entitas\n  - Restored previous pool.DestroyEntity() behaviour\n  - IReactiveSystem and IMultiReactiveSystem changed and use `TriggerOnEvent`\n  - Use the command line tool `MigrationAssistant.exe` to automatically migrate IReactiveSystem\n  - Renamed IStartSystem.Start to IInitializeSystem.Initialize (#21)\n\n### Fixes\n- Entitas\n  - e.RemoveAllComponents() updates toString cache, even if entity has no components\n\n### Entitas\n- Added AERC (Automatic Entity Reference Counting) (#30, solves #25)\n- Reduced gc allocations in e.RemoveAllComponents()\n- Reduced gc allocations in pool.CreateEntity() and pool.DestroyEntity()\n- pool.DestroyEntity() will clean suscribed event delegates of entities (#27)\n- entity.ToString() will always use component type\n- Streamlined and refactored tests and sources\n\n### Entitas.Unity.VisualDebugging\n- Improved SystemMonitorEditor graph performance (#14)\n\n### Entitas.Migration\n- Added M0220 (Migrates IReactiveSystem to combine trigger and eventTypes to TriggerOnEvent)\n- Updated migration descriptions\n\n### Other\n- Removed project files\n- Renamed updateDependencies.sh to updateProjects.sh\n- buildPackage.sh includes EntitasUpgradeGuide.md in Entitas.zip\n\n\n# 0.21.0\n\n### Fixes\n- Entitas.Migration\n  - Changed target framework to .NET 3.5 to fix build errors in VisualStudio (#22)\n\n### Entitas\n- Changed pool.DestroyEntity(entity) behaviour\n  - won't trigger group.OnEntityRemoved anymore\n  - triggers group.OnEntityWillBeDestroyed\n  - removes entity from all groupObserver.collectedEntities\n    - ReactiveSystem doesn't pass on destroyed entities anymore\n- ReactiveSystem doesn't call Execute() when filtered entities.Count == 0\n\n### Other\n- Added project files (#18)\n\n\n# 0.20.0\n\n### Breaking changes\n- Entitas\n  - Removed all matchers except AllOfMatcher\n\n### Entitas\n- Added `IEnsureComponents` to optionally ensure entities passed in via ReactiveSystem have certain components\n- Added `IExcludeComponents` to optionally exclude entities passed in via ReactiveSystem\n- Added support for multiple PoolAttributes on components\n\n```csharp\n[PoolA, PoolB, PoolC]\npublic class SomeComponent : IComponent {}\n```\n\n### Entitas.Unity.CodeGenerator\n- Added `disabledCodeGenerators` to CodeGeneratorConfig\n- Added code generator toggles to CodeGeneratorPreferencesDrawer\n\n![Entitas.Unity.Codegenerator.disabledcodegenerators](https://cloud.githubusercontent.com/assets/233700/9046406/b4c6b7c2-3a2a-11e5-8624-a8988f684579.png)\n\n### Entitas.Unity.VisualDebugging\n- Nicer stats\n\n\n# 0.19.1\n\n### Entitas\n- GroupObserver supports observing multiple groups\n- Added support for IMultiReactiveSystem\n- Added internal entity._isEnabled to prevent modifying pooled entities\n- Replaced internal object pool with Stack<Entity>\n\n### Entitas.CodeGenerator\n- Fixed generated replace method, when replacing non existent component\n\n### Entitas.Unity.VisualDebugging\n- Drastically improved performance and memory usage by caching ToString() and reducing setting gameObject.name\n\n\n# 0.19.0\n\n### Breaking changes\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n- Entitas\n  - Added new e.OnComponentReplaced and removed all *WillBeRemoved events\n  - Added component index and changed component to OnEntityAdded and OnEntityRemoved\n  - IReactiveSystem.Execute takes List<Entity> instead of Entity[]\n    - Entitas now runs without producing garbage!\n\n- Entitas.CodeGenerator\n  - Removed support for properties in components\n\n- Entitas.Unity.VisualDebugging\n  - Replaced DebugPool with a more flexible PoolObserver\n\n### Entitas\n- Added group.OnEntityUpdated event with previous and new component\n\n### Entitas.CodeGenerator\n- ComponentExtensionsGenerator generates component object pool\n- Converting newlines in generated files to Environment.NewLine (Pull request #11, thanks @movrajr)\n\n### Other\n- Added policy.mdpolicy\n\n\n# 0.18.3\n\n### Entitas\n- Added ReactiveSystem.Activate() and .Deactivate()\n\n### Entitas.Unity.VisualDebugging\n- Displaying nested systems hierarchy for DebugSystems\n\n![Entitas.Unity.VisualDebugging-DebugSystemsHierarchy](https://cloud.githubusercontent.com/assets/233700/8761742/6e26dd22-2d61-11e5-943b-94683b7b02ec.png)\n![Entitas.Unity.VisualDebugging-DebugSystemsHierarchyEditor](https://cloud.githubusercontent.com/assets/233700/8761746/9628dbfe-2d61-11e5-9b75-570e5c538c0d.png)\n- Unchecking a ReacitveSystem in VisualDebugging deactivates it\n\n\n# 0.18.2\n\n### Entitas.CodeGenerator\n- Fixed #9\n\n\n# 0.18.1\n\n### Entitas.CodeGenerator\n- ComponentExtensionsGenerator now supports properties\n\n\n# 0.18.0\n\n### Breaking changes\n- Use the command line tool `MigrationAssistant.exe` to automatically migrate\n    - Changed IReactiveSystem.GetTriggeringMatcher to IReactiveSystem.trigger\n    - Changed IReactiveSystem.GetEventType to IReactiveSystem.eventType\n\nPlease follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### Entitas.Unity\n- Fixed code generation issues on Windows by converting and normalizing line endings\n- Fixed EntitasCheckForUpdates.CheckForUpdates() by temporarily trusting all sources\n\n\n# 0.17.0\n\n### Breaking changes\n- Added `systemCodeGenerators` to CodeGenerator.Generate()\n\n```csharp\nCodeGenerator.Generate(Type[] types, string[] poolNames, string dir,\n                            IComponentCodeGenerator[] componentCodeGenerators,\n                            ISystemCodeGenerator[] systemCodeGenerators,\n                            IPoolCodeGenerator[] poolCodeGenerators)\n```\n\n### Entitas.CodeGenerator\n- Added PoolsGenerator which creates a getter for all pools\n\n```csharp\nvar pool = Pools.pool;\nvar metaPool = Pools.meta;\n```\n\n- Added SystemExtensionsGenerator\n\n```csharp\nnew Systems()\n    .Add(pool.CreateGameBoardSystem())\n    .Add(pool.CreateCreateGameBoardCacheSystem())\n    .Add(pool.CreateFallSystem())\n    .Add(pool.CreateFillSystem())\n\n    .Add(pool.CreateProcessInputSystem())\n\n    .Add(pool.CreateRemoveViewSystem())\n    .Add(pool.CreateAddViewSystem())\n    .Add(pool.CreateRenderPositionSystem())\n\n    .Add(pool.CreateDestroySystem())\n    .Add(pool.CreateScoreSystem());\n```\n- Added Components, Systems & Pools sub folders to generated folder\n\n### Entitas.Unity\n- Properties split with Environment.NewLine instead of '\\n'\n\n### Entitas.Unity.CodeGenerator\n- Entitas preferences appends \"/Generated/\" to generated folder if necessary\n\n### Entitas.Unity.VisualDebugging\n- Using Queue<float> for SystemsDebugEditor.systemMonitorData\n\n\n# 0.16.0\n\n### Breaking changes\n- Moved system getters from Systems to DebugSystems\n\n### Entitas.Unity.CodeGenerator\n- Generated ComponentIds use array instead of dictionary for component name lookup\n\n### Entitas.Unity.VisualDebugging\n- Added \"Step manually\" to DebugSystems\n- Added activate / deactivate systems at runtime\n- Displaying Systems.totalSystemsCount in SystemsDebugEditor\n- Added SystemsMonitor visual graph\n\n![Entitas.Unity.VisualDebugging-DebugSystems](https://cloud.githubusercontent.com/assets/233700/8241713/3bf5e3ce-160b-11e5-8876-497bb09c04b1.png)\n- Removed override DebugSystems.DestroyAllEntities()\n\n\n# 0.15.0\n\n### Entitas\n- Added entitas_version file\n- Added CreateSystem(ISystem) to PoolExtensions\n- Fixed typo GroupObserver.ClearCollectedEntities()\n\n### Entitas.Unity\n- Added \"Check for updates...\" menu item\n\n### Entitas.Unity.VisualDebugging\n- Added Stats menu item to log current components, systems and pools\n\n\n# 0.14.0\n\n### General\n- Upgraded all Unity projects to Unity 5\n\n### Entitas\n- Added Systems class\n- Re-combined pool extensions for creating systems to pool.CreateSystem() and removed pool.CreateStartSystem() and pool.CreateExecuteSystem()\n- Fixed: Pool won't destroy entities it doesn't contain\n\n### Entitas.Unity\n- Properties now support multiline values and placeholder replacement with ${key}\n\n### Entitas.Unity.CodeGenerator\n- Added fluent api to Entity\n\n```csharp\npool.CreateEntity()\n    .IsGameBoardElement(true)\n    .IsMovable(true)\n    .AddPosition(x, y)\n    .AddResource(Res.Piece0)\n    .IsInteractive(true);\n```\n- CodeGenerator takes arrays of IComponentCodeGenerator and IPoolCodeGenerator to generate files so you can easily provide your own custom code generators\n- Added dialog for 'Migrate Matcher' menu item\n\n### Entitas.Unity.VisualDebugging\n- Added DebugSystems\n\n![Entitas.Unity.VisualDebugging-Systems](https://cloud.githubusercontent.com/assets/233700/7938066/ebe8b4b6-0943-11e5-9cec-ce694d624aca.png)\n- Added HashSetTypeDrawer\n\n\n# 0.13.0\n\n### Reminder\n- Entitas 0.12.0 generates prefixed matchers based on the PoolAttribute and introduces some API changes. Please follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### General\n- Split into multiple modules and seperate projects. Entitas now consists of\n  - Entitas\n  - Entitas.CodeGenerator\n  - Entitas.Unity\n  - Entitas.Unity.CodeGenerator\n  - Entitas.Unity.VisualDebugging\n\n### Entitas.Unity\n- Added IEntitasPreferencesDrawer to be able to extend the Entitas preferences panel\n\n### Entitas.Unity.CodeGenerator\n- Entitas preferences internal keys changed. Please check your settings in projectRoot/Entitas.properties and update keys\n  - Entitas.CodeGenerator.GeneratedFolderPath -> Entitas.Unity.CodeGenerator.GeneratedFolderPath\n  - Entitas.CodeGenerator.Pools               -> Entitas.Unity.CodeGenerator.Pools\n\n### Entitas.Unity.VisualDebugging\n- Added support to set fields to null\n- Added support to create a new instance if the value of a field is null\n- Added IDefaultInstanceCreator to create default objects for unsupported types\n- Added IDefaultInstanceCreator implementations for array, dictionary and string\n- Added support to insert and remove elements from lists, arrays and dictionaries\n\n![Entitas.Unity.VisualDebugging-ITypeDrawer](https://cloud.githubusercontent.com/assets/233700/7339538/226d8028-ec72-11e4-8971-53029fb20da8.png)\n- Added name property to DebugPool\n- Added VisualDebuggingConfig and VisualDebuggingPreferencesDrawer\n\n![Entitas.Unity.VisualDebugging-Preferences](https://cloud.githubusercontent.com/assets/233700/7339599/ef454f34-ec74-11e4-9775-963f477bfb16.png)\n- EntityDebugEditor can generate IDefaultInstanceCreator and ITypeDrawer implementations for unsupported types\n- Fixed: handling null values\n- Renamed ICustomTypeDrawer to ITypeDrawer\n- Big refactoring to simplify drawing types\n\n### Other\n- buildPackage.sh keeps uncompressed source files in bin folder\n- Added updateDependencies.sh which updates all dependencies of Entitas.Unity.CodeGenerator, Entitas.Unity.VisualDebugging and tests\n- Renamed and moved files and folders to be more consistent with the new project structure\n\n\n# 0.12.0\n\n### Important\n- Entitas 0.12.0 generates prefixed matchers based on the PoolAttribute and introduces some API changes. Please follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### Entitas\n- Added IStartSystem and pool.CreateStartSystem() extension\n- Renamed pool.CreateSystem() to pool.CreateExecuteSystem()\n- Added pool.CreateStartSystem()\n- Added EntitasUpdater to automatically update the introduced matcher API changes\n\n### Visual Debugging\n- Fixed null exceptions\n- Added support for multi dimensional and jagged arrays\n- Removed Debug.Log\n\n### Code Generator\n- Added Code Generator PreferenceItem\n  - set generated folder path\n  - define multiple pools\n\n![Entitas.Unity.CodeGenerator-Preferences](https://cloud.githubusercontent.com/assets/233700/7296726/8d74bb5a-e9c2-11e4-8324-10a0db7191ff.png)\n- Added PoolAttributeGenerator\n- Generated Matcher is now prefixed based on PoolAttribute (e.g. UIMatcher)\n- Generating ToString() for matchers to print component name instead of index\n- IndicesLookupGenerator generates indices ordered alphabetically\n- Added TypeGenerator to streamline string generation from types\n- Added support for nested classes\n\n### Other\n- Added Properties and CodeGeneratorConfig to serialize Entitas preferences to file\n- Removed warning in AbstractCompoundMatcher\n- buildPackage.sh only builds when all tests are passing\n- buildPackage.sh deletes meta files before creating zip archive\n\n\n# 0.11.0\n\n### Reminder\n- Entitas 0.10.0 included lots of renaming. Please follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md) if you are on < v0.10.0\n\n### Entitas\n- Added AllOfCompoundMatcher\n- Added AnyOfMatcher\n- Added AnyOfCompoundMatcher\n- Added NoneOfMatcher\n- Added NoneOfCompoundMatcher\n- Updated Entitas to handle any implementation of IMatcher\n- Fixed dispatching OnComponentAdded when replacing a non existing component with null\n- Optimizations\n\n### Visual Debugging\n- Added support for custom type drawers `ICustomTypeDrawer`\n- Added component folding and pooled entities count\n- Added groups to PoolDebugEditor\n\n![Entitas.Unity.VisualDebugging-Groups](https://cloud.githubusercontent.com/assets/233700/6547980/e342b3fe-c5e9-11e4-8caa-77662a14679b.png)\n- Added support for IList\n\n![Entitas.Unity.VisualDebugging-IList](https://cloud.githubusercontent.com/assets/233700/6547984/eecc3e3e-c5e9-11e4-98bb-700a84047abe.png)\n- UI improvements\n\n### Code Generator\n- Fixed typeShortcuts to use type.FullName to support UnityEngine.Object (conflicted with System.Object)\n- Added EntitasCodeGeneratorMenuItem\n\n### Other\n- Moved and renamed some folders\n- Added buildPackage.sh which creates a bin/Entitas.zip with all necessary source files\n\n\n# 0.10.0\n\n### Important\n- Entitas 0.10.0 includes lots of renaming. Please follow the [Entitas upgrade guide](https://github.com/sschmid/Entitas/blob/master/EntitasUpgradeGuide.md)\n\n### Entitas\n- Added empty ISystem and IExecuteSystem for more flexibility\n- Added public creationIndex to Entity\n- Observer is now on group not on pool\n- Removed WillBeRemovedSystem and observer\n- Added CreateSystem to PoolExtension\n- Added fast entities count call to Pool\n- Added creationIndex to entity.ToString()\n- pool.CreateEntity() and pool.DestroyEntity() are now virtual\n\n### Visual Debugging\n- Added VisualDebugging\n\n### Code Generator\n- Supports enums nested in components\n- Added option to [DontGenerate] to ignore generating index, too\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "Contributing to Entitas\n=======================\n\nThe project is hosted on [GitHub][repo] where you can [report issues][issues], fork the project and [submit pull requests][pulls].\nEntitas is developed with [TDD (Test Driven Development)](https://en.wikipedia.org/wiki/Test-driven_development) and [nspec](http://nspec.org).\nNew features are introduced following the [git-flow](https://github.com/nvie/gitflow) conventions.\n\nSetup Entitas on your machine\n=============================\n\nFork the repository on [GitHub][repo] and clone your forked repository to your machine\n\n```\n$ git clone https://github.com/<username>/Entitas.git\n````\n\nIf you want to contribute please consider to set up [git-flow](https://github.com/nvie/gitflow).\nThe default branch of this repository is `master`\n\n````\n$ cd Entitas\n$ git branch master origin/master\n$ git flow init -d\n````\n\nOpen `Entitas.sln` and run the Tests project as a console application to ensure everything works as expected. Alternatively run the tests script\n\n```\n$ ./Scripts/bee tests\n```\n\nMake changes\n============\n\n[Create a new ticket][issues-new] to let people know what you're working on and to encourage a discussion. Follow the git-flow conventions and create a new feature branch starting with `#` and the issue number:\n\n```\n$ git flow feature start <#123-your-feature>\n```\n\nWrite and update unit tests and make sure all the existing tests pass. To manually test your changes in a Unity project, run\n\n```\n$ ./Scripts/bee build\n$ ./Scripts/bee sync\n```\n\nThis will build Entitas with all your changes and copy all required assemblies to the Tests/Unity/VisualDebugging project's `Library` folder. You can open the Tests/Unity/VisualDebugging project in Unity and verify and test your changes manually. All changes to Entitas must be done in the `Entitas.sln` project.\n\n\nContribute\n==========\n\nIf you have many commits please consider using [git rebase](https://git-scm.com/docs/git-rebase) to cleanup the commits. This can simplify reviewing the pull request.\nOnce you're happy with your changes open a [pull request][pulls] to your feature branch. The default branch is `develop`. Don't create a [pull request][pulls] from master.\n\nBy submitting a pull request, you represent that you have the right to license your contribution to the community, and agree by submitting the patch that your contributions are licensed under the [Entitas license][license].\n\nThanks for your contributions and happy coding :)\n\nSimon\n\n[repo]: https://github.com/sschmid/Entitas \"sschmid/Entitas\"\n[issues]: https://github.com/sschmid/Entitas/issues \"Issues\"\n[pulls]: https://github.com/sschmid/Entitas/pulls \"Pull Requests\"\n[issues-new]: https://github.com/sschmid/Entitas/issues/new \"New issue\"\n[license]: https://github.com/sschmid/Entitas/blob/develop/LICENSE.txt \"License\"\n"
  },
  {
    "path": "Directory.Build.props",
    "content": "<Project>\n\n  <PropertyGroup>\n    <DefaultNetTargetFramework>net6.0</DefaultNetTargetFramework>\n    <DefaultTargetFramework>netstandard2.1</DefaultTargetFramework>\n    <DefaultTestTargetFramework>net6.0</DefaultTestTargetFramework>\n    <DefaultGeneratorFramework>netstandard2.0</DefaultGeneratorFramework>\n    <Deterministic>true</Deterministic>\n    <LangVersion>default</LangVersion>\n    <SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>\n  </PropertyGroup>\n\n  <ItemGroup Label=\"NuGet\">\n    <None Include=\"../../icon.png\" Pack=\"true\" PackagePath=\"\\\" />\n  </ItemGroup>\n\n  <PropertyGroup Label=\"Docker\">\n    <DefaultItemExcludes>$(DefaultItemExcludes);$(MSBuildProjectDirectory)/obj/**/*</DefaultItemExcludes>\n    <DefaultItemExcludes>$(DefaultItemExcludes);$(MSBuildProjectDirectory)/bin/**/*</DefaultItemExcludes>\n  </PropertyGroup>\n\n  <PropertyGroup Condition=\"'$(DOTNET_RUNNING_IN_CONTAINER)' == 'true'\">\n    <BaseIntermediateOutputPath>$(MSBuildProjectDirectory)/obj/container/</BaseIntermediateOutputPath>\n    <BaseOutputPath>$(MSBuildProjectDirectory)/bin/container/</BaseOutputPath>\n  </PropertyGroup>\n\n  <Import Project=\"Unity3D.props\" />\n  <PropertyGroup Label=\"Unity3D\">\n    <UnityVersion>2021.3.0f1</UnityVersion>\n    <UnityEditor>$(UnityHubPath)/$(UnityVersion)/$(UnityEditorPath)</UnityEditor>\n    <UnityEngine>$(UnityHubPath)/$(UnityVersion)/$(UnityEnginePath)</UnityEngine>\n  </PropertyGroup>\n\n  <PropertyGroup Condition=\"'$(DOTNET_RUNNING_IN_CONTAINER)' == 'true'\">\n    <UnityEditor>$(MSBuildStartupDirectory)/build/Managed/UnityEditor.dll</UnityEditor>\n    <UnityEngine>$(MSBuildStartupDirectory)/build/Managed/UnityEngine.dll</UnityEngine>\n  </PropertyGroup>\n\n</Project>\n"
  },
  {
    "path": "Directory.Build.targets",
    "content": "<Project>\n\n  <PropertyGroup Label=\"NuGet\">\n    <Authors>Simon Schmid</Authors>\n    <PackageLicenseExpression>MIT</PackageLicenseExpression>\n    <PackageIcon>icon.png</PackageIcon>\n    <PackageProjectUrl>https://github.com/sschmid/Entitas</PackageProjectUrl>\n    <Company>Entitas</Company>\n    <Description>$(AssemblyName)</Description>\n    <Copyright>Simon Schmid</Copyright>\n    <PackageTags>Entitas, ECS, Entity, Component, System, DesperateDevs, Desperate, Devs</PackageTags>\n    <RepositoryUrl>https://github.com/sschmid/Entitas</RepositoryUrl>\n    <RepositoryType>git</RepositoryType>\n  </PropertyGroup>\n\n</Project>\n"
  },
  {
    "path": "Entitas.sln",
    "content": "﻿Microsoft Visual Studio Solution File, Format Version 12.00\n#\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Entitas\", \"Entitas\", \"{C6D52863-46B5-4E9E-86DF-B937688BAB4C}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Entitas\", \"src/Entitas/Entitas.csproj\", \"{A0A11CC3-8B1E-4345-A5FA-01FC60E581D8}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Entitas.Benchmarks\", \"benchmarks/Entitas.Benchmarks/Entitas.Benchmarks.csproj\", \"{4DE97264-489D-4EA7-9424-245CFD3292E8}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Entitas.Tests\", \"tests/Entitas.Tests/Entitas.Tests.csproj\", \"{293F3CF5-5251-4963-8AB7-3CC88F53D13A}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Entitas.Generators\", \"Entitas.Generators\", \"{325ACD85-BA09-42FC-964E-DAA9F4D9A81B}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Entitas.Generators\", \"gen/Entitas.Generators/Entitas.Generators.csproj\", \"{85A3226F-6C66-40F9-B132-E89F59F46F67}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Entitas.Generators.Attributes\", \"src/Entitas.Generators.Attributes/Entitas.Generators.Attributes.csproj\", \"{95686F95-12E5-4C3B-AEFC-A164D1521024}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Entitas.Generators.IntegrationTests\", \"tests/Entitas.Generators.IntegrationTests/Entitas.Generators.IntegrationTests.csproj\", \"{2AE8A018-67C9-4CAD-83F8-A96E7EDDA964}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Entitas.Generators.Tests\", \"tests/Entitas.Generators.Tests/Entitas.Generators.Tests.csproj\", \"{93F1F79E-416A-4DAB-9B75-F1FC0FE46458}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Entitas.Generators.Tests.Fixtures.Dependencies\", \"tests/Entitas.Generators.Tests.Fixtures.Dependencies/Entitas.Generators.Tests.Fixtures.Dependencies.csproj\", \"{4ACE9075-27A7-49BB-B9C4-48B1D2BBF629}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Entitas.Unity\", \"Entitas.Unity\", \"{552D0572-A491-49A5-8975-F53131E12E6B}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Entitas.Unity\", \"src/Entitas.Unity/Entitas.Unity.csproj\", \"{CB3ADCB3-E842-4A71-B32E-15ABDE7311F6}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Entitas.Unity.Editor\", \"src/Entitas.Unity.Editor/Entitas.Unity.Editor.csproj\", \"{9AF72B25-85B0-4FDC-85C3-660926C82438}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Entitas.Unity.Tests\", \"tests/Entitas.Unity.Tests/Entitas.Unity.Tests.csproj\", \"{CEFDF4DE-6410-4ED0-B711-D43E198BA6C4}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{A0A11CC3-8B1E-4345-A5FA-01FC60E581D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A0A11CC3-8B1E-4345-A5FA-01FC60E581D8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A0A11CC3-8B1E-4345-A5FA-01FC60E581D8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A0A11CC3-8B1E-4345-A5FA-01FC60E581D8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4DE97264-489D-4EA7-9424-245CFD3292E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4DE97264-489D-4EA7-9424-245CFD3292E8}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4DE97264-489D-4EA7-9424-245CFD3292E8}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4DE97264-489D-4EA7-9424-245CFD3292E8}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{293F3CF5-5251-4963-8AB7-3CC88F53D13A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{293F3CF5-5251-4963-8AB7-3CC88F53D13A}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{293F3CF5-5251-4963-8AB7-3CC88F53D13A}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{293F3CF5-5251-4963-8AB7-3CC88F53D13A}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{85A3226F-6C66-40F9-B132-E89F59F46F67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{85A3226F-6C66-40F9-B132-E89F59F46F67}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{85A3226F-6C66-40F9-B132-E89F59F46F67}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{85A3226F-6C66-40F9-B132-E89F59F46F67}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{95686F95-12E5-4C3B-AEFC-A164D1521024}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{95686F95-12E5-4C3B-AEFC-A164D1521024}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{95686F95-12E5-4C3B-AEFC-A164D1521024}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{95686F95-12E5-4C3B-AEFC-A164D1521024}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{2AE8A018-67C9-4CAD-83F8-A96E7EDDA964}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{2AE8A018-67C9-4CAD-83F8-A96E7EDDA964}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{2AE8A018-67C9-4CAD-83F8-A96E7EDDA964}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{2AE8A018-67C9-4CAD-83F8-A96E7EDDA964}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{93F1F79E-416A-4DAB-9B75-F1FC0FE46458}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{93F1F79E-416A-4DAB-9B75-F1FC0FE46458}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{93F1F79E-416A-4DAB-9B75-F1FC0FE46458}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{93F1F79E-416A-4DAB-9B75-F1FC0FE46458}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{4ACE9075-27A7-49BB-B9C4-48B1D2BBF629}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{4ACE9075-27A7-49BB-B9C4-48B1D2BBF629}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{4ACE9075-27A7-49BB-B9C4-48B1D2BBF629}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{4ACE9075-27A7-49BB-B9C4-48B1D2BBF629}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{CB3ADCB3-E842-4A71-B32E-15ABDE7311F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{CB3ADCB3-E842-4A71-B32E-15ABDE7311F6}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{CB3ADCB3-E842-4A71-B32E-15ABDE7311F6}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{CB3ADCB3-E842-4A71-B32E-15ABDE7311F6}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{9AF72B25-85B0-4FDC-85C3-660926C82438}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{9AF72B25-85B0-4FDC-85C3-660926C82438}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{9AF72B25-85B0-4FDC-85C3-660926C82438}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{9AF72B25-85B0-4FDC-85C3-660926C82438}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{CEFDF4DE-6410-4ED0-B711-D43E198BA6C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{CEFDF4DE-6410-4ED0-B711-D43E198BA6C4}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{CEFDF4DE-6410-4ED0-B711-D43E198BA6C4}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{CEFDF4DE-6410-4ED0-B711-D43E198BA6C4}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{A0A11CC3-8B1E-4345-A5FA-01FC60E581D8} = {C6D52863-46B5-4E9E-86DF-B937688BAB4C}\n\t\t{4DE97264-489D-4EA7-9424-245CFD3292E8} = {C6D52863-46B5-4E9E-86DF-B937688BAB4C}\n\t\t{293F3CF5-5251-4963-8AB7-3CC88F53D13A} = {C6D52863-46B5-4E9E-86DF-B937688BAB4C}\n\t\t{85A3226F-6C66-40F9-B132-E89F59F46F67} = {325ACD85-BA09-42FC-964E-DAA9F4D9A81B}\n\t\t{95686F95-12E5-4C3B-AEFC-A164D1521024} = {325ACD85-BA09-42FC-964E-DAA9F4D9A81B}\n\t\t{2AE8A018-67C9-4CAD-83F8-A96E7EDDA964} = {325ACD85-BA09-42FC-964E-DAA9F4D9A81B}\n\t\t{93F1F79E-416A-4DAB-9B75-F1FC0FE46458} = {325ACD85-BA09-42FC-964E-DAA9F4D9A81B}\n\t\t{4ACE9075-27A7-49BB-B9C4-48B1D2BBF629} = {325ACD85-BA09-42FC-964E-DAA9F4D9A81B}\n\t\t{CB3ADCB3-E842-4A71-B32E-15ABDE7311F6} = {552D0572-A491-49A5-8975-F53131E12E6B}\n\t\t{9AF72B25-85B0-4FDC-85C3-660926C82438} = {552D0572-A491-49A5-8975-F53131E12E6B}\n\t\t{CEFDF4DE-6410-4ED0-B711-D43E198BA6C4} = {552D0572-A491-49A5-8975-F53131E12E6B}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "Entitas.sln.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:String x:Key=\"/Default/Environment/InjectedLayers/FileInjectedLayer/=2DD9FDAC2C7BC744A5303D2D02567D0D/RelativePath/@EntryValue\">..\\.sln.dotsettings\\CodeStyle.DotSettings</s:String>\n\t<s:Boolean x:Key=\"/Default/Environment/InjectedLayers/FileInjectedLayer/=2DD9FDAC2C7BC744A5303D2D02567D0D/@KeyIndexDefined\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File2DD9FDAC2C7BC744A5303D2D02567D0D/@KeyIndexDefined\">True</s:Boolean>\n\t<s:Double x:Key=\"/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File2DD9FDAC2C7BC744A5303D2D02567D0D/RelativePriority/@EntryValue\">1</s:Double>\n\t<s:String x:Key=\"/Default/Environment/InjectedLayers/FileInjectedLayer/=18F6DFA7A32AC84081CE80F4F2EED0FF/RelativePath/@EntryValue\">..\\.sln.dotsettings\\InspectionSettings.DotSettings</s:String>\n\t<s:Boolean x:Key=\"/Default/Environment/InjectedLayers/FileInjectedLayer/=18F6DFA7A32AC84081CE80F4F2EED0FF/@KeyIndexDefined\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File18F6DFA7A32AC84081CE80F4F2EED0FF/@KeyIndexDefined\">True</s:Boolean>\n\t<s:Double x:Key=\"/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File18F6DFA7A32AC84081CE80F4F2EED0FF/RelativePriority/@EntryValue\">1.5</s:Double>\n\t<s:String x:Key=\"/Default/Environment/InjectedLayers/FileInjectedLayer/=677D4764D5BC5A438D6234119C8CE46B/RelativePath/@EntryValue\">..\\.sln.dotsettings\\PatternsAndTemplates.DotSettings</s:String>\n\t<s:Boolean x:Key=\"/Default/Environment/InjectedLayers/FileInjectedLayer/=677D4764D5BC5A438D6234119C8CE46B/@KeyIndexDefined\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File677D4764D5BC5A438D6234119C8CE46B/@KeyIndexDefined\">True</s:Boolean>\n\t<s:Double x:Key=\"/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File677D4764D5BC5A438D6234119C8CE46B/RelativePriority/@EntryValue\">2</s:Double></wpf:ResourceDictionary>\n"
  },
  {
    "path": "EntitasUpgradeGuide.md",
    "content": "Entitas Upgrade Guide\n=====================\n\nEntitas provides automated migration tools to help upgrading to new versions.\nYou can apply automatic migrations in Unity by opening the Entitas Migration Window\n`Tools > Entitas > Migrate...`\n\nThis document contains checklists for every release with breaking changes.\n\nEntitas 0.47.2 upgrade guide\n============================\n\n#### Breaking changes\n\nApply Migration 0.47.2 to automatically rename the changed keys your properties files.\n\nThe following keys changed from:\n\n- CodeGenerator.SearchPaths\n- CodeGenerator.Plugins\n- CodeGenerator.PreProcessors\n- CodeGenerator.DataProviders\n- CodeGenerator.CodeGenerators\n- CodeGenerator.PostProcessors\n- CodeGenerator.CLI.Ignore.UnusedKeys or Ignore.Keys\n\nto:\n\n- Jenny.SearchPaths\n- Jenny.Plugins\n- Jenny.PreProcessors\n- Jenny.DataProviders\n- Jenny.CodeGenerators\n- Jenny.PostProcessors\n- Jenny.Ignore.Keys\n\n---\n\nEntitas 0.46.0 upgrade guide\n============================\n\n#### Breaking changes\n\nRemoved methods marked obsolete in 0.42.0 from April 2017\n- `context.CreateCollector<TEntity>(IMatcher<TEntity> matcher, GroupEvent groupEvent)`\n- `new Context(int totalComponents, int startCreationIndex, ContextInfo contextInfo)`\n- `context.DestroyEntity(TEnity entity)`\n\n#### After you installed\n\nFirst, edit the file `Generated/Feature.cs` and comment or delete the lines with compiler errors.\n\nThen, run auto-import to use the new DesperateDevs.CodeGeneration.Plugins and generate.\n\nEntitas.properties can be named differently now. By default it will be called\nPreferences.properties. Additionally, you can delete User.properties or rename it\nto Xyz.userproperties. If this file doesn't exist, it will automatically be generated for you.\nYou can have multiple properties and userproperties files now, e.g.\nPreferences.properties and Roslyn.properties. In Unity it will automatically find and use\nthe first file. When using the Code Generator CLI (called Jenny now) you can explicitly\nspecify files like this\n\n```\n// will find and use the first file\n$ jenny gen\n\n// specify a file\n$ jenny gen Roslyn.properties\n\n// optionally specify an other userproperties\njenny gen Roslyn.properties My.userproperties\n```\n\n---\n\nEntitas 0.45.0 upgrade guide\n============================\n\n#### Breaking changes\n\nUse the command line tool `MigrationAssistant.exe` and apply Migration 0.45.0 to\nautomatically rename the changed keys in Entitas.properties\n\n`MigrationAssistant.exe 0.45.0 path/to/project`\n\nThe following keys in Entitas.properties changed from:\n\n- Entitas.CodeGeneration.CodeGenerator.SearchPaths\n- Entitas.CodeGeneration.CodeGenerator.Plugins\n- Entitas.CodeGeneration.CodeGenerator.DataProviders\n- Entitas.CodeGeneration.CodeGenerator.CodeGenerators\n- Entitas.CodeGeneration.CodeGenerator.PostProcessors\n- Entitas.CodeGeneration.CodeGenerator.CLI.Ignore.UnusedKeys\n\nto:\n\n- CodeGenerator.SearchPaths\n- CodeGenerator.Plugins\n- CodeGenerator.DataProviders\n- CodeGenerator.CodeGenerators\n- CodeGenerator.PostProcessors\n- CodeGenerator.CLI.Ignore.UnusedKeys\n\nThe default plugins are now in folder called `Entitas` instead of `Default`. Please update\nthe searchPaths in Entitas.properties.\n`Entitas.exe` is now uppercase with capital E\n\n---\n\nEntitas 0.42.0 upgrade guide\n============================\n\n#### Breaking changes\n- Removed Entitas.Blueprints.Unity.*\n- Changed ReactiveSystem.GetTrigger method signature\n- Marked obsolete: `context.DestroyEntity(entity)`. Use `entity.Destroy()` instead\n- Marked obsolete: `context.CreateCollector(matcher, event)`, use new `context.CreateCollector(triggerOnEvent)` when you need `.Removed` or `.AddedOrRemoved` (e.g. `GameMatcher.View.Removed()`)\n\n#### After you installed\n- Removed Entitas.Blueprints.Unity.*\n  - Remove all Entitas.Blueprints.Unity.* related code\n  - Remove BinaryBlueprints from your project. Consider using extension methods as described here instead https://github.com/sschmid/Entitas/issues/390\n  - Remove from Entitas.properties:\n    - Entitas.Blueprints.CodeGeneration.Plugins\n    - Entitas.Blueprints.CodeGeneration.Plugins.BlueprintDataProvider\n    - Entitas.Blueprints.CodeGeneration.Plugins.BlueprintsGenerator\n\n- Changed ReactiveSystem.GetTrigger() method signature\n  - find and replace `protected override Collector` -> `protected override ICollector`\n\n- Generate\n\n- Marked obsolete: `context.DestroyEntity(entity)`. Use `entity.Destroy()` instead\n- Marked obsolete: `context.CreateCollector(matcher, event)`, use new `context.CreateCollector(triggerOnEvent)` when you need `.Removed` or `.AddedOrRemoved` (e.g. `GameMatcher.View.Removed()`)\n\n---\n\nEntitas 0.41.0 upgrade guide\n============================\n\n#### Breaking changes\nIn order to deploy Entitas as Dlls which enables 3rd party Addons and the extendable command line code generator the projects have been restructured. This restructuring has an impact on namespaces.\n\n#### Before you install\n- You're fine - nothing to do for you :heart:\n\n#### After you installed\n- Apply Migrations 0.41.0-1\n- Apply Migrations 0.41.0-2\n- Apply Migrations 0.41.0-3\n\nThese migrations should update most of the namespaces. Depending on which features of Entitas you have used there might be a chance that not all namespaces have been updated. In this case please fix the remaining namespaces manually.\n\nEntitas.properties keys have been updated to support the latest code generator. Please open Entitas.properties in your project root and make sure the keys are updated. Here's an example from Match One\n\n```\nEntitas.CodeGeneration.Project = Assembly-CSharp.csproj\nEntitas.CodeGeneration.SearchPaths = Assets/Libraries/Entitas, Assets/Libraries/Entitas/Editor, /Applications/Unity/Unity.app/Contents/Managed\nEntitas.CodeGeneration.Assemblies = Library/ScriptAssemblies/Assembly-CSharp.dll\nEntitas.CodeGeneration.Plugins = Entitas.CodeGeneration.Plugins, Entitas.CodeGeneration.Unity.Editor, Entitas.VisualDebugging.CodeGeneration.Plugins, Entitas.Blueprints.CodeGeneration.Plugins\nEntitas.CodeGeneration.DataProviders = Entitas.Blueprints.CodeGeneration.Plugins.BlueprintDataProvider, Entitas.CodeGeneration.Plugins.ComponentDataProvider, Entitas.CodeGeneration.Plugins.ContextDataProvider, Entitas.CodeGeneration.Plugins.EntityIndexDataProvider\nEntitas.CodeGeneration.CodeGenerators = Entitas.Blueprints.CodeGeneration.Plugins.BlueprintsGenerator, Entitas.CodeGeneration.Plugins.ComponentContextGenerator, Entitas.CodeGeneration.Plugins.ComponentEntityGenerator, Entitas.CodeGeneration.Plugins.ComponentGenerator, Entitas.CodeGeneration.Plugins.ComponentsLookupGenerator, Entitas.CodeGeneration.Plugins.ContextAttributeGenerator, Entitas.CodeGeneration.Plugins.ContextGenerator, Entitas.CodeGeneration.Plugins.ContextsGenerator, Entitas.CodeGeneration.Plugins.EntityGenerator, Entitas.CodeGeneration.Plugins.EntityIndexGenerator, Entitas.CodeGeneration.Plugins.MatcherGenerator, Entitas.VisualDebugging.CodeGeneration.Plugins.ContextObserverGenerator, Entitas.VisualDebugging.CodeGeneration.Plugins.FeatureClassGenerator\nEntitas.CodeGeneration.PostProcessors = Entitas.CodeGeneration.Plugins.AddFileHeaderPostProcessor, Entitas.CodeGeneration.Plugins.CleanTargetDirectoryPostProcessor, Entitas.CodeGeneration.Plugins.MergeFilesPostProcessor, Entitas.CodeGeneration.Plugins.NewLinePostProcessor, Entitas.CodeGeneration.Plugins.WriteToDiskPostProcessor, Entitas.CodeGeneration.Plugins.ConsoleWriteLinePostProcessor, Entitas.CodeGeneration.Unity.Editor.DebugLogPostProcessor\nEntitas.CodeGeneration.TargetDirectory = Assets/Sources/\nEntitas.CodeGeneration.Contexts = Game, GameState, Input\nEntitas.VisualDebugging.Unity.SystemWarningThreshold = 8\nEntitas.VisualDebugging.Unity.DefaultInstanceCreatorFolderPath = Assets/Editor/DefaultInstanceCreator/\nEntitas.VisualDebugging.Unity.TypeDrawerFolderPath = Assets/Editor/TypeDrawer/\n```\n\nExplanation:\n- Entitas.CodeGeneration.Project: Relative path to your project.csproj (when using Unity use `Assembly-CSharp.csproj`)\n- Entitas.CodeGeneration.SearchPaths: The new code generator can be extended with 3rd party plugins. Specify all folders where plugin dlls can be found. Plugins may depend on UnityEngine or UnityEditor, if so please specify where those dlls can be found (Unity default on Mac: `/Applications/Unity/Unity.app/Contents/Managed`\n- Entitas.CodeGeneration.Assemblies: One or more Dlls that contain your components\n- Entitas.CodeGeneration.Plugins: One or more Code Generator Plugin Dlls or namespaces\n\nIf all set up correctly DataProviders, CodeGenerators and PostProcessors can be set in Unity.\n\nThe command line code generator currently doesn't support the following plugins:\n- Entitas.Blueprints.CodeGeneration.Plugins (contains Blueprint DataProvider and CodeGenerator)\n- Entitas.CodeGeneration.Unity.Editor (contains DebugLogPostProcessor)\n\nbecause they use Unity specific api. They will work as expected when generating from within Unity but don't work on the command line.\n\nTo test the config for potential problems, please unzip Entitas-CodeGenerator.zip in the root folder of your project.\n\n---\n\n### Note for Windows users\n- Right-click Entitas-CodeGenerator.zip, open properties\n- Check \"Unblock\"\n- Hit Apply\n- unzip\n\n---\n\n```\n// skip mono on Windows\n$ mono ./CodeGenerator/entitas.exe\nEntitas Code Generator version 0.41.0\nusage: entitas new [-f] - Creates new Entitas.properties config with default values\n       entitas edit     - Opens Entitas.properties config\n       entitas doctor   - Checks the config for potential problems\n       entitas status   - Lists available and unavailable plugins\n       entitas fix      - Adds missing or removes unused keys interactively\n       entitas scan     - Scans and prints available types found in specified assemblies\n       entitas dry      - Simulates generating files without writing to disk\n       entitas gen      - Generates files based on Entitas.properties\n       [-v]             - verbose output\n       [-s]             - silent output (errors only)\n```\n\nTo check the config for potential problems please run\n```\n$ mono ./CodeGenerator/entitas.exe doctor\n```\n\nThe `doctor` command will show you the status and potential problems. Sometime you might get a warning like this:\n\n```\n- Could not resolve xyz.dll\n```\n\nThis is just a warning. If no error is shown after running the `doctor` command, you can ignore those. All code generator plugins must be resolvable in order to be used. Use the `status` command to see available and unavailable plugins. This command helps you manage the plugins. Add or remove DataProviders, CodeGenerators or PostProcessors and check with `status` until you're happy. As usual, you can also use the Entitas Preferences Window in Unity to set up everything.\n\nIf there are nor problems use the `gen` command to generate or use the green generate button in Unity as usual.\n\n---\n\nEntitas 0.37.0 upgrade guide\n============================\n\n#### Breaking changes\nEntitas went type-safe! This was a huge task and I'm happy to finally share this with you guys!\nThis feature makes Entitas safer and more managable in growing code bases and will eliminate certain kind of bugs.\nThis change breaks existing projects! It is possible to manually migrate existing projects but there is no special workflow\nother than manually use find / replace to fix all compile errors. I use Entitas 0.37.0 in my current project (500+ systems)\nand was able to migrate within less than two days. If you have less systems and components you should be able to migrate within one day.\n\nReminder: If you're updating from versions < 0.36.0 you should update to 0.36.0 first. Be aware that existing Blueprints(Beta) are breaking\nbecause of the renaming from `Pool` to `Context`. Existing Binary Blueprints have to be manually updated.\n\nIf you're not sure if you should update you can wait another week. I plan to make a video to show how to upgrade existing projects.\nAfter this you should be able to decide if you want to update or not.\n\n#### Before you install\n- Rename `SingleEntityAttribute` to `UniqueAttribute`\n- Change namespace of all attributes in CodeGenerator/Attributes to `Entitas.CodeGenerator.Api`\n- Find / replace `using Entitas.CodeGenerator` to `using Entitas.CodeGenerator.Api` in all generated context attributes\n- Find / replace `using Entitas.CodeGenerator;` to `using Entitas.CodeGenerator.Api;` in all generated components\n\n#### After you installed\n\nAfter installing Entitas 0.37.0 you most likely end up having lots of compiler errors. The 2 biggest issues are:\n- Generated components\n- Systems\n\nThere migh also be other issues depending how you used Entitas before, but fixing the generated components and the systems\nmight already do most of the work.\n\n##### Problem 1 (Components):\nThe old generated components extend Entitas.Entity by using `partial class`.\nThe new version inherits Entitas.Entity to have a new entity type and to get rid of `partial class` to enable\nhaving Entitas as a precompiled dll.\n\n##### Solution 1 (Components)\nThe goal is to update the generated components. I see 3 possible workflows to fix them:\n1. Delete all components and generated components and use the EntitasLang DSL https://github.com/mzaks/ECS-Lang\n2. Temporarily move all the logic (systems) out of your Unity project and delete the generated components.\nAfter this there shouldn't be any compile errors anymore (if so, temporarily move them out if your Unity project).\nNow you should be able to re-generate. After that, move all the files back to your Unity project.\n3. Manually use find / replace in the generated components folder to migrate the components\n\n##### Problem 2 (Systems)\nAll reactive systems need to be updated to be type-safe.\n\n##### Solution 2 (Systems)\nManually use find / replace to migrate e.g. method signatures and other issues\nTake a look at [Match-One AnimatePositionSystem.cs](https://github.com/sschmid/Match-One/blob/develop/Assets/Sources/Logic/View/Systems/AnimatePositionSystem.cs)\nto see how the new reactive systems look like.\n\n##### Other issues\nThere might be other issues related to the type-safety. Rule of thumb:\n- Every occurrences of `Entity` must be typed now, e.g. `GameEntity`\n- Every occurrences of `Group` must be typed now, e.g. `IGroup<GameEntity>`\n- Every occurrences of `Context` must be typed now, e.g. `IContext<GameEntity>` or `GameContext` if possible\n- Every occurrences of `Collector` must be typed now, e.g. `Collector<GameEntity>`\n- Every occurrences of `Matcher` must be typed now, e.g. `Matcher<GameEntity>.AllOf(...)`\n\nI recommend using find / replace on ceratin folders to fix those issues efficiently.\n\n---\n\nEntitas 0.36.0 upgrade guide\n============================\n\n#### Breaking changes\nThe term `Pool` has been replaced with `Context`. This affects all classes that\ncontain the word pool.\n`EntityCollector` has been renamed to `Collector`\n`GroupEventType` has been renamed to `GroupEvent`\n\n\n#### Before you install\n- Rename `Pools.CreatePool()` to `Pools.CreateContext`\n- Rename `Pool` to `Context`\n- Rename `Pools` to `Contexts`\n- Rename `Pools.SetAllPools()` to `Pools.SetAllContexts()`\n- Rename `PoolAttribute` to `ContextAttribute`\n- Rename `EntityCollector` to `Collector`\n- Rename `GroupEventType` to `GroupEvent`\n- Rename `GroupEventType.OnEntityAdded` to `GroupEvent.Added`\n- Rename `GroupEventType.OnEntityRemoved` to `GroupEvent.Removed`\n- Rename `GroupEventType.OnEntityAddedOrRemoved` to `GroupEvent.AddedOrRemoved`\n\n#### After you installed\n- Use the command line tool `MigrationAssistant.exe` and apply Migration 0.36.0-2\n- Manually migrate all systems and fix compiler errors\n- apply Migration 0.36.0-1\n- Ensure all code generator are selected and generate\n\n---\n\nEntitas 0.35.0 upgrade guide\n============================\n\n#### Breaking changes\n`IMatcher.Where()` has been removed. See #194\n\n#### Before you install\n- You're fine - nothing to do for you :heart:\n\n#### After you installed\n- Fix all the errors where you used `matcher.Where()`\n\n---\n\nEntitas 0.34.0 upgrade guide\n============================\n\n#### Breaking changes\n`GroupObserver` has been renamed to `EntityCollector`. See #168\n\n#### Before you install\n- Rename `GroupObserver` to `EntityCollector`\n- Rename `.CreateGroupObserver()` to `.CreateEntityCollector()`\n- Rename `IGroupObserverSystem` to `IEntityCollectorSystem`\n- Find & Replace `public EntityCollector groupObserver` with `public EntityCollector entityCollector`\n\n#### After you installed\n- You're fine - nothing to do for you :heart:\n\n---\n\nEntitas 0.33.0 upgrade guide\n============================\n\n#### Breaking changes\n`IDeinitializeSystem` has been renamed to `ITearDownSystem`. See #164\n\n#### Before you install\n- Manually rename `IDeinitializeSystem` to `ITearDownSystem`\n\n#### After you installed\n- You're fine - nothing to do for you :heart:\n\n---\n\nEntitas 0.32.0 upgrade guide\n============================\n\nUse the command line tool `MigrationAssistant.exe` to automatically fix compile errors.\nEntitas 0.32.0 introduces a new Pools class. Using the new PoolsGenerator will require\nto update your existing project manually. You can still use the old Pools class in your\nexisting project if you want. If so, please use the OldPoolsGenerator instead of the new one.\n\n---\n\nEntitas 0.30.0 upgrade guide\n============================\n\nSome code generators got renamed. Apply Migration 0.30.0\n\n---\n\nEntitas 0.29.0 upgrade guide\n============================\n\nMarked old PoolMetaData constructor obsolete. If you encounter compile errors\nplease apply Migration 0.26.0, open C# project and generate again.\n\n---\n\nEntitas 0.28.0 upgrade guide\n============================\n\nIf you're using Entitas with Unity, please open the Entitas preferences and make\nsure that all your desired code generators are activated.\nDue to some code generator renamings the ComponentIndicesGenerators inactive.\n\nThe SystemsGenerator has been removed. Please use `pool.CreateSystem<MySystem>()` instead.\n\n---\n\nEntitas 0.27.0 upgrade guide\n============================\n\nIf you're using Entitas with Unity, please open the Entitas preferences and make\nsure that all your desired code generators are activated.\nDue to some code generator renamings the ComponentLookupGenerator and\nthe ComponentsGenerator are inactive. Activate them (if desired) and generate.\n\n---\n\nEntitas 0.26.0 upgrade guide\n============================\n\nUse the command line tool `MigrationAssistant.exe` to automatically fix compile errors.\nAfter that generate again.\n\n---\n\nEntitas 0.24.0 upgrade guide\n============================\n\nTo fix the compile errors after updating to Entitas 0.24.0, delete in `Pools.cs`\n\n```csharp\n#if (UNITY_EDITOR)\nvar poolObserver = new Entitas.Unity.VisualDebugging.PoolObserver(_pool, ComponentIds.componentNames, ComponentIds.componentTypes, \"Pool\");\nUnityEngine.Object.DontDestroyOnLoad(poolObserver.entitiesContainer);\n#endif\n```\n\nand generate again.\n\n---\n\nEntitas 0.23.0 upgrade guide\n============================\n\nEntitas 0.23.0 changed and applied naming conventions.\nBefore updating to this version, follow these steps to prepare your project:\n\n#### Rename\n\n    Pool.Count       -> Pool.count\n    Group.Count      -> Group.count\n    Properties.count -> Properties.count\n\n#### Find/Replace in generated folder\n\n    \": AllOfMatcher \"              -> \"\"\n    \": base(new [] { index }) \"    -> \"\"\n    \"static AllOfMatcher _matcher\" -> \"static IMatcher _matcher\"\n    \"public static AllOfMatcher\"   -> \"public static IMatcher\"\n    \"new Matcher\"                  -> \"Matcher.AllOf\"\n\n#### Delete\n\nIn generated ...ComponentIds\n\n    namespace Entitas {\n        public partial class XYZMatcher {\n            public Matcher(int index) {\n            }\n\n            public override string ToString() {\n                return ComponentIds.IdToString(indices[0]);\n            }\n        }\n    }\n\n---\n\nEntitas 0.22.0 upgrade guide\n============================\n\nEntitas 0.22.0 changed IReactiveSystem and IMultiReactiveSystem and renamed IStartSystem.Start to IInitializeSystem.Initialize.\n\nUse the command line tool `MigrationAssistant.exe` to automatically migrate IReactiveSystem.\n\n---\n\nEntitas 0.19.0 upgrade guide\n============================\n\nEntitas 0.19.0 introduces a few breaking changes:\n\nAdded new e.OnComponentReplaced and removed all *WillBeRemoved events.\n\nIf you used `group.OnEntityWillBeRemoved`, you could replace it either with\n```cs\n_group.OnEntityRemoved += (group, entity, index, component) => { //... };\n```\nor with\n```cs\n_group.OnEntityUpdated += (group, entity, index, previousComponent, newComponent) => { // ...};\n```\nIf your generated component extensions are not compiling, find/replace `WillRemoveComponent` with `//WillRemoveComponent`\nto temporarily ignore the errors.\n\nIReactiveSystem.Execute takes List<Entity> instead of Entity[]. Use the command line tool `MigrationAssistant.exe` to automatically migrate.\n\n```\n$ mono MigrationAssistant.exe\nusage:\n[-l]             - print all available versions\n[version] [path] - apply migration of version [version] to source files located at [path]\n\n$ mono MigrationAssistant.exe -l\n0.18.0 - Migrates IReactiveSystem API\n0.19.0 - Migrates IReactiveSystem.Execute\n\n// Example from Math-One example project, where all the systems are located in the Features folder\n$ mono MigrationAssistant.exe 0.19.0 /Path/To/Project/Assets/Sources/Features\n```\n\n---\n\nEntitas 0.18.0 upgrade guide\n============================\n\nEntitas 0.18.0 changes IReactiveSystem. To upgrade your source files, follow these steps\n- Install Entitas 0.18.0 (which will result in compiler errors)\n- Use the command line tool `MigrationAssistant.exe` to automatically migrate\n\n```\n$ mono MigrationAssistant.exe\nusage:\n[-l]             - print all available versions\n[version] [path] - apply migration of version [version] to source files located at [path]\n\n$ mono MigrationAssistant.exe -l\n0.18.0 - Migrates IReactiveSystem API\n\n// Example from Math-One example project, where all the systems are located in the Features folder\n$ mono MigrationAssistant.exe 0.18.0 /Path/To/Project/Assets/Sources/Features\n```\n\n---\n\nEntitas 0.12.0 upgrade guide\n============================\n\nEntitas 0.12.0 generates prefixed matchers based on the PoolAttribute and introduces some\nAPI changes. In your existing project with a Entitas version < 0.12.0 manually rename the\nfollowing classes and methods.\n\n## Before installing Entitas 0.12.0\n\n#### Rename\n\n    pool.CreateSystem()                                 -> pool.CreateExecuteSystem()\n\nNow that you're prepared for integrating the latest version, delete your existing version\nof Entitas, EntitasCodeGenerator and EntitasUnity.\n\n#### Delete\n\n    Entitas\n    EntitasCodeGenerator\n    EntitasUnity\n\n## Install Entitas 0.12.0\n\n#### Setup Entitas Preferences\n\n    Open the Unity preference panel and select Entitas. Check and update the path to the folder where\n    the code generator will save all generated files. If you are using the PoolAttribute in your components,\n    add all custom pool names used in your application. Make sure that all existing custom PoolAttributes call\n    the base constructor with the same name as the class (without 'Attribute').\n    If you are not using the PoolAttribute in your components, you can skip this process.\n\n```cs\nusing Entitas.CodeGenerator;\n\npublic class CoreGameAttribute : PoolAttribute {\n    public CoreGameAttribute() : base(\"CoreGame\") {\n    }\n}\n```\n\n#### Code Generator\n\n    Use the code generator and generate\n\n#### Update API\n\n    Click the MenuItem \"Entitas/Update API\". All occurrences of the old Matcher will be updated\n    to the new version, which is prefixed based on the PoolAttribute.\n\n#### Delete\n\n    Delete all custom PoolAttributes\n\n---\n\nEntitas 0.10.0 upgrade guide\n============================\n\nBeside features, Entitas 0.10.0 includes lots of renaming. If your current Entitas\nversion is < 0.10.0, you might want to follow the next few simple renaming steps,\nto speed up the integration of the latest version of Entitas.\nIn your existing project with a Entitas version < 0.10.0 manually rename the following\nclasses and methods.\n\n## Before installing Entitas 0.10.0\n\n#### Rename\n\n    EntityRepository                                    -> Pool\n    EntityRepository.GetCollection()                    -> Pool.GetGroup()\n\n    EntityCollection                                    -> Group\n    EntityCollection.EntityCollectionChange             -> Group.GroupChanged\n\n    EntityRepositoryObserver                            -> GroupObserver\n    EntityRepositoryObserver.EntityCollectionEventType  -> GroupObserver.GroupEventType\n\n    IEntityMatcher                                      -> IMatcher\n    IEntitySystem                                       -> IExecuteSystem\n    AllOfEntityMatcher                                  -> AllOfMatcher\n    EntityRepositoryAttribute                           -> PoolAttribute\n    IReactiveSubEntitySystem                            -> IReactiveSystem\n    ReactiveEntitySystem                                -> ReactiveSystem\n\n#### Delete\n\n    EntityWillBeRemovedEntityRepositoryObserver         -> DELETE\n    IReactiveSubEntityWillBeRemovedSystem               -> DELETE\n    ReactiveEntityWillBeRemovedSystem                   -> DELETE\n\nNow that you're prepared for integrating the latest version, delete your existing version\nof Entitas, EntitasCodeGenerator and ToolKit.\n\n#### Delete\n\n    Entitas\n    EntitasCodeGenerator\n    ToolKit (unless you use classes from ToolKit. The new version of Entitas doesn't depend on ToolKit anymore)\n\n\n## Install Entitas 0.10.0\n\n#### Fix remaining issues\n\n    IReactiveSubEntityWillBeRemovedSystem\n        - Consider implementing ISystem & ISetPool and use group.OnEntityWillBeRemoved += foobar;\n\n#### Code Generator\n\n    Use the code generator and generate\n"
  },
  {
    "path": "LICENSE.md",
    "content": "The MIT License\n\nCopyright (c) 2014 - 2023 Simon Schmid\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "<p align=\"center\">\n    <img src=\"images/Entitas-Header.png\" alt=\"Entitas\">\n</p>\n<p align=\"center\">\n    <a href=\"https://discord.gg/uHrVx5Z\"><img src=\"https://img.shields.io/discord/599321316377624601.svg?logo=discord&logoColor=FFFFFF&label=Discord&labelColor=6A7EC2&color=7389D8\" alt=\"Entitas on Discord\"></a>\n    <a href=\"https://github.com/sschmid/Entitas/releases\"><img src=\"https://img.shields.io/github/release/sschmid/Entitas.svg\" alt=\"Latest release\"></a>\n    <a href=\"https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fgithub.com%2Fsschmid%2FEntitas&screen_name=entitas_csharp&tw_p=followbutton\"><img src=\"https://img.shields.io/twitter/follow/entitas_csharp\" alt=\"Twitter Follow Me\"></a>\n    <a href=\"https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fgithub.com%2Fsschmid%2FEntitas&screen_name=s_schmid&tw_p=followbutton\"><img src=\"https://img.shields.io/twitter/follow/s_schmid\" alt=\"Twitter Follow Me\"></a>\n</p>\n<p align=\"center\">\n    <b>Entitas is free, but powered by</b>\n    <a href=\"https://www.paypal.com/donate/?hosted_button_id=BTMLSDQULZ852\"><b>your donations</b></a>\n</p>\n<p align=\"center\">\n    <a href=\"https://www.paypal.com/donate/?hosted_button_id=BTMLSDQULZ852\"><img src=\"https://img.shields.io/static/v1.svg?logo=paypal&label=PayPal&labelColor=3F70B6&&message=Donate&color=gray\" alt=\"Donate\"></a>\n</p>\n\n# Entitas - The Entity Component System Framework for C# and Unity\n\nEntitas is the most popular open-source Entity Component System Framework (ECS)\nand is specifically made for C# and Unity. Several design decisions have been\nmade to work optimal in a garbage collected environment and to go easy on the\ngarbage collector. Entitas comes with an optional code generator which radically\nreduces the amount of code you have to write and\n[makes your code read like well written prose.](https://cleancoders.com)\n\n# Why Entitas\n\n- [#1 open-source ECS on GitHub](https://github.com/sschmid/Entitas)\n- 100% open-source under the [MIT License](LICENSE.md)\n- great and helpful community on [Discord](https://discord.gg/uHrVx5Z)\n- easy to learn and easy to use\n- works great in pure C# standalone projects without Unity\n- comes with great Unity integration called Visual Debugging\n- battle-tested at companies like [Popcore](https://popcore.com) (Rollic / Zynga / Take Two), [Gram Games](https://gram.gs), [Wooga](https://www.wooga.com), [Plarium](https://plarium.com), [Storm Chaser](https://www.stormchaser-games.com) and many more\n\n# Video Tutorials and Unity Unite Talks\n\n| Video                                                                                                                                                                                   | Title                                                     | Resources                                                                           |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|-------------------------------------------------------------------------------------|\n| <a href=\"https://www.youtube.com/watch?v=DZpvUnj2dGI\"><img src=\"https://img.youtube.com/vi/DZpvUnj2dGI/0.jpg\" width=\"200\" alt=\"Video: Entitas - Shmup - Part 2\"></a>                    | Entitas ECS Unity Tutorial - Git & Unit Tests             |                                                                                     |\n| <a href=\"https://www.youtube.com/watch?v=L-18XRTarOM\"><img src=\"https://img.youtube.com/vi/L-18XRTarOM/0.jpg\" width=\"200\" alt=\"Video: Entitas - Shmup - Part 1\"></a>                    | Entitas ECS Unity Tutorial - Setup & Basics               |                                                                                     |\n| <a href=\"https://www.youtube.com/watch?v=Phx7IJ3XUzg\"><img src=\"https://img.youtube.com/vi/Phx7IJ3XUzg/0.jpg\" width=\"200\" alt=\"Video: Watch the Entitas Talk at Unite Europe 2016\"></a> | Unite Europe 2016: ECS architecture with Unity by example | [SlideShare: Unite Europe 2016](http://www.slideshare.net/sschmid/uniteeurope-2016) |\n| <a href=\"https://www.youtube.com/watch?v=Re5kGtxTW6E\"><img src=\"https://img.youtube.com/vi/Re5kGtxTW6E/0.jpg\" width=\"200\" alt=\"Video: Watch the Entitas Talk at Unite Europe 2015\"></a> | Unite Europe 2015: Entity system architecture with Unity  | [SlideShare: Unite Europe 2015](http://www.slideshare.net/sschmid/uniteeurope-2015) |\n\n# First glimpse\n\nThe optional [code generator](https://github.com/sschmid/Entitas/wiki/Code-Generator)\nlets you write code that is super fast, safe and literally screams its intent.\n\n```csharp\nvar entity = context.CreateEntity();\nentity.AddPosition(Vector3.zero);\nentity.AddVelocity(Vector3.forward);\nentity.AddAsset(\"Player\");\n```\n\n```csharp\nusing static GameMatcher;\n\npublic sealed class MoveSystem : IExecuteSystem\n{\n    readonly IGroup<GameEntity> _group;\n\n    public MoveSystem(GameContext context)\n    {\n        _group = context.GetGroup(AllOf(Position, Velocity));\n    }\n\n    public void Execute()\n    {\n        foreach (var e in _group.GetEntities())\n            e.ReplacePosition(e.position.value + e.velocity.value);\n    }\n}\n```\n\n# Overview\n\nEntitas is fast, light and gets rid of unnecessary complexity. There are less\nthan a handful classes you have to know to rocket start your game or application:\n\n- Context\n- Entity\n- Component\n- Group\n\n```\nEntitas ECS\n\n+-----------------+\n|     Context     |\n|-----------------|\n|    e       e    |      +-----------+\n|       e      e--|----> |  Entity   |\n|  e        e     |      |-----------|\n|     e  e     e  |      | Component |\n| e          e    |      |           |      +-----------+\n|    e     e      |      | Component-|----> | Component |\n|  e    e    e    |      |           |      |-----------|\n|    e    e     e |      | Component |      |   Data    |\n+-----------------+      +-----------+      +-----------+\n  |\n  |\n  |     +-------------+  Groups:\n  |     |      e      |  Subsets of entities in the context\n  |     |   e     e   |  for blazing fast querying\n  +---> |        +------------+\n        |     e  |    |       |\n        |  e     | e  |  e    |\n        +--------|----+    e  |\n                 |     e      |\n                 |  e     e   |\n                 +------------+\n ```\n\n[Read more...](https://github.com/sschmid/Entitas/wiki/Home)\n\n# Code Generator\n\nThe Code Generator generates classes and methods for you, so you can focus on\ngetting the job done. It radically reduces the amount of code you have to write\nand improves readability by a huge magnitude. It makes your code less error-prone\nwhile ensuring best performance.\n\n[Read more...](https://github.com/sschmid/Entitas/wiki/Code-Generator)\n\n# Unity integration\n\nThe optional Unity module \"Visual Debugging\" integrates Entitas nicely into Unity and provides powerful\neditor extensions to inspect and debug contexts, groups, entities, components and systems.\n\n[Read more...](https://github.com/sschmid/Entitas/wiki/Unity-integration)\n\n<p align=\"center\">\n    <img src=\"images/Entitas.Unity-MenuItems.png\" alt=\"Entitas.Unity MenuItems\" height=\"200\"><br />\n    <img src=\"images/Entitas.Unity.VisualDebugging-Entity.png\" alt=\"Entitas.Unity.VisualDebugging Entity\" width=\"400\">\n    <img src=\"images/Entitas.Unity.VisualDebugging-DebugSystems.png\" alt=\"Entitas.Unity.VisualDebugging Systems\" width=\"400\">\n</p>\n\n# Entitas deep dive\n\n[Read the wiki](https://github.com/sschmid/Entitas/wiki) or checkout the [example projects](https://github.com/sschmid/Entitas/wiki/Example-projects) to\nsee Entitas in action. These example projects illustrate how systems, groups, collectors and entities all play together seamlessly.\n\n\n### **[» Download and setup](#download-and-setup-entitas)**\n### **[» Video Tutorials and Unity Unite Talks](#video-tutorials-and-unity-unite-talks)**\n### **[» Wiki and example projects](https://github.com/sschmid/Entitas/wiki)**\n### **[» Ask a question](https://github.com/sschmid/Entitas/issues/new)**\n\n---\n\n# Download and setup Entitas\n\n### GitHub releases (recommended)\n\n[Show releases](https://github.com/sschmid/Entitas/releases)\n\n### Unity package manager\n\n> Coming soon\n\n### NuGet\n\nEntitas and all dependencies are available as [NuGet packages](https://www.nuget.org/packages?q=Entitas).\nMore detailed explanation coming soon.\n\n### Unity Asset Store (deprecated)\n\n[Entitas on the Unity Asset Store](http://u3d.as/NuJ) is deprecated and will not\nbe updated anymore. The last version available on the Asset Store is 1.12.3 and\nis free to download. Please see discussion [Entitas turns 7 - and is FREE now ](https://github.com/sschmid/Entitas/discussions/1009)\n\n# Thanks to\n\nBig shout out to [@mzaks][github-mzaks], [@cloudjubei][github-cloudjubei] and [@devboy][github-devboy]\nfor endless hours of discussion and helping making Entitas awesome!\n\n[github-mzaks]: https://github.com/mzaks \"@mzaks\"\n[github-cloudjubei]: https://github.com/cloudjubei \"@cloudjubei\"\n[github-devboy]: https://github.com/devboy \"@devboy\"\n\n# Maintainers\n\n- [@sschmid][github-sschmid] | [@s_schmid][twitter-sschmid] | [@entitas_csharp][twitter-entitas_csharp]\n\n[github-sschmid]: https://github.com/sschmid \"@sschmid\"\n[twitter-sschmid]: https://twitter.com/s_schmid \"s_schmid on Twitter\"\n[twitter-entitas_csharp]: https://twitter.com/entitas_csharp \"entitas_csharp on Twitter\"\n\n# Different language?\n\nEntitas is available in\n- [C#](https://github.com/sschmid/Entitas)\n- [C++](https://github.com/JuDelCo/Entitas-Cpp)\n- [Clojure](https://github.com/mhaemmerle/entitas-clj)\n- [Crystal](https://github.com/spoved/entitas.cr)\n- [Erlang](https://github.com/mhaemmerle/entitas_erl)\n- [F#](https://github.com/darkoverlordofdata/entitas-fsharp)\n- [Go](https://github.com/wooga/go-entitas)\n- [Haskell](https://github.com/mhaemmerle/entitas-haskell)\n- [Java](https://github.com/Rubentxu/entitas-java)\n- [Kotlin](https://github.com/darkoverlordofdata/entitas-kotlin)\n- [Objective-C](https://github.com/wooga/entitas)\n- [Python](https://github.com/Aenyhm/entitas-python)\n- [Scala](https://github.com/darkoverlordofdata/entitas-scala)\n- [Swift](https://github.com/mzaks/Entitas-Swift)\n- [TypeScript](https://github.com/darkoverlordofdata/entitas-ts)\n"
  },
  {
    "path": "Unity3D.props",
    "content": "<Project>\n\n  <Choose>\n    <When Condition=\"$([MSBuild]::IsOsPlatform(Windows))\">\n      <PropertyGroup>\n        <OSApplicationPath>C:/Program Files</OSApplicationPath>\n        <UnityManagedPath>Editor/Data/Managed</UnityManagedPath>\n      </PropertyGroup>\n    </When>\n    <When Condition=\"$([MSBuild]::IsOsPlatform(OSX))\">\n      <PropertyGroup>\n        <OSApplicationPath>/Applications</OSApplicationPath>\n        <UnityManagedPath>Unity.app/Contents/Managed</UnityManagedPath>\n      </PropertyGroup>\n    </When>\n    <When Condition=\"$([MSBuild]::IsOsPlatform(Linux))\">\n      <PropertyGroup>\n        <OSApplicationPath>$([System.Environment]::GetFolderPath('System.Environment+SpecialFolder.UserProfile'))</OSApplicationPath>\n        <UnityManagedPath>Editor/Data/Managed</UnityManagedPath>\n      </PropertyGroup>\n    </When>\n  </Choose>\n\n  <PropertyGroup>\n    <UnityHubPath>$(OSApplicationPath)/Unity/Hub/Editor</UnityHubPath>\n  </PropertyGroup>\n\n  <PropertyGroup>\n    <UnityEnginePath>$(UnityManagedPath)/UnityEngine.dll</UnityEnginePath>\n    <UnityEditorPath>$(UnityManagedPath)/UnityEditor.dll</UnityEditorPath>\n  </PropertyGroup>\n\n</Project>\n"
  },
  {
    "path": "benchmarks/Entitas.Benchmarks/AERCBenchmarks.cs",
    "content": "#nullable disable\n\nusing BenchmarkDotNet.Attributes;\nusing BenchmarkDotNet.Order;\n\n// |     Method |      Mean |     Error |    StdDev | Rank | Allocated |\n// |----------- |----------:|----------:|----------:|-----:|----------:|\n// | UnsafeAERC |  1.153 ns | 0.0035 ns | 0.0033 ns |    1 |         - |\n// |   SafeAERC | 18.992 ns | 0.0751 ns | 0.0665 ns |    2 |         - |\n\nnamespace Entitas.Benchmarks\n{\n    [MemoryDiagnoser]\n    [Orderer(SummaryOrderPolicy.FastestToSlowest)]\n    [RankColumn]\n    public class AERCBenchmarks\n    {\n        SafeAERC _safeAerc;\n        UnsafeAERC _unsafeAerc;\n\n        [GlobalSetup]\n        public void GlobalSetup()\n        {\n            _safeAerc = new SafeAERC(null);\n            _unsafeAerc = new UnsafeAERC();\n        }\n\n        [Benchmark]\n        public void SafeAERC()\n        {\n            _safeAerc.Retain(this);\n            _safeAerc.Release(this);\n        }\n\n        [Benchmark]\n        public void UnsafeAERC()\n        {\n            _unsafeAerc.Retain(this);\n            _unsafeAerc.Release(this);\n        }\n    }\n}\n"
  },
  {
    "path": "benchmarks/Entitas.Benchmarks/CreateComponentBenchmarks.cs",
    "content": "#nullable disable\n\nusing BenchmarkDotNet.Attributes;\nusing BenchmarkDotNet.Order;\n\n// |    Method |     Mean |     Error |    StdDev | Rank |   Gen0 | Allocated |\n// |---------- |---------:|----------:|----------:|-----:|-------:|----------:|\n// |    Manual | 3.392 ns | 0.0159 ns | 0.0149 ns |    1 | 0.0115 |      24 B |\n// |   Generic | 8.100 ns | 0.0564 ns | 0.0500 ns |    2 | 0.0115 |      24 B |\n// | Activator | 9.741 ns | 0.0352 ns | 0.0312 ns |    3 | 0.0115 |      24 B |\n\nnamespace Entitas.Benchmarks\n{\n    [MemoryDiagnoser]\n    [Orderer(SummaryOrderPolicy.FastestToSlowest)]\n    [RankColumn]\n    public class CreateComponentBenchmarks\n    {\n        Entity _entity;\n\n        [GlobalSetup]\n        public void GlobalSetup()\n        {\n            var context = new Context<Entity>(1, () => new Entity());\n            _entity = context.CreateEntity();\n        }\n\n        [Benchmark]\n        public MovableComponent Activator()\n        {\n            return (MovableComponent)_entity.CreateComponent(0, typeof(MovableComponent));\n        }\n\n        [Benchmark]\n        public MovableComponent Generic()\n        {\n            return _entity.CreateComponent<MovableComponent>(0);\n        }\n\n        [Benchmark]\n        public MovableComponent Manual()\n        {\n            var componentPool = _entity.GetComponentPool(0);\n            return componentPool.Count > 0\n                ? (MovableComponent)componentPool.Pop()\n                : new MovableComponent();\n        }\n    }\n\n    public sealed class MovableComponent : IComponent { }\n}\n"
  },
  {
    "path": "benchmarks/Entitas.Benchmarks/DelegateBenchmarks.cs",
    "content": "#nullable disable\n\nusing System;\nusing BenchmarkDotNet.Attributes;\nusing BenchmarkDotNet.Order;\n\n// |         Method |      Mean |     Error |    StdDev | Rank |   Gen0 | Allocated |\n// |--------------- |----------:|----------:|----------:|-----:|-------:|----------:|\n// |       Delegate |  4.674 ns | 0.0105 ns | 0.0093 ns |    1 | 0.0115 |      24 B |\n// | InstanceMethod | 10.458 ns | 0.0646 ns | 0.0604 ns |    2 | 0.0421 |      88 B |\n\nnamespace Entitas.Benchmarks\n{\n    [MemoryDiagnoser]\n    [Orderer(SummaryOrderPolicy.FastestToSlowest)]\n    [RankColumn]\n    public class DelegateBenchmarks\n    {\n        static readonly Func<int, int> TimesTwoDelegate = a => a + a;\n\n        int TimesTwo(int a) => a + a;\n\n        [Benchmark]\n        public void InstanceMethod()\n        {\n            new MyClass(TimesTwo).Invoke(1);\n        }\n\n        [Benchmark]\n        public void Delegate()\n        {\n            new MyClass(TimesTwoDelegate).Invoke(1);\n        }\n\n        class MyClass\n        {\n            readonly Func<int, int> _method;\n\n            public MyClass(Func<int, int> method)\n            {\n                _method = method;\n            }\n\n            public int Invoke(int a) => _method(a);\n        }\n    }\n}\n"
  },
  {
    "path": "benchmarks/Entitas.Benchmarks/Entitas.Benchmarks.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n    <TargetFramework>$(DefaultTestTargetFramework)</TargetFramework>\n    <Nullable>enable</Nullable>\n    <IsPackable>false</IsPackable>\n    <IsPublishable>false</IsPublishable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"BenchmarkDotNet\" Version=\"0.13.5\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"../../src/Entitas/Entitas.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "benchmarks/Entitas.Benchmarks/Program.cs",
    "content": "﻿using BenchmarkDotNet.Running;\nusing Entitas.Benchmarks;\n\n// BenchmarkRunner.Run<CreateComponentBenchmarks>();\n// BenchmarkRunner.Run<DelegateBenchmarks>();\nBenchmarkRunner.Run<AERCBenchmarks>();\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/ComponentDeclaration.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Entitas.Generators\n{\n    public readonly struct ComponentDeclaration\n    {\n        public readonly SyntaxTree? SyntaxTree;\n        public readonly string? Namespace;\n        public readonly string FullName;\n\n        public readonly string Name;\n\n        public readonly ImmutableArray<MemberDeclaration> Members;\n        public readonly ImmutableArray<string> Contexts;\n        public readonly bool IsUnique;\n        public readonly int CleanupMode;\n        public readonly ImmutableArray<EventDeclaration> Events;\n        public readonly string FullPrefix;\n        public readonly string Prefix;\n\n        public ComponentDeclaration(SyntaxTree? syntaxTree, INamedTypeSymbol symbol, ImmutableArray<string> contexts)\n        {\n            SyntaxTree = syntaxTree;\n            Namespace = !symbol.ContainingNamespace.IsGlobalNamespace ? symbol.ContainingNamespace.ToDisplayString() : null;\n            FullName = symbol.ToDisplayString();\n            Name = symbol.Name;\n\n            Members = symbol.GetMembers()\n                .Where(member => member.DeclaredAccessibility == Accessibility.Public\n                                 && !member.IsStatic\n                                 && member.CanBeReferencedByName\n                                 && member is IFieldSymbol or IPropertySymbol { SetMethod: not null, GetMethod: not null })\n                .Select<ISymbol, MemberDeclaration?>(static member => member switch\n                {\n                    IFieldSymbol field => new MemberDeclaration(field),\n                    IPropertySymbol property => new MemberDeclaration(property),\n                    _ => null\n                })\n                .OfType<MemberDeclaration>()\n                .ToImmutableArray();\n\n            Contexts = contexts;\n            IsUnique = symbol.GetAttributes().Any(static attribute => attribute.AttributeClass?.ToDisplayString() == \"Entitas.Generators.Attributes.UniqueAttribute\");\n\n            var cleanupMode = symbol\n                .GetAttributes()\n                .FirstOrDefault(static attribute => attribute.AttributeClass?.ToDisplayString() == \"Entitas.Generators.Attributes.CleanupAttribute\")?\n                .ConstructorArguments.FirstOrDefault();\n\n            CleanupMode = cleanupMode?.Type?.ToDisplayString() == \"Entitas.Generators.Attributes.CleanupMode\" && cleanupMode.Value.Value is int mode ? mode : -1;\n\n            var prefix = Name.RemoveSuffix(\"Component\");\n\n            Events = symbol.GetAttributes()\n                .Where(static attribute => attribute.AttributeClass?.ToDisplayString() == \"Entitas.Generators.Attributes.EventAttribute\")\n                .Select(static attribute => attribute.ConstructorArguments)\n                .Select<ImmutableArray<TypedConstant>, EventDeclaration?>(args =>\n                {\n                    var eventTarget = args.Length > 0 && args[0].Type?.ToDisplayString() == \"Entitas.Generators.Attributes.EventTarget\" && args[0].Value is int eventTargetValue ? eventTargetValue : -1;\n                    if (eventTarget == -1)\n                        return null;\n\n                    var eventType = args.Length > 1 && args[1].Type?.ToDisplayString() == \"Entitas.Generators.Attributes.EventType\" && args[1].Value is int eventTypeValue ? eventTypeValue : 0;\n                    var order = args.Length > 2 && args[2].Type?.ToDisplayString() == \"int\" && args[2].Value is int orderValue ? orderValue : 0;\n                    return new EventDeclaration(eventTarget, eventType, order, prefix);\n                })\n                .OfType<EventDeclaration>()\n                .ToImmutableArray();\n\n            FullPrefix = FullName.Replace(\".\", string.Empty).RemoveSuffix(\"Component\");\n            Prefix = prefix;\n        }\n\n        ComponentDeclaration(ComponentDeclaration component, string fullName, string name, ImmutableArray<MemberDeclaration> members, string prefix)\n        {\n            SyntaxTree = component.SyntaxTree;\n            Namespace = component.Namespace;\n            FullName = fullName;\n            Name = name;\n            Members = members;\n            Contexts = component.Contexts;\n            IsUnique = false;\n            CleanupMode = -1;\n            Events = ImmutableArray<EventDeclaration>.Empty;\n            FullPrefix = prefix;\n            Prefix = prefix;\n        }\n\n        public ComponentDeclaration ToEvent(string fullName, string name, ImmutableArray<MemberDeclaration> members, string componentPrefix)\n        {\n            return new ComponentDeclaration(this, fullName, name, members, componentPrefix);\n        }\n\n        public string ContextAwareComponentPrefix(string contextPrefix)\n        {\n            return contextPrefix.Replace(\".\", string.Empty) + Prefix;\n        }\n    }\n\n    public class FullNameAndContextsComparer : IEqualityComparer<ComponentDeclaration>\n    {\n        public static readonly FullNameAndContextsComparer Instance = new FullNameAndContextsComparer();\n\n        public bool Equals(ComponentDeclaration x, ComponentDeclaration y) =>\n            x.FullName == y.FullName &&\n            x.Contexts.SequenceEqual(y.Contexts);\n\n        public int GetHashCode(ComponentDeclaration obj)\n        {\n            unchecked\n            {\n                return (obj.FullName.GetHashCode() * 397) ^ obj.Contexts.GetHashCode();\n            }\n        }\n    }\n\n    public class FullNameAndMembersAndContextsComparer : IEqualityComparer<ComponentDeclaration>\n    {\n        readonly IEqualityComparer<MemberDeclaration> _memberComparer;\n\n        public FullNameAndMembersAndContextsComparer(IEqualityComparer<MemberDeclaration> memberComparer)\n        {\n            _memberComparer = memberComparer;\n        }\n\n        public bool Equals(ComponentDeclaration x, ComponentDeclaration y) =>\n            x.FullName == y.FullName &&\n            x.Members.SequenceEqual(y.Members, _memberComparer) &&\n            x.Contexts.SequenceEqual(y.Contexts);\n\n        public int GetHashCode(ComponentDeclaration obj)\n        {\n            unchecked\n            {\n                var hashCode = obj.FullName.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Members.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Contexts.GetHashCode();\n                return hashCode;\n            }\n        }\n    }\n\n    public class FullNameAndMembersAndContextsAndIsUniqueComparer : IEqualityComparer<ComponentDeclaration>\n    {\n        readonly IEqualityComparer<MemberDeclaration> _memberComparer;\n\n        public FullNameAndMembersAndContextsAndIsUniqueComparer(IEqualityComparer<MemberDeclaration> memberComparer)\n        {\n            _memberComparer = memberComparer;\n        }\n\n        public bool Equals(ComponentDeclaration x, ComponentDeclaration y) =>\n            x.FullName == y.FullName &&\n            x.Members.SequenceEqual(y.Members, _memberComparer) &&\n            x.Contexts.SequenceEqual(y.Contexts) &&\n            x.IsUnique == y.IsUnique;\n\n        public int GetHashCode(ComponentDeclaration obj)\n        {\n            unchecked\n            {\n                var hashCode = obj.FullName.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Members.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Contexts.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.IsUnique.GetHashCode();\n                return hashCode;\n            }\n        }\n    }\n\n    public class FullNameAndContextsAndCleanupModeComparer : IEqualityComparer<ComponentDeclaration>\n    {\n        public static readonly FullNameAndContextsAndCleanupModeComparer Instance = new FullNameAndContextsAndCleanupModeComparer();\n\n        public bool Equals(ComponentDeclaration x, ComponentDeclaration y) =>\n            x.FullName == y.FullName &&\n            x.Contexts.SequenceEqual(y.Contexts) &&\n            x.CleanupMode == y.CleanupMode;\n\n        public int GetHashCode(ComponentDeclaration obj)\n        {\n            unchecked\n            {\n                var hashCode = obj.FullName.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Contexts.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.CleanupMode.GetHashCode();\n                return hashCode;\n            }\n        }\n    }\n\n    public class FullNameAndMembersAndContextsAndEventsComparer : IEqualityComparer<ComponentDeclaration>\n    {\n        readonly IEqualityComparer<MemberDeclaration> _memberComparer;\n        readonly IEqualityComparer<EventDeclaration> _eventComparer;\n\n        public FullNameAndMembersAndContextsAndEventsComparer(IEqualityComparer<MemberDeclaration> memberComparer, IEqualityComparer<EventDeclaration> eventComparer)\n        {\n            _memberComparer = memberComparer;\n            _eventComparer = eventComparer;\n        }\n\n        public bool Equals(ComponentDeclaration x, ComponentDeclaration y) =>\n            x.FullName == y.FullName &&\n            x.Members.SequenceEqual(y.Members, _memberComparer) &&\n            x.Contexts.SequenceEqual(y.Contexts) &&\n            x.Events.SequenceEqual(y.Events, _eventComparer);\n\n        public int GetHashCode(ComponentDeclaration obj)\n        {\n            unchecked\n            {\n                var hashCode = obj.FullName.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Members.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Contexts.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Events.GetHashCode();\n                return hashCode;\n            }\n        }\n    }\n\n    public class FullNameAndContextsAndEventsComparer : IEqualityComparer<ComponentDeclaration>\n    {\n        readonly IEqualityComparer<EventDeclaration> _eventComparer;\n\n        public FullNameAndContextsAndEventsComparer(IEqualityComparer<EventDeclaration> eventComparer)\n        {\n            _eventComparer = eventComparer;\n        }\n\n        public bool Equals(ComponentDeclaration x, ComponentDeclaration y) =>\n            x.FullName == y.FullName &&\n            x.Contexts.SequenceEqual(y.Contexts) &&\n            x.Events.SequenceEqual(y.Events, _eventComparer);\n\n        public int GetHashCode(ComponentDeclaration obj)\n        {\n            unchecked\n            {\n                var hashCode = obj.FullName.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Contexts.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Events.GetHashCode();\n                return hashCode;\n            }\n        }\n    }\n\n    public class ComponentsComparer : IEqualityComparer<ImmutableArray<ComponentDeclaration>>\n    {\n        readonly IEqualityComparer<ComponentDeclaration> _comparer;\n\n        public ComponentsComparer(IEqualityComparer<ComponentDeclaration> comparer)\n        {\n            _comparer = comparer;\n        }\n\n        public bool Equals(ImmutableArray<ComponentDeclaration> x, ImmutableArray<ComponentDeclaration> y) =>\n            x.SequenceEqual(y, _comparer);\n\n        public int GetHashCode(ImmutableArray<ComponentDeclaration> obj) => obj.GetHashCode();\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/ComponentGenerator.CleanupSystem.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ComponentGenerator\n    {\n        static void CleanupSystem(SourceProductionContext spc, ComponentDeclaration component, string context, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (component.CleanupMode == -1)\n                return;\n\n            if (!EntitasAnalyzerConfigOptions.ComponentCleanupSystems(optionsProvider, component.SyntaxTree))\n                return;\n\n            var cleanupSystemPrefix = component.CleanupMode == 0 ? \"Remove\" : \"Destroy\";\n            var cleanupAction = component.CleanupMode == 0 ? $\"Remove{component.Prefix}\" : \"Destroy\";\n\n            var contextPrefix = ContextPrefix(context);\n            var contextAwareComponentPrefix = component.ContextAwareComponentPrefix(contextPrefix);\n            var className = $\"{cleanupSystemPrefix}{contextAwareComponentPrefix}CleanupSystem\";\n            spc.AddSource(\n                GeneratedPath(CombinedNamespace(component.Namespace, className)),\n                GeneratedFileHeader(GeneratorSource(nameof(CleanupSystem))) +\n                NamespaceDeclaration(component.Namespace,\n                    $$\"\"\"\n                    public sealed class {{className}} : global::Entitas.ICleanupSystem\n                    {\n                        readonly global::Entitas.IGroup<global::{{contextPrefix}}.Entity> _group;\n                        readonly global::System.Collections.Generic.List<global::{{contextPrefix}}.Entity> _buffer = new global::System.Collections.Generic.List<global::{{contextPrefix}}.Entity>();\n\n                        public {{className}}(global::{{context}} context)\n                        {\n                            _group = context.GetGroup({{contextAwareComponentPrefix}}Matcher.{{component.Prefix}});\n                        }\n\n                        public void Cleanup()\n                        {\n                            foreach (var entity in _group.GetEntities(_buffer))\n                            {\n                                entity.{{cleanupAction}}();\n                            }\n                        }\n                    }\n\n                    \"\"\"));\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/ComponentGenerator.CleanupSystems.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ComponentGenerator\n    {\n        static void CleanupSystems(SourceProductionContext spc, ContextInitializationMethodDeclaration method, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (!EntitasAnalyzerConfigOptions.ComponentCleanupSystems(optionsProvider, method.SyntaxTree))\n                return;\n\n            spc.AddSource(\n                GeneratedPath($\"{method.ContextFullName}CleanupSystemsExtension\"),\n                GeneratedFileHeader(GeneratorSource(nameof(CleanupSystems))) +\n                NamespaceDeclaration(method.ContextNamespace,\n                    $$\"\"\"\n                    public static class {{method.ContextName}}CleanupSystemsExtension\n                    {\n                        public static global::Entitas.Systems CreateCleanupSystems(this {{method.ContextName}} context)\n                        {\n                    {{AddCleanupSystems(method.Components, method.FullContextPrefix)}}\n                        }\n                    }\n\n                    \"\"\"));\n\n            static string AddCleanupSystems(ImmutableArray<ComponentDeclaration> components, string contextPrefix)\n            {\n                return components.Length == 0\n                    ? \"        return null;\"\n                    : $$\"\"\"\n                            var systems = new global::Entitas.Systems();\n                    {{string.Join(\"\\n\", components.Select(component =>\n                    {\n                        var cleanupSystemPrefix = component.CleanupMode == 0 ? \"Remove\" : \"Destroy\";\n                        return $\"        systems.Add(new global::{CombinedNamespace(component.Namespace, cleanupSystemPrefix)}{component.ContextAwareComponentPrefix(contextPrefix)}CleanupSystem(context));\";\n                    }))}}\n                            return systems;\n                    \"\"\";\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/ComponentGenerator.ComponentIndex.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ComponentGenerator\n    {\n        static void ComponentIndex(SourceProductionContext spc, ComponentDeclaration component, string context, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (!EntitasAnalyzerConfigOptions.ComponentComponentIndex(optionsProvider, component.SyntaxTree))\n                return;\n\n            var contextPrefix = ContextPrefix(context);\n            var contextAwareComponentPrefix = component.ContextAwareComponentPrefix(contextPrefix);\n            var className = $\"{contextAwareComponentPrefix}ComponentIndex\";\n            spc.AddSource(\n                GeneratedPath(CombinedNamespace(component.Namespace, className)),\n                GeneratedFileHeader(GeneratorSource(nameof(ComponentIndex))) +\n                NamespaceDeclaration(component.Namespace,\n                    $$\"\"\"\n                    public static class {{className}}\n                    {\n                        public static global::{{contextPrefix}}.ComponentIndex Index;\n                    }\n\n                    \"\"\"));\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/ComponentGenerator.ContextExtension.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ComponentGenerator\n    {\n        static void ContextExtension(SourceProductionContext spc, ComponentDeclaration component, string context, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (!component.IsUnique)\n                return;\n\n            if (!EntitasAnalyzerConfigOptions.ComponentContextExtension(optionsProvider, component.SyntaxTree))\n                return;\n\n            var contextPrefix = ContextPrefix(context);\n            var contextAwareComponentPrefix = component.ContextAwareComponentPrefix(contextPrefix);\n            var className = $\"{contextAwareComponentPrefix}ContextExtension\";\n            string content;\n            if (component.Members.Length > 0)\n            {\n                content = $$\"\"\"\n                    public static class {{className}}\n                    {\n                        public static bool Has{{component.Prefix}}(this global::{{context}} context)\n                        {\n                            return context.Get{{component.Prefix}}Entity() != null;\n                        }\n\n                        public static global::{{contextPrefix}}.Entity Set{{component.Prefix}}(this global::{{context}} context, {{ComponentMethodParams(component)}})\n                        {\n                            if (context.Has{{component.Prefix}}())\n                            {\n                                throw new global::Entitas.EntitasException(\n                                    $\"Could not set {{component.Prefix}}!\\n{context} already has an entity with {{component.FullName}}!\",\n                                    \"You should check if the context already has a {{component.Prefix}}Entity before setting it or use context.Replace{{component.Prefix}}().\"\n                                );\n                            }\n\n                            return context.CreateEntity().Add{{component.Prefix}}({{ComponentMethodArgs(component)}});\n                        }\n\n                        public static global::{{contextPrefix}}.Entity Replace{{component.Prefix}}(this global::{{context}} context, {{ComponentMethodParams(component)}})\n                        {\n                            var entity = context.Get{{component.Prefix}}Entity();\n                            if (entity == null)\n                                entity = context.CreateEntity().Add{{component.Prefix}}({{ComponentMethodArgs(component)}});\n                            else\n                                entity.Replace{{component.Prefix}}({{ComponentMethodArgs(component)}});\n\n                            return entity;\n                        }\n\n                        public static void Remove{{component.Prefix}}(this global::{{context}} context)\n                        {\n                            context.Get{{component.Prefix}}Entity().Destroy();\n                        }\n\n                        public static global::{{contextPrefix}}.Entity Get{{component.Prefix}}Entity(this global::{{context}} context)\n                        {\n                            return context.GetGroup({{contextAwareComponentPrefix}}Matcher.{{component.Prefix}}).GetSingleEntity();\n                        }\n\n                        public static {{component.Name}} Get{{component.Prefix}}(this global::{{context}} context)\n                        {\n                            return context.Get{{component.Prefix}}Entity().Get{{component.Prefix}}();\n                        }\n                    }\n\n                    \"\"\";\n            }\n            else\n            {\n                content = $$\"\"\"\n                    public static class {{className}}\n                    {\n                        public static bool Has{{component.Prefix}}(this global::{{context}} context)\n                        {\n                            return context.Get{{component.Prefix}}Entity() != null;\n                        }\n\n                        public static global::{{contextPrefix}}.Entity Set{{component.Prefix}}(this global::{{context}} context)\n                        {\n                            return context.Get{{component.Prefix}}Entity() ?? context.CreateEntity().Add{{component.Prefix}}();\n                        }\n\n                        public static void Unset{{component.Prefix}}(this global::{{context}} context)\n                        {\n                            context.Get{{component.Prefix}}Entity()?.Destroy();\n                        }\n\n                        public static global::{{contextPrefix}}.Entity Get{{component.Prefix}}Entity(this global::{{context}} context)\n                        {\n                            return context.GetGroup({{contextAwareComponentPrefix}}Matcher.{{component.Prefix}}).GetSingleEntity();\n                        }\n                    }\n\n                    \"\"\";\n            }\n\n            spc.AddSource(\n                GeneratedPath(CombinedNamespace(component.Namespace, className)),\n                GeneratedFileHeader(GeneratorSource(nameof(ContextExtension))) +\n                NamespaceDeclaration(component.Namespace, content));\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/ComponentGenerator.ContextInitializationMethod.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ComponentGenerator\n    {\n        static void ContextInitializationMethod(SourceProductionContext spc, ContextInitializationMethodDeclaration method, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (!EntitasAnalyzerConfigOptions.ComponentContextInitializationMethod(optionsProvider, method.SyntaxTree))\n                return;\n\n            spc.AddSource(\n                GeneratedPath(CombinedNamespace(method.Namespace, $\"{method.Class}.{method.Name}.ContextInitialization\")),\n                GeneratedFileHeader(GeneratorSource(nameof(ContextInitializationMethod))) +\n                NamespaceDeclaration(method.Namespace,\n                    $$\"\"\"\n                    public static partial class {{method.Class}}\n                    {\n                        public static partial void {{method.Name}}()\n                        {\n                    {{ComponentIndexAssignments(method, method.Components)}}\n\n                            global::{{method.ContextFullName}}.ComponentNames = new string[]\n                            {\n                    {{ComponentNames(method.Components)}}\n                            };\n\n                            global::{{method.ContextFullName}}.ComponentTypes = new global::System.Type[]\n                            {\n                    {{ComponentTypes(method.Components)}}\n                            };\n                        }\n                    }\n\n                    \"\"\"));\n\n            static string ComponentIndexAssignments(ContextInitializationMethodDeclaration method, ImmutableArray<ComponentDeclaration> components)\n            {\n                return string.Join(\"\\n\", components.Select((component, i) =>\n                {\n                    var contextPrefix = \"global::\" + CombinedNamespace(component.Namespace, ContextAware(method.FullContextPrefix).Replace(\".\", string.Empty));\n                    return $\"        {contextPrefix}{component.Prefix}ComponentIndex.Index = new global::{method.FullContextPrefix}.ComponentIndex({i});\";\n                }));\n            }\n\n            static string ComponentNames(ImmutableArray<ComponentDeclaration> components)\n            {\n                return string.Join(\",\\n\", components.Select(static component => $\"            \\\"{component.FullName.RemoveSuffix(\"Component\")}\\\"\"));\n            }\n\n            static string ComponentTypes(ImmutableArray<ComponentDeclaration> components)\n            {\n                return string.Join(\",\\n\", components.Select(static component => $\"            typeof(global::{component.FullName})\"));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/ComponentGenerator.EntityExtension.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ComponentGenerator\n    {\n        static void EntityExtension(SourceProductionContext spc, ComponentDeclaration component, string context, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (!EntitasAnalyzerConfigOptions.ComponentEntityExtension(optionsProvider, component.SyntaxTree))\n                return;\n\n            var contextPrefix = ContextPrefix(context);\n            var contextAwareComponentPrefix = component.ContextAwareComponentPrefix(contextPrefix);\n            var className = $\"{contextAwareComponentPrefix}EntityExtension\";\n            var index = $\"{contextAwareComponentPrefix}ComponentIndex.Index.Value\";\n            string content;\n            if (component.Members.Length > 0)\n            {\n                content = $$\"\"\"\n                    public static class {{className}}\n                    {\n                        public static bool Has{{component.Prefix}}(this global::{{contextPrefix}}.Entity entity)\n                        {\n                            return entity.HasComponent({{index}});\n                        }\n\n                        public static global::{{contextPrefix}}.Entity Add{{component.Prefix}}(this global::{{contextPrefix}}.Entity entity, {{ComponentMethodParams(component)}})\n                        {\n                            var index = {{index}};\n                            var componentPool = entity.GetComponentPool(index);\n                            var component = componentPool.Count > 0\n                                ? ({{component.Name}})componentPool.Pop()\n                                : new {{component.Name}}();\n                    {{ComponentValueAssignments(component)}}\n                            entity.AddComponent(index, component);\n                            return entity;\n                        }\n\n                        public static global::{{contextPrefix}}.Entity Replace{{component.Prefix}}(this global::{{contextPrefix}}.Entity entity, {{ComponentMethodParams(component)}})\n                        {\n                            var index = {{index}};\n                            var componentPool = entity.GetComponentPool(index);\n                            var component = componentPool.Count > 0\n                                ? ({{component.Name}})componentPool.Pop()\n                                : new {{component.Name}}();\n                    {{ComponentValueAssignments(component)}}\n                            entity.ReplaceComponent(index, component);\n                            return entity;\n                        }\n\n                        public static global::{{contextPrefix}}.Entity Remove{{component.Prefix}}(this global::{{contextPrefix}}.Entity entity)\n                        {\n                            entity.RemoveComponent({{index}});\n                            return entity;\n                        }\n\n                        public static {{component.Name}} Get{{component.Prefix}}(this global::{{contextPrefix}}.Entity entity)\n                        {\n                            return ({{component.Name}})entity.GetComponent({{index}});\n                        }\n                    }\n\n                    \"\"\";\n            }\n            else\n            {\n                content = $$\"\"\"\n                    public static class {{className}}\n                    {\n                        static readonly {{component.Name}} Single{{component.Name}} = new {{component.Name}}();\n\n                        public static bool Has{{component.Prefix}}(this global::{{contextPrefix}}.Entity entity)\n                        {\n                            return entity.HasComponent({{index}});\n                        }\n\n                        public static global::{{contextPrefix}}.Entity Add{{component.Prefix}}(this global::{{contextPrefix}}.Entity entity)\n                        {\n                            entity.AddComponent({{index}}, Single{{component.Name}});\n                            return entity;\n                        }\n\n                        public static global::{{contextPrefix}}.Entity Replace{{component.Prefix}}(this global::{{contextPrefix}}.Entity entity)\n                        {\n                            entity.ReplaceComponent({{index}}, Single{{component.Name}});\n                            return entity;\n                        }\n\n                        public static global::{{contextPrefix}}.Entity Remove{{component.Prefix}}(this global::{{contextPrefix}}.Entity entity)\n                        {\n                            entity.RemoveComponent({{index}});\n                            return entity;\n                        }\n\n                        public static {{component.Name}} Get{{component.Prefix}}(this global::{{contextPrefix}}.Entity entity)\n                        {\n                            return ({{component.Name}})entity.GetComponent({{index}});\n                        }\n                    }\n\n                    \"\"\";\n            }\n\n            spc.AddSource(\n                GeneratedPath(CombinedNamespace(component.Namespace, className)),\n                GeneratedFileHeader(GeneratorSource(nameof(EntityExtension))) +\n                NamespaceDeclaration(component.Namespace, content));\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/ComponentGenerator.EntityIndexExtension.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ComponentGenerator\n    {\n        static void EntityIndexExtension(SourceProductionContext spc, ContextInitializationMethodDeclaration method, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (!EntitasAnalyzerConfigOptions.ComponentEntityIndexExtension(optionsProvider, method.SyntaxTree))\n                return;\n\n            var componentMemberPairs = method.Components\n                .SelectMany(component => component.Members\n                    .Where(member => member.EntityIndexType != -1)\n                    .Select(member => (Component: component, Member: member)))\n                .ToImmutableArray();\n\n            spc.AddSource(\n                GeneratedPath($\"{method.ContextFullName}EntityIndexExtension\"),\n                GeneratedFileHeader(GeneratorSource(nameof(EntityIndexExtension))) +\n                NamespaceDeclaration(method.ContextNamespace,\n                    $$\"\"\"\n                    public static class {{method.ContextName}}EntityIndexExtension\n                    {{{EntityIndexNames(componentMemberPairs)}}\n                        public static {{method.ContextName}} AddAllEntityIndexes(this {{method.ContextName}} context)\n                        {{{AddEntityIndexes(componentMemberPairs, method)}}\n                            return context;\n                        }\n                    }\n\n                    \"\"\") +\n                EntityIndexExtensionMethods(componentMemberPairs, method));\n\n            static string EntityIndexNames(ImmutableArray<(ComponentDeclaration Component, MemberDeclaration Member)> pairs)\n            {\n                return pairs.Length == 0\n                    ? string.Empty\n                    : \"\\n\" + string.Join(\"\\n\", pairs.Select(static pair =>\n                    {\n                        var indexName = $\"{pair.Component.FullPrefix}{pair.Member.Name}\";\n                        return $\"    public const string {indexName} = \\\"{indexName}\\\";\";\n                    })) + \"\\n\";\n            }\n\n            static string AddEntityIndexes(ImmutableArray<(ComponentDeclaration Component, MemberDeclaration Member)> pairs, ContextInitializationMethodDeclaration method)\n            {\n                return pairs.Length == 0\n                    ? string.Empty\n                    : \"\\n\" + string.Join(\"\\n\", pairs.Select(pair =>\n                    {\n                        var indexName = $\"{pair.Component.FullPrefix}{pair.Member.Name}\";\n                        var indexType = pair.Member.EntityIndexType == 0 ? \"EntityIndex\" : \"PrimaryEntityIndex\";\n                        var contextAwareComponentPrefix = pair.Component.ContextAwareComponentPrefix(method.FullContextPrefix);\n                        return $$\"\"\"\n                                    context.AddEntityIndex(new global::Entitas.{{indexType}}<global::{{method.FullContextPrefix}}.Entity, {{pair.Member.Type}}>(\n                                        {{indexName}},\n                                        context.GetGroup(global::{{CombinedNamespace(pair.Component.Namespace, contextAwareComponentPrefix)}}Matcher.{{pair.Component.Prefix}}),\n                                        (entity, component) => ((global::{{pair.Component.FullName}})component).{{pair.Member.Name}}));\n\n                            \"\"\";\n                    }));\n            }\n\n            static string EntityIndexExtensionMethods(ImmutableArray<(ComponentDeclaration Component, MemberDeclaration Member)> pairs, ContextInitializationMethodDeclaration method)\n            {\n                return pairs.Length == 0\n                    ? string.Empty\n                    : \"\\n\" + string.Join(\"\\n\", pairs\n                        .GroupBy(pair => pair.Component.Namespace)\n                        .Select(group => NamespaceDeclaration(group.Key,\n                            $$\"\"\"\n                        public static class EntityIndexExtension\n                        {\n                        {{string.Join(\"\\n\\n\", group.Select(pair => pair.Member.EntityIndexType == 0\n                            ? $$\"\"\"\n                                    public static global::System.Collections.Generic.HashSet<global::{{method.FullContextPrefix}}.Entity> GetEntitiesWith{{pair.Component.Prefix}}{{pair.Member.Name}}(this global::{{method.ContextFullName}} context, {{pair.Member.Type}} {{pair.Member.ValidLowerFirstName}})\n                                    {\n                                        return ((global::Entitas.EntityIndex<global::{{method.FullContextPrefix}}.Entity, {{pair.Member.Type}}>)context.GetEntityIndex(global::{{method.ContextFullName}}EntityIndexExtension.{{pair.Component.FullPrefix}}{{pair.Member.Name}})).GetEntities({{pair.Member.ValidLowerFirstName}});\n                                    }\n                                \"\"\"\n                            : $$\"\"\"\n                                    public static global::{{method.FullContextPrefix}}.Entity GetEntityWith{{pair.Component.Prefix}}{{pair.Member.Name}}(this global::{{method.ContextFullName}} context, {{pair.Member.Type}} {{pair.Member.ValidLowerFirstName}})\n                                    {\n                                        return ((global::Entitas.PrimaryEntityIndex<global::{{method.FullContextPrefix}}.Entity, {{pair.Member.Type}}>)context.GetEntityIndex(global::{{method.ContextFullName}}EntityIndexExtension.{{pair.Component.FullPrefix}}{{pair.Member.Name}})).GetEntity({{pair.Member.ValidLowerFirstName}});\n                                    }\n                                \"\"\"))}}\n                        }\n\n                        \"\"\"\n                        )));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/ComponentGenerator.EventSystems.cs",
    "content": "using System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ComponentGenerator\n    {\n        static void EventSystemsContextExtension(SourceProductionContext spc, ContextInitializationMethodDeclaration method, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (!EntitasAnalyzerConfigOptions.ComponentEventSystemsContextExtension(optionsProvider, method.SyntaxTree))\n                return;\n\n            spc.AddSource(\n                GeneratedPath($\"{method.ContextFullName}EventSystemsExtension\"),\n                GeneratedFileHeader(GeneratorSource(nameof(EventSystemsContextExtension))) +\n                NamespaceDeclaration(method.ContextNamespace,\n                    $$\"\"\"\n                    public static class {{method.ContextName}}EventSystemsExtension\n                    {\n                        public static global::Entitas.Systems CreateEventSystems(this {{method.ContextName}} context)\n                        {\n                    {{AddEventSystems(method.Components, method.FullContextPrefix)}}\n                        }\n                    }\n\n                    \"\"\"));\n\n            static string AddEventSystems(ImmutableArray<ComponentDeclaration> components, string contextPrefix)\n            {\n                var events = components\n                    .SelectMany(component => component.Events.Select(@event => (Component: component, Event: @event)))\n                    .ToImmutableArray();\n\n                return events.Length == 0\n                    ? \"        return null;\"\n                    : $$\"\"\"\n                            var systems = new global::Entitas.Systems();\n                    {{string.Join(\"\\n\", events\n                        .OrderBy(pair => pair.Event.Order)\n                        .Select(pair =>\n                        {\n                            var (component, @event) = pair;\n                            @event.ContextAware(ContextAware(contextPrefix));\n                            return $\"        systems.Add(new global::{CombinedNamespace(component.Namespace, @event.ContextAwareEvent)}EventSystem(context)); // Order: {@event.Order}\";\n                        }))}}\n                            return systems;\n                    \"\"\";\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/ComponentGenerator.Events.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ComponentGenerator\n    {\n        static void Events(SourceProductionContext spc, ComponentDeclaration component, string context, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (component.Events.Length == 0)\n                return;\n\n            if (!EntitasAnalyzerConfigOptions.ComponentEvents(optionsProvider, component.SyntaxTree))\n                return;\n\n            var contextPrefix = ContextPrefix(context);\n            var contextAware = ContextAware(contextPrefix);\n            var contextAwareComponentPrefix = component.ContextAwareComponentPrefix(contextPrefix);\n            foreach (var @event in component.Events)\n            {\n                @event.ContextAware(contextAware);\n                var optionalComponentMethodParams = string.Empty;\n                var optionalComponentValueMethodArgs = string.Empty;\n                var componentDeclaration = string.Empty;\n                string filter;\n\n                if (@event.EventType == 0)\n                {\n                    if (component.Members.Length > 0)\n                    {\n                        optionalComponentMethodParams = $\", {ComponentMethodParams(component)}\";\n                        optionalComponentValueMethodArgs = $\", {ComponentValueMethodArgs(component)}\";\n                        componentDeclaration = $\"\\n            var component = entity.Get{component.Prefix}();\";\n                    }\n\n                    filter = $\"entity.Has{component.Prefix}()\";\n                }\n                else\n                {\n                    filter = $\"!entity.Has{component.Prefix}()\";\n                }\n\n                if (@event.EventTarget == 1)\n                {\n                    filter += $\" && entity.Has{@event.EventListener}()\";\n                }\n\n                var content = $$\"\"\"\n                    public interface {{@event.ContextAwareEventListenerInterface}}\n                    {\n                        void {{@event.EventMethod}}(global::{{contextPrefix}}.Entity entity{{optionalComponentMethodParams}});\n                    }\n\n                    public sealed class {{@event.ContextAwareEventListenerComponent}} : global::Entitas.IComponent\n                    {\n                        public global::System.Collections.Generic.List<{{@event.ContextAwareEventListenerInterface}}> Value;\n                    }\n\n                    public static class {{@event.ContextAwareEventListener}}EventEntityExtension\n                    {\n                        public static global::{{contextPrefix}}.Entity Add{{@event.EventListener}}(this global::{{contextPrefix}}.Entity entity, {{@event.ContextAwareEventListenerInterface}} value)\n                        {\n                            var listeners = entity.Has{{@event.EventListener}}()\n                                ? entity.Get{{@event.EventListener}}().Value\n                                : new global::System.Collections.Generic.List<{{@event.ContextAwareEventListenerInterface}}>();\n                            listeners.Add(value);\n                            return entity.Replace{{@event.EventListener}}(listeners);\n                        }\n\n                        public static void Remove{{@event.EventListener}}(this global::{{contextPrefix}}.Entity entity, {{@event.ContextAwareEventListenerInterface}} value, bool removeListenerWhenEmpty = true)\n                        {\n                            var listeners = entity.Get{{@event.EventListener}}().Value;\n                            listeners.Remove(value);\n                            if (removeListenerWhenEmpty && listeners.Count == 0)\n                            {\n                                entity.Remove{{@event.EventListener}}();\n                                if (entity.IsEmpty())\n                                    entity.Destroy();\n                            }\n                            else\n                            {\n                                entity.Replace{{@event.EventListener}}(listeners);\n                            }\n                        }\n                    }\n\n\n                    \"\"\";\n\n                if (@event.EventTarget == 0)\n                {\n                    content += $$\"\"\"\n                        public sealed class {{@event.ContextAwareEvent}}EventSystem : global::Entitas.ReactiveSystem<global::{{contextPrefix}}.Entity>\n                        {\n                            readonly global::Entitas.IGroup<global::{{contextPrefix}}.Entity> _listeners;\n                            readonly global::System.Collections.Generic.List<global::{{contextPrefix}}.Entity> _entityBuffer;\n                            readonly global::System.Collections.Generic.List<{{@event.ContextAwareEventListenerInterface}}> _listenerBuffer;\n\n                            public {{@event.ContextAwareEvent}}EventSystem({{context}} context) : base(context)\n                            {\n                                _listeners = context.GetGroup({{@event.ContextAwareEventListener}}Matcher.{{@event.EventListener}});\n                                _entityBuffer = new global::System.Collections.Generic.List<global::{{contextPrefix}}.Entity>();\n                                _listenerBuffer = new global::System.Collections.Generic.List<{{@event.ContextAwareEventListenerInterface}}>();\n                            }\n\n                            protected override global::Entitas.ICollector<global::{{contextPrefix}}.Entity> GetTrigger(global::Entitas.IContext<global::{{contextPrefix}}.Entity> context)\n                            {\n                                return global::Entitas.CollectorContextExtension.CreateCollector(\n                                    context, global::Entitas.TriggerOnEventMatcherExtension.{{@event.EventTypeSuffix}}({{contextAwareComponentPrefix}}Matcher.{{component.Prefix}})\n                                );\n                            }\n\n                            protected override bool Filter(global::{{contextPrefix}}.Entity entity)\n                            {\n                                return {{filter}};\n                            }\n\n                            protected override void Execute(global::System.Collections.Generic.List<global::{{contextPrefix}}.Entity> entities)\n                            {\n                                foreach (var entity in entities)\n                                {{{componentDeclaration}}\n                                    foreach (var listenerEntity in _listeners.GetEntities(_entityBuffer))\n                                    {\n                                        _listenerBuffer.Clear();\n                                        _listenerBuffer.AddRange(listenerEntity.Get{{@event.EventListener}}().Value);\n                                        foreach (var listener in _listenerBuffer)\n                                        {\n                                            listener.{{@event.EventMethod}}(entity{{optionalComponentValueMethodArgs}});\n                                        }\n                                    }\n                                }\n                            }\n                        }\n\n                        \"\"\";\n                }\n                else\n                {\n                    content += $$\"\"\"\n                        public sealed class {{@event.ContextAwareEvent}}EventSystem : global::Entitas.ReactiveSystem<global::{{contextPrefix}}.Entity>\n                        {\n                            readonly global::System.Collections.Generic.List<{{@event.ContextAwareEventListenerInterface}}> _listenerBuffer;\n\n                            public {{@event.ContextAwareEvent}}EventSystem({{context}} context) : base(context)\n                            {\n                                _listenerBuffer = new global::System.Collections.Generic.List<{{@event.ContextAwareEventListenerInterface}}>();\n                            }\n\n                            protected override global::Entitas.ICollector<global::{{contextPrefix}}.Entity> GetTrigger(global::Entitas.IContext<global::{{contextPrefix}}.Entity> context)\n                            {\n                                return global::Entitas.CollectorContextExtension.CreateCollector(\n                                    context, global::Entitas.TriggerOnEventMatcherExtension.{{@event.EventTypeSuffix}}({{contextAwareComponentPrefix}}Matcher.{{component.Prefix}})\n                                );\n                            }\n\n                            protected override bool Filter(global::{{contextPrefix}}.Entity entity)\n                            {\n                                return {{filter}};\n                            }\n\n                            protected override void Execute(global::System.Collections.Generic.List<global::{{contextPrefix}}.Entity> entities)\n                            {\n                                foreach (var entity in entities)\n                                {{{componentDeclaration}}\n                                    _listenerBuffer.Clear();\n                                    _listenerBuffer.AddRange(entity.Get{{@event.EventListener}}().Value);\n                                    foreach (var listener in _listenerBuffer)\n                                    {\n                                        listener.{{@event.EventMethod}}(entity{{optionalComponentValueMethodArgs}});\n                                    }\n                                }\n                            }\n                        }\n\n                        \"\"\";\n                }\n\n                spc.AddSource(\n                    GeneratedPath(CombinedNamespace(component.Namespace, @event.ContextAwareEventListenerComponent)),\n                    GeneratedFileHeader(GeneratorSource(nameof(Events))) +\n                    NamespaceDeclaration(component.Namespace, content));\n\n                var eventComponent = ToEvent(component, @event);\n                ComponentIndex(spc, eventComponent, context, optionsProvider);\n                Matcher(spc, eventComponent, context, optionsProvider);\n                EntityExtension(spc, eventComponent, context, optionsProvider);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/ComponentGenerator.Matcher.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ComponentGenerator\n    {\n        static void Matcher(SourceProductionContext spc, ComponentDeclaration component, string context, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (!EntitasAnalyzerConfigOptions.ComponentMatcher(optionsProvider, component.SyntaxTree))\n                return;\n\n            var contextPrefix = ContextPrefix(context);\n            var contextAwareComponentPrefix = component.ContextAwareComponentPrefix(contextPrefix);\n            var className = $\"{contextAwareComponentPrefix}Matcher\";\n            var index = $\"{contextAwareComponentPrefix}ComponentIndex.Index.Value\";\n            spc.AddSource(\n                GeneratedPath(CombinedNamespace(component.Namespace, className)),\n                GeneratedFileHeader(GeneratorSource(nameof(Matcher))) +\n                NamespaceDeclaration(component.Namespace,\n                    $$\"\"\"\n                    public static class {{className}}\n                    {\n                        static global::Entitas.IMatcher<global::{{contextPrefix}}.Entity> _matcher;\n\n                        public static global::Entitas.IMatcher<global::{{contextPrefix}}.Entity> {{component.Prefix}}\n                        {\n                            get\n                            {\n                                if (_matcher == null)\n                                {\n                                    var matcher = (global::Entitas.Matcher<global::{{contextPrefix}}.Entity>)global::Entitas.Matcher<global::{{contextPrefix}}.Entity>.AllOf({{index}});\n                                    matcher.ComponentNames = {{context}}.ComponentNames;\n                                    _matcher = matcher;\n                                }\n\n                                return _matcher;\n                            }\n                        }\n                    }\n\n                    \"\"\"));\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/ComponentGenerator.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Threading;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    [Generator(LanguageNames.CSharp)]\n    public sealed partial class ComponentGenerator : IIncrementalGenerator\n    {\n        public void Initialize(IncrementalGeneratorInitializationContext initContext)\n        {\n            var optionsProvider = initContext.AnalyzerConfigOptionsProvider;\n            var componentsProvider = initContext.SyntaxProvider\n                .CreateSyntaxProvider(IsComponentCandidate, CreateComponentDeclaration)\n                .Where(static component => component is not null)\n                .Select(static (component, _) => component!.Value);\n\n            initContext.RegisterSourceOutput(\n                componentsProvider.WithComparer(FullNameAndContextsComparer.Instance).Combine(optionsProvider),\n                static (SourceProductionContext spc, (ComponentDeclaration Component, AnalyzerConfigOptionsProvider OptionsProvider) pair) =>\n                {\n                    foreach (var context in pair.Component.Contexts)\n                    {\n                        spc.CancellationToken.ThrowIfCancellationRequested();\n                        ComponentIndex(spc, pair.Component, context, pair.OptionsProvider);\n                        Matcher(spc, pair.Component, context, pair.OptionsProvider);\n                    }\n                });\n\n            initContext.RegisterSourceOutput(\n                componentsProvider.WithComparer(new FullNameAndMembersAndContextsComparer(TypeAndNameComparer.Instance)).Combine(optionsProvider),\n                static (SourceProductionContext spc, (ComponentDeclaration Component, AnalyzerConfigOptionsProvider OptionsProvider) pair) =>\n                {\n                    foreach (var context in pair.Component.Contexts)\n                    {\n                        spc.CancellationToken.ThrowIfCancellationRequested();\n                        EntityExtension(spc, pair.Component, context, pair.OptionsProvider);\n                    }\n                });\n\n            initContext.RegisterSourceOutput(\n                componentsProvider.WithComparer(new FullNameAndMembersAndContextsAndIsUniqueComparer(TypeAndNameComparer.Instance)).Combine(optionsProvider),\n                static (SourceProductionContext spc, (ComponentDeclaration Component, AnalyzerConfigOptionsProvider OptionsProvider) pair) =>\n                {\n                    foreach (var context in pair.Component.Contexts)\n                    {\n                        spc.CancellationToken.ThrowIfCancellationRequested();\n                        ContextExtension(spc, pair.Component, context, pair.OptionsProvider);\n                    }\n                });\n\n            initContext.RegisterSourceOutput(\n                componentsProvider.WithComparer(FullNameAndContextsAndCleanupModeComparer.Instance).Combine(optionsProvider),\n                static (SourceProductionContext spc, (ComponentDeclaration Component, AnalyzerConfigOptionsProvider OptionsProvider) pair) =>\n                {\n                    foreach (var context in pair.Component.Contexts)\n                    {\n                        spc.CancellationToken.ThrowIfCancellationRequested();\n                        CleanupSystem(spc, pair.Component, context, pair.OptionsProvider);\n                    }\n                });\n\n            initContext.RegisterSourceOutput(\n                componentsProvider.WithComparer(new FullNameAndMembersAndContextsAndEventsComparer(TypeAndNameComparer.Instance, EventTargetAndEventTypeComparer.Instance)).Combine(optionsProvider),\n                static (SourceProductionContext spc, (ComponentDeclaration Component, AnalyzerConfigOptionsProvider OptionsProvider) pair) =>\n                {\n                    foreach (var context in pair.Component.Contexts)\n                    {\n                        spc.CancellationToken.ThrowIfCancellationRequested();\n                        Events(spc, pair.Component, context, pair.OptionsProvider);\n                    }\n                });\n\n            var componentsInCompilationProvider = initContext.CompilationProvider.Select(CreateComponentDeclarationsForCompilation);\n\n            var contextInitializationProvider = initContext.SyntaxProvider\n                .CreateSyntaxProvider(IsContextInitializationMethodCandidate, CreateContextInitializationMethodDeclaration)\n                .Where(static method => method is not null)\n                .Select(static (method, _) => method!.Value)\n                .WithComparer(NamespaceAndClassAndNameAndContextFullNameComparer.Instance);\n\n            var contextInitializationMethodComparer = new FullNameAndContextsAndEventsComparer(EventTargetAndEventTypeComparer.Instance);\n            initContext.RegisterImplementationSourceOutput(contextInitializationProvider\n                    .Combine(componentsInCompilationProvider.WithComparer(new ComponentsComparer(contextInitializationMethodComparer)))\n                    .Select(static ((ContextInitializationMethodDeclaration Method, ImmutableArray<ComponentDeclaration> Components) pair, CancellationToken _) =>\n                    {\n                        pair.Method.Components = pair.Components\n                            .Where(component => component.Contexts.Contains(pair.Method.ContextFullName))\n                            .ToImmutableArray();\n\n                        return pair.Method;\n                    })\n                    .WithComparer(new NamespaceAndClassAndNameAndContextFullNameAndComponentsComparer(contextInitializationMethodComparer))\n                    .Combine(optionsProvider),\n                static (SourceProductionContext spc, (ContextInitializationMethodDeclaration Method, AnalyzerConfigOptionsProvider OptionsProvider) pair) =>\n                    ContextInitializationMethod(spc, pair.Method, pair.OptionsProvider));\n\n            var cleanupSystemsComparer = FullNameAndContextsAndCleanupModeComparer.Instance;\n            initContext.RegisterSourceOutput(contextInitializationProvider\n                    .Combine(componentsInCompilationProvider.WithComparer(new ComponentsComparer(cleanupSystemsComparer)))\n                    .Select(static ((ContextInitializationMethodDeclaration Method, ImmutableArray<ComponentDeclaration> Components) pair, CancellationToken _) =>\n                    {\n                        pair.Method.Components = pair.Components\n                            .Where(static component => component.CleanupMode != -1)\n                            .Where(component => component.Contexts.Contains(pair.Method.ContextFullName))\n                            .ToImmutableArray();\n\n                        return pair.Method;\n                    })\n                    .WithComparer(new NamespaceAndClassAndNameAndContextFullNameAndComponentsComparer(cleanupSystemsComparer))\n                    .Combine(optionsProvider),\n                static (SourceProductionContext spc, (ContextInitializationMethodDeclaration Method, AnalyzerConfigOptionsProvider OptionsProvider) pair) =>\n                    CleanupSystems(spc, pair.Method, pair.OptionsProvider));\n\n            var eventSystemsContextExtensionComparer = new FullNameAndContextsAndEventsComparer(EventTargetAndEventTypeAndOrderComparer.Instance);\n            initContext.RegisterSourceOutput(contextInitializationProvider\n                    .Combine(componentsInCompilationProvider.WithComparer(new ComponentsComparer(eventSystemsContextExtensionComparer)))\n                    .Select(static ((ContextInitializationMethodDeclaration Method, ImmutableArray<ComponentDeclaration> Components) pair, CancellationToken _) =>\n                    {\n                        pair.Method.Components = pair.Components\n                            .Where(component => component.Events.Length > 0)\n                            .Where(component => component.Contexts.Contains(pair.Method.ContextFullName))\n                            .ToImmutableArray();\n\n                        return pair.Method;\n                    })\n                    .WithComparer(new NamespaceAndClassAndNameAndContextFullNameAndComponentsComparer(eventSystemsContextExtensionComparer))\n                    .Combine(optionsProvider),\n                static (SourceProductionContext spc, (ContextInitializationMethodDeclaration Method, AnalyzerConfigOptionsProvider OptionsProvider) pair) =>\n                    EventSystemsContextExtension(spc, pair.Method, pair.OptionsProvider));\n\n            var entityIndexExtensionComparer = new FullNameAndMembersAndContextsComparer(TypeAndNameAndEntityIndexTypeComparer.Instance);\n            initContext.RegisterSourceOutput(contextInitializationProvider\n                    .Combine(componentsInCompilationProvider.WithComparer(new ComponentsComparer(entityIndexExtensionComparer)))\n                    .Select(static ((ContextInitializationMethodDeclaration Method, ImmutableArray<ComponentDeclaration> Components) pair, CancellationToken _) =>\n                    {\n                        pair.Method.Components = pair.Components\n                            .Where(static component => component.Members.Any(static member => member.EntityIndexType != -1))\n                            .Where(component => component.Contexts.Contains(pair.Method.ContextFullName))\n                            .ToImmutableArray();\n\n                        return pair.Method;\n                    })\n                    .WithComparer(new NamespaceAndClassAndNameAndContextFullNameAndComponentsComparer(entityIndexExtensionComparer))\n                    .Combine(optionsProvider),\n                static (SourceProductionContext spc, (ContextInitializationMethodDeclaration Method, AnalyzerConfigOptionsProvider OptionsProvider) pair) =>\n                    EntityIndexExtension(spc, pair.Method, pair.OptionsProvider));\n        }\n\n        static bool IsComponentCandidate(SyntaxNode node, CancellationToken _)\n        {\n            return node is ClassDeclarationSyntax { BaseList.Types.Count: > 0 } candidate\n                   && candidate.BaseList.Types.Any(static baseType => baseType.Type switch\n                   {\n                       IdentifierNameSyntax identifierNameSyntax => identifierNameSyntax.Identifier is { Text: \"IComponent\" },\n                       QualifiedNameSyntax qualifiedNameSyntax => qualifiedNameSyntax is\n                       {\n                           Left: IdentifierNameSyntax { Identifier.Text: \"Entitas\" },\n                           Right: IdentifierNameSyntax { Identifier.Text: \"IComponent\" }\n                       },\n                       _ => false\n                   })\n                   && candidate.Modifiers.Any(SyntaxKind.PublicKeyword)\n                   && !candidate.Modifiers.Any(SyntaxKind.StaticKeyword)\n                   && candidate.Modifiers.Any(SyntaxKind.SealedKeyword)\n                   && !candidate.Modifiers.Any(SyntaxKind.PartialKeyword);\n        }\n\n        static ComponentDeclaration? CreateComponentDeclaration(GeneratorSyntaxContext syntaxContext, CancellationToken cancellationToken)\n        {\n            var candidate = (ClassDeclarationSyntax)syntaxContext.Node;\n            var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(candidate, cancellationToken);\n            if (symbol is null)\n                return null;\n\n            var componentInterface = syntaxContext.SemanticModel.Compilation.GetTypeByMetadataName(\"Entitas.IComponent\");\n            if (componentInterface is null)\n                return null;\n\n            var isComponent = symbol.Interfaces.Contains(componentInterface);\n            if (!isComponent)\n                return null;\n\n            var contexts = GetContexts(symbol);\n            if (contexts.Length == 0)\n                return null;\n\n            return new ComponentDeclaration(candidate.SyntaxTree, symbol, contexts);\n        }\n\n        static ImmutableArray<ComponentDeclaration> CreateComponentDeclarationsForCompilation(Compilation compilation, CancellationToken cancellationToken)\n        {\n            var componentInterface = compilation.GetTypeByMetadataName(\"Entitas.IComponent\");\n            if (componentInterface is null)\n                return ImmutableArray<ComponentDeclaration>.Empty;\n\n            var allComponents = new List<ComponentDeclaration>();\n            var stack = new Stack<INamespaceSymbol>();\n            stack.Push(compilation.GlobalNamespace);\n\n            while (stack.Count > 0)\n            {\n                cancellationToken.ThrowIfCancellationRequested();\n                foreach (var member in stack.Pop().GetMembers())\n                {\n                    cancellationToken.ThrowIfCancellationRequested();\n                    if (member is INamespaceSymbol ns)\n                    {\n                        stack.Push(ns);\n                    }\n                    else if (member is INamedTypeSymbol symbol)\n                    {\n                        var isComponent = symbol.Interfaces.Contains(componentInterface);\n                        if (!isComponent)\n                            continue;\n\n                        var contexts = GetContexts(symbol);\n                        if (contexts.Length == 0)\n                            continue;\n\n                        var component = new ComponentDeclaration(symbol.DeclaringSyntaxReferences.FirstOrDefault()?.SyntaxTree, symbol, contexts);\n                        allComponents.Add(component);\n\n                        foreach (var context in contexts)\n                        {\n                            var contextAware = ContextAware(ContextPrefix(context));\n                            foreach (var @event in component.Events)\n                            {\n                                @event.ContextAware(contextAware);\n                                allComponents.Add(ToEvent(component, @event));\n                            }\n                        }\n                    }\n                }\n            }\n\n            return allComponents\n                .OrderBy(static component => component.FullName)\n                .ToImmutableArray();\n        }\n\n        static ImmutableArray<string> GetContexts(INamedTypeSymbol symbol)\n        {\n            return symbol.GetAttributes()\n                .Where(static attribute => attribute.AttributeClass?.ToDisplayString() == \"Entitas.Generators.Attributes.ContextAttribute\")\n                .Select(static attribute => attribute.ConstructorArguments.SingleOrDefault())\n                .Where(static arg => arg.Type?.ToDisplayString() == \"System.Type\" && arg.Value is INamedTypeSymbol)\n                .Select(static arg => ((INamedTypeSymbol)arg.Value!).ToDisplayString())\n                .Distinct()\n                .ToImmutableArray();\n        }\n\n        static bool IsContextInitializationMethodCandidate(SyntaxNode node, CancellationToken _)\n        {\n            return node is MethodDeclarationSyntax { AttributeLists.Count: > 0 } candidate\n                   && candidate.AttributeLists.Any(static attributeList => attributeList.Attributes\n                       .Any(static attribute => attribute.Name is IdentifierNameSyntax { Identifier.Text: \"ContextInitialization\" or \"ContextInitializationAttribute\" }))\n                   && candidate.Modifiers.Any(SyntaxKind.PublicKeyword)\n                   && candidate.Modifiers.Any(SyntaxKind.StaticKeyword)\n                   && candidate.Modifiers.Any(SyntaxKind.PartialKeyword)\n                   && candidate.ReturnType is PredefinedTypeSyntax predefined\n                   && predefined.Keyword.IsKind(SyntaxKind.VoidKeyword);\n        }\n\n        static ContextInitializationMethodDeclaration? CreateContextInitializationMethodDeclaration(GeneratorSyntaxContext syntaxContext, CancellationToken cancellationToken)\n        {\n            var candidate = (MethodDeclarationSyntax)syntaxContext.Node;\n            var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(candidate, cancellationToken);\n            if (symbol is null)\n                return null;\n\n            if (!symbol.ContainingType.IsStatic || symbol.ContainingType.DeclaredAccessibility != Accessibility.Public)\n                return null;\n\n            var context = symbol.GetAttributes()\n                .Where(static attribute => attribute.AttributeClass?.ToDisplayString() == \"Entitas.Generators.Attributes.ContextInitializationAttribute\")\n                .Select(static attribute => attribute.ConstructorArguments.SingleOrDefault())\n                .Where(static arg => arg.Type?.ToDisplayString() == \"System.Type\" && arg.Value is INamedTypeSymbol)\n                .Select(static arg => (INamedTypeSymbol)arg.Value!)\n                .Distinct(SymbolEqualityComparer.Default)\n                .SingleOrDefault();\n\n            if (context is null)\n                return null;\n\n            return new ContextInitializationMethodDeclaration(candidate.SyntaxTree, symbol, context);\n        }\n\n        static ComponentDeclaration ToEvent(ComponentDeclaration component, EventDeclaration @event) => component.ToEvent(\n            CombinedNamespace(component.Namespace, @event.ContextAwareEventListenerComponent),\n            @event.ContextAwareEventListenerComponent,\n            ImmutableArray.Create(new MemberDeclaration($\"global::System.Collections.Generic.List<{@event.ContextAwareEventListenerInterface}>\", \"Value\", -1)),\n            @event.EventListener);\n\n        static string GeneratorSource(string source) => $\"{typeof(ComponentGenerator).FullName}.{source}\";\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/ContextInitializationMethodDeclaration.cs",
    "content": "using System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\n\nnamespace Entitas.Generators\n{\n    public struct ContextInitializationMethodDeclaration\n    {\n        public readonly SyntaxTree SyntaxTree;\n        public readonly string? Namespace;\n        public readonly string Class;\n        public readonly string Name;\n        public readonly string? ContextNamespace;\n        public readonly string ContextFullName;\n        public readonly string ContextName;\n        public readonly string FullContextPrefix;\n\n        public ImmutableArray<ComponentDeclaration> Components;\n\n        public ContextInitializationMethodDeclaration(SyntaxTree syntaxTree, IMethodSymbol symbol, ISymbol contextSymbol)\n        {\n            SyntaxTree = syntaxTree;\n            Namespace = !symbol.ContainingNamespace.IsGlobalNamespace\n                ? symbol.ContainingNamespace.ToDisplayString()\n                : null;\n\n            Class = symbol.ContainingType.Name;\n            Name = symbol.Name;\n\n            ContextNamespace = !contextSymbol.ContainingNamespace.IsGlobalNamespace\n                ? symbol.ContainingNamespace.ToDisplayString()\n                : null;\n            ContextFullName = contextSymbol.ToDisplayString();\n            ContextName = contextSymbol.Name;\n\n            FullContextPrefix = ContextFullName.RemoveSuffix(\"Context\");\n        }\n    }\n\n    public class NamespaceAndClassAndNameAndContextFullNameComparer : IEqualityComparer<ContextInitializationMethodDeclaration>\n    {\n        public static readonly NamespaceAndClassAndNameAndContextFullNameComparer Instance = new NamespaceAndClassAndNameAndContextFullNameComparer();\n\n        public bool Equals(ContextInitializationMethodDeclaration x, ContextInitializationMethodDeclaration y) =>\n            x.Namespace == y.Namespace &&\n            x.Class == y.Class &&\n            x.Name == y.Name &&\n            x.ContextFullName == y.ContextFullName;\n\n        public int GetHashCode(ContextInitializationMethodDeclaration obj)\n        {\n            unchecked\n            {\n                var hashCode = obj.Namespace != null ? obj.Namespace.GetHashCode() : 0;\n                hashCode = (hashCode * 397) ^ obj.Class.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Name.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.ContextFullName.GetHashCode();\n                return hashCode;\n            }\n        }\n    }\n\n    public class NamespaceAndClassAndNameAndContextFullNameAndComponentsComparer : IEqualityComparer<ContextInitializationMethodDeclaration>\n    {\n        readonly IEqualityComparer<ComponentDeclaration> _componentComparer;\n\n        public NamespaceAndClassAndNameAndContextFullNameAndComponentsComparer(IEqualityComparer<ComponentDeclaration> componentComparer)\n        {\n            _componentComparer = componentComparer;\n        }\n\n        public bool Equals(ContextInitializationMethodDeclaration x, ContextInitializationMethodDeclaration y) =>\n            x.Namespace == y.Namespace &&\n            x.Class == y.Class &&\n            x.Name == y.Name &&\n            x.ContextFullName == y.ContextFullName &&\n            x.Components.SequenceEqual(y.Components, _componentComparer);\n\n        public int GetHashCode(ContextInitializationMethodDeclaration obj)\n        {\n            unchecked\n            {\n                var hashCode = (obj.Namespace != null ? obj.Namespace.GetHashCode() : 0);\n                hashCode = (hashCode * 397) ^ obj.Class.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Name.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.ContextFullName.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Components.GetHashCode();\n                return hashCode;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/EventDeclaration.cs",
    "content": "using System.Collections.Generic;\n\nnamespace Entitas.Generators\n{\n    public struct EventDeclaration\n    {\n        public readonly int EventTarget;\n        public readonly int EventType;\n        public readonly int Order;\n\n        public readonly string EventTargetPrefix;\n        public readonly string EventTypeSuffix;\n        public readonly string EventPrefix;\n        public readonly string EventListener;\n        public readonly string EventMethod;\n\n        public string ContextAwareEvent = null!;\n        public string ContextAwareEventListener = null!;\n        public string ContextAwareEventListenerInterface = null!;\n        public string ContextAwareEventListenerComponent = null!;\n\n        public EventDeclaration(int eventTarget, int eventType, int order, string componentPrefix)\n        {\n            EventTarget = eventTarget;\n            EventType = eventType;\n            Order = order;\n\n            EventTargetPrefix = eventTarget == 0 ? \"Any\" : string.Empty;\n            EventTypeSuffix = eventType == 0 ? \"Added\" : \"Removed\";\n            EventPrefix = $\"{EventTargetPrefix}{componentPrefix}{EventTypeSuffix}\"; // e.g. AnyPositionAdded\n            EventListener = $\"{EventPrefix}Listener\"; // e.g. AnyPositionAddedListener\n            EventMethod = $\"On{EventPrefix}\"; // e.g. OnAnyPositionAdded\n        }\n\n        public void ContextAware(string contextAware)\n        {\n            ContextAwareEvent = $\"{contextAware}{EventPrefix}\"; // e.g. MyAppMainAnyPositionAdded\n            ContextAwareEventListener = $\"{ContextAwareEvent}Listener\"; // e.g. MyAppMainAnyPositionAddedListener\n            ContextAwareEventListenerInterface = $\"I{ContextAwareEventListener}\"; // e.g. IMyAppMainAnyPositionAddedListener\n            ContextAwareEventListenerComponent = $\"{ContextAwareEventListener}Component\"; // e.g. MyAppMainAnyPositionAddedListenerComponent\n        }\n    }\n\n    public class EventTargetAndEventTypeComparer : IEqualityComparer<EventDeclaration>\n    {\n        public static readonly EventTargetAndEventTypeComparer Instance = new EventTargetAndEventTypeComparer();\n\n        public bool Equals(EventDeclaration x, EventDeclaration y) =>\n            x.EventTarget == y.EventTarget &&\n            x.EventType == y.EventType;\n\n        public int GetHashCode(EventDeclaration obj)\n        {\n            unchecked\n            {\n                var hashCode = obj.EventTarget.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.EventType.GetHashCode();\n                return hashCode;\n            }\n        }\n    }\n\n    public class EventTargetAndEventTypeAndOrderComparer : IEqualityComparer<EventDeclaration>\n    {\n        public static readonly EventTargetAndEventTypeAndOrderComparer Instance = new EventTargetAndEventTypeAndOrderComparer();\n\n        public bool Equals(EventDeclaration x, EventDeclaration y) =>\n            x.EventTarget == y.EventTarget &&\n            x.EventType == y.EventType &&\n            x.Order == y.Order;\n\n        public int GetHashCode(EventDeclaration obj)\n        {\n            unchecked\n            {\n                var hashCode = obj.EventTarget.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.EventType.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Order.GetHashCode();\n                return hashCode;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Component/MemberDeclaration.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\n\nnamespace Entitas.Generators\n{\n    public readonly struct MemberDeclaration\n    {\n        public readonly string Type;\n        public readonly string Name;\n        public readonly int EntityIndexType;\n        public readonly string ValidLowerFirstName;\n\n        public MemberDeclaration(IFieldSymbol field) : this(field, field.Type) { }\n\n        public MemberDeclaration(IPropertySymbol property) : this(property, property.Type) { }\n\n        public MemberDeclaration(ISymbol symbol, ITypeSymbol type) : this(GetTypeName(type), symbol.Name, GetEntityIndexType(symbol)) { }\n\n        public MemberDeclaration(string type, string name, int entityIndexType)\n        {\n            Type = type;\n            Name = name;\n            EntityIndexType = entityIndexType;\n            ValidLowerFirstName = ToValidLowerFirst(Name);\n        }\n\n        static string GetTypeName(ITypeSymbol type)\n        {\n            return type is IArrayTypeSymbol arrayType\n                ? arrayType.ToDisplayString().Replace(\"*\", string.Empty)\n                : type.ToDisplayString();\n        }\n\n        static int GetEntityIndexType(ISymbol symbol)\n        {\n            var attribute = symbol.GetAttributes().FirstOrDefault(static attribute => attribute.AttributeClass?.ToDisplayString() == \"Entitas.Generators.Attributes.EntityIndexAttribute\");\n            if (attribute is null)\n                return -1;\n\n            var arg = attribute.ConstructorArguments.FirstOrDefault();\n            return arg.Type?.ToDisplayString() == \"bool\" && arg.Value is bool isPrimary ? isPrimary ? 1 : 0 : -1;\n        }\n\n        static string ToValidLowerFirst(string value)\n        {\n            var lowerFirst = char.ToLower(value[0]) + value.Substring(1);\n            return SyntaxFacts.GetKeywordKind(lowerFirst) != SyntaxKind.None\n                ? $\"@{lowerFirst}\"\n                : lowerFirst;\n        }\n    }\n\n    public class TypeAndNameComparer : IEqualityComparer<MemberDeclaration>\n    {\n        public static readonly TypeAndNameComparer Instance = new TypeAndNameComparer();\n\n        public bool Equals(MemberDeclaration x, MemberDeclaration y) =>\n            x.Type == y.Type &&\n            x.Name == y.Name;\n\n        public int GetHashCode(MemberDeclaration obj)\n        {\n            unchecked\n            {\n                return (obj.Type.GetHashCode() * 397) ^ obj.Name.GetHashCode();\n            }\n        }\n    }\n\n    public class TypeAndNameAndEntityIndexTypeComparer : IEqualityComparer<MemberDeclaration>\n    {\n        public static readonly TypeAndNameAndEntityIndexTypeComparer Instance = new TypeAndNameAndEntityIndexTypeComparer();\n\n        public bool Equals(MemberDeclaration x, MemberDeclaration y) =>\n            x.Type == y.Type &&\n            x.Name == y.Name &&\n            x.EntityIndexType == y.EntityIndexType;\n\n        public int GetHashCode(MemberDeclaration obj)\n        {\n            unchecked\n            {\n                var hashCode = obj.Type.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.Name.GetHashCode();\n                hashCode = (hashCode * 397) ^ obj.EntityIndexType;\n                return hashCode;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Context/ContextDeclaration.cs",
    "content": "using System;\nusing Microsoft.CodeAnalysis;\n\nnamespace Entitas.Generators\n{\n    public readonly struct ContextDeclaration : IEquatable<ContextDeclaration>\n    {\n        public readonly SyntaxTree SyntaxTree;\n        public readonly string? Namespace;\n        public readonly string FullName;\n        public readonly string Name;\n\n        public readonly string FullContextPrefix;\n        public readonly string ContextPrefix;\n\n        public ContextDeclaration(SyntaxTree syntaxTree, INamedTypeSymbol symbol)\n        {\n            SyntaxTree = syntaxTree;\n            Namespace = !symbol.ContainingNamespace.IsGlobalNamespace ? symbol.ContainingNamespace.ToDisplayString() : null;\n            FullName = symbol.ToDisplayString();\n            Name = symbol.Name;\n\n            FullContextPrefix = FullName.RemoveSuffix(\"Context\");\n            ContextPrefix = Name.RemoveSuffix(\"Context\");\n        }\n\n        public bool Equals(ContextDeclaration other) => FullName == other.FullName;\n        public override bool Equals(object? obj) => obj is ContextDeclaration other && Equals(other);\n        public override int GetHashCode() => FullName.GetHashCode();\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Context/ContextGenerator.ComponentIndex.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ContextGenerator\n    {\n        static void ComponentIndex(SourceProductionContext spc, ContextDeclaration context, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (!EntitasAnalyzerConfigOptions.ContextComponentIndex(optionsProvider, context.SyntaxTree))\n                return;\n\n            spc.AddSource(ContextAwarePath(context, \"ComponentIndex\"),\n                GeneratedFileHeader(GeneratorSource(nameof(ComponentIndex))) +\n                NamespaceDeclaration(context.FullContextPrefix,\n                    \"\"\"\n                    public readonly struct ComponentIndex : global::System.IEquatable<ComponentIndex>\n                    {\n                        public readonly int Value;\n\n                        public ComponentIndex(int value)\n                        {\n                            Value = value;\n                        }\n\n                        public bool Equals(ComponentIndex other) => Value == other.Value;\n                    #nullable enable\n                        public override bool Equals(object? obj) => obj is ComponentIndex other && Equals(other);\n                    #nullable disable\n                        public override int GetHashCode() => Value;\n                    }\n\n                    \"\"\"));\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Context/ContextGenerator.Context.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ContextGenerator\n    {\n        static void Context(SourceProductionContext spc, ContextDeclaration context, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (!EntitasAnalyzerConfigOptions.ContextContext(optionsProvider, context.SyntaxTree))\n                return;\n\n            spc.AddSource(GeneratedPath(context.FullName),\n                GeneratedFileHeader(GeneratorSource(nameof(Context))) +\n                NamespaceDeclaration(context.Namespace,\n                    $$\"\"\"\n                    public sealed partial class {{context.Name}} : global::Entitas.Context<{{context.ContextPrefix}}.Entity>\n                    {\n                        public static string[] ComponentNames;\n                        public static global::System.Type[] ComponentTypes;\n\n                        public {{context.Name}}() :\n                            base(\n                                ComponentTypes.Length,\n                                0,\n                                new global::Entitas.ContextInfo(\n                                    \"{{context.FullName}}\",\n                                    ComponentNames,\n                                    ComponentTypes\n                                ),\n                    #if (ENTITAS_FAST_AND_UNSAFE)\n                                global::Entitas.UnsafeAERC.Delegate,\n                    #else\n                                global::Entitas.SafeAERC.Delegate,\n                    #endif\n                                () => new {{context.ContextPrefix}}.Entity()\n                            ) { }\n                    }\n\n                    \"\"\"));\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Context/ContextGenerator.Entity.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ContextGenerator\n    {\n        static void Entity(SourceProductionContext spc, ContextDeclaration context, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (!EntitasAnalyzerConfigOptions.ContextEntity(optionsProvider, context.SyntaxTree))\n                return;\n\n            spc.AddSource(ContextAwarePath(context, \"Entity\"),\n                GeneratedFileHeader(GeneratorSource(nameof(Entity))) +\n                NamespaceDeclaration(context.FullContextPrefix,\n                    \"\"\"\n                    public sealed class Entity : global::Entitas.Entity { }\n\n                    \"\"\"));\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Context/ContextGenerator.Matcher.cs",
    "content": "using Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    partial class ContextGenerator\n    {\n        static void Matcher(SourceProductionContext spc, ContextDeclaration context, AnalyzerConfigOptionsProvider optionsProvider)\n        {\n            if (!EntitasAnalyzerConfigOptions.ContextMatcher(optionsProvider, context.SyntaxTree))\n                return;\n\n            spc.AddSource(ContextAwarePath(context, \"Matcher\"),\n                GeneratedFileHeader(GeneratorSource(nameof(Matcher))) +\n                NamespaceDeclaration(context.FullContextPrefix,\n                    \"\"\"\n                    public static class Matcher\n                    {\n                        public static global::Entitas.IAllOfMatcher<Entity> AllOf(params int[] indexes)\n                        {\n                            return global::Entitas.Matcher<Entity>.AllOf(indexes);\n                        }\n\n                        public static global::Entitas.IAllOfMatcher<Entity> AllOf(params global::Entitas.IMatcher<Entity>[] matchers)\n                        {\n                            return global::Entitas.Matcher<Entity>.AllOf(matchers);\n                        }\n\n                        public static global::Entitas.IAnyOfMatcher<Entity> AnyOf(params int[] indexes)\n                        {\n                            return global::Entitas.Matcher<Entity>.AnyOf(indexes);\n                        }\n\n                        public static global::Entitas.IAnyOfMatcher<Entity> AnyOf(params global::Entitas.IMatcher<Entity>[] matchers)\n                        {\n                            return global::Entitas.Matcher<Entity>.AnyOf(matchers);\n                        }\n                    }\n\n                    \"\"\"));\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Context/ContextGenerator.cs",
    "content": "using System.Linq;\nusing System.Threading;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.CSharp.Syntax;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing static Entitas.Generators.Templates;\n\nnamespace Entitas.Generators\n{\n    [Generator(LanguageNames.CSharp)]\n    public sealed partial class ContextGenerator : IIncrementalGenerator\n    {\n        public void Initialize(IncrementalGeneratorInitializationContext initContext)\n        {\n            var options = initContext.AnalyzerConfigOptionsProvider;\n\n            var contextChanged = initContext.SyntaxProvider\n                .CreateSyntaxProvider(IsContextCandidate, CreateContextDeclaration)\n                .Where(static context => context is not null)\n                .Select(static (context, _) => context!.Value);\n\n            initContext.RegisterSourceOutput(contextChanged.Combine(options), OnContextChanged);\n        }\n\n        static bool IsContextCandidate(SyntaxNode node, CancellationToken _)\n        {\n            return node is ClassDeclarationSyntax { BaseList.Types.Count: > 0 } candidate\n                   && candidate.BaseList.Types.Any(static baseType => baseType.Type switch\n                   {\n                       IdentifierNameSyntax identifierNameSyntax => identifierNameSyntax.Identifier is { Text: \"IContext\" },\n                       QualifiedNameSyntax qualifiedNameSyntax => qualifiedNameSyntax is\n                       {\n                           Left: IdentifierNameSyntax { Identifier.Text: \"Entitas\" },\n                           Right: IdentifierNameSyntax { Identifier.Text: \"IContext\" }\n                       },\n                       _ => false\n                   })\n                   && !candidate.Modifiers.Any(SyntaxKind.PublicKeyword)\n                   && !candidate.Modifiers.Any(SyntaxKind.StaticKeyword)\n                   && !candidate.Modifiers.Any(SyntaxKind.SealedKeyword)\n                   && candidate.Modifiers.Any(SyntaxKind.PartialKeyword);\n        }\n\n        static ContextDeclaration? CreateContextDeclaration(GeneratorSyntaxContext syntaxContext, CancellationToken cancellationToken)\n        {\n            var candidate = (ClassDeclarationSyntax)syntaxContext.Node;\n            var symbol = syntaxContext.SemanticModel.GetDeclaredSymbol(candidate, cancellationToken);\n            if (symbol is null)\n                return null;\n\n            var componentInterface = syntaxContext.SemanticModel.Compilation.GetTypeByMetadataName(\"Entitas.IContext\");\n            if (componentInterface is null)\n                return null;\n\n            var isContext = symbol.Interfaces.Contains(componentInterface);\n            if (!isContext)\n                return null;\n\n            return new ContextDeclaration(candidate.SyntaxTree, symbol);\n        }\n\n        static void OnContextChanged(SourceProductionContext spc, (ContextDeclaration Context, AnalyzerConfigOptionsProvider OptionsProvider) pair)\n        {\n            var (context, optionsProvider) = pair;\n            ComponentIndex(spc, context, optionsProvider);\n            Entity(spc, context, optionsProvider);\n            Matcher(spc, context, optionsProvider);\n            Context(spc, context, optionsProvider);\n        }\n\n        static string ContextAwarePath(ContextDeclaration context, string hintName)\n        {\n            return GeneratedPath($\"{context.FullContextPrefix}.{hintName}\");\n        }\n\n        static string GeneratorSource(string source)\n        {\n            return $\"{typeof(ContextGenerator).FullName}.{source}\";\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Entitas.Generators.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>$(DefaultGeneratorFramework)</TargetFramework>\n    <Version>2.0.0</Version>\n    <Nullable>enable</Nullable>\n    <EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.Analyzers\" Version=\"3.3.4\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp\" Version=\"4.1.0\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "gen/Entitas.Generators/Entitas.Generators.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=component/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=context/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>\n"
  },
  {
    "path": "gen/Entitas.Generators/EntitasAnalyzerConfigOptions.cs",
    "content": "using System;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Diagnostics;\n\nnamespace Entitas.Generators\n{\n    public static class EntitasAnalyzerConfigOptions\n    {\n        public const string ComponentCleanupSystemsKey = \"entitas_generator.component.cleanup_systems\";\n        public const string ComponentComponentIndexKey = \"entitas_generator.component.component_index\";\n        public const string ComponentContextExtensionKey = \"entitas_generator.component.context_extension\";\n        public const string ComponentContextInitializationMethodKey = \"entitas_generator.component.context_initialization_method\";\n        public const string ComponentEntityExtensionKey = \"entitas_generator.component.entity_extension\";\n        public const string ComponentEntityIndexExtensionKey = \"entitas_generator.component.entity_index_extension\";\n        public const string ComponentEventsKey = \"entitas_generator.component.events\";\n        public const string ComponentEventSystemsExtensionKey = \"entitas_generator.component.event_systems_extension\";\n        public const string ComponentMatcherKey = \"entitas_generator.component.matcher\";\n\n        public const string ContextComponentIndexKey = \"entitas_generator.context.component_index\";\n        public const string ContextContextKey = \"entitas_generator.context.context\";\n        public const string ContextEntityKey = \"entitas_generator.context.entity\";\n        public const string ContextMatcherKey = \"entitas_generator.context.matcher\";\n\n        public static bool ComponentCleanupSystems(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree) => IsTrue(optionsProvider, syntaxTree, ComponentCleanupSystemsKey);\n        public static bool ComponentComponentIndex(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree) => IsTrue(optionsProvider, syntaxTree, ComponentComponentIndexKey);\n        public static bool ComponentContextExtension(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree) => IsTrue(optionsProvider, syntaxTree, ComponentContextExtensionKey);\n        public static bool ComponentContextInitializationMethod(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree) => IsTrue(optionsProvider, syntaxTree, ComponentContextInitializationMethodKey);\n        public static bool ComponentEntityExtension(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree) => IsTrue(optionsProvider, syntaxTree, ComponentEntityExtensionKey);\n        public static bool ComponentEntityIndexExtension(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree) => IsTrue(optionsProvider, syntaxTree, ComponentEntityIndexExtensionKey);\n        public static bool ComponentEvents(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree) => IsTrue(optionsProvider, syntaxTree, ComponentEventsKey);\n        public static bool ComponentEventSystemsContextExtension(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree) => IsTrue(optionsProvider, syntaxTree, ComponentEventSystemsExtensionKey);\n        public static bool ComponentMatcher(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree) => IsTrue(optionsProvider, syntaxTree, ComponentMatcherKey);\n\n        public static bool ContextComponentIndex(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree) => IsTrue(optionsProvider, syntaxTree, ContextComponentIndexKey);\n        public static bool ContextContext(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree) => IsTrue(optionsProvider, syntaxTree, ContextContextKey);\n        public static bool ContextEntity(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree) => IsTrue(optionsProvider, syntaxTree, ContextEntityKey);\n        public static bool ContextMatcher(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree) => IsTrue(optionsProvider, syntaxTree, ContextMatcherKey);\n\n        static bool IsTrue(AnalyzerConfigOptionsProvider optionsProvider, SyntaxTree? syntaxTree, string key)\n        {\n            return syntaxTree is not null && (!optionsProvider.GetOptions(syntaxTree).TryGetValue(key, out var value) || value.Equals(\"true\", StringComparison.OrdinalIgnoreCase));\n        }\n    }\n}\n"
  },
  {
    "path": "gen/Entitas.Generators/Templates.cs",
    "content": "using System;\nusing System.Linq;\n\nnamespace Entitas.Generators\n{\n    public static class Templates\n    {\n        public static string GeneratedPath(string hintName)\n        {\n            return $\"{hintName}.g.cs\";\n        }\n\n        public static string GeneratedFileHeader(string generatorSource)\n        {\n            return $$\"\"\"\n                //------------------------------------------------------------------------------\n                // <auto-generated>\n                //     This code was generated by\n                //     {{generatorSource}}\n                //\n                //     Changes to this file may cause incorrect behavior and will be lost if\n                //     the code is regenerated.\n                // </auto-generated>\n                //------------------------------------------------------------------------------\n\n                \"\"\";\n        }\n\n        public static string CombinedNamespace(string? @namespace, string suffix)\n        {\n            return !string.IsNullOrEmpty(@namespace)\n                ? $\"{@namespace}.{suffix}\"\n                : suffix;\n        }\n\n        public static string NamespaceDeclaration(string? @namespace, string content)\n        {\n            return !string.IsNullOrEmpty(@namespace)\n                ? $\"namespace {@namespace}\\n{{\\n{content}}}\\n\"\n                : content;\n        }\n\n        public static string RemoveSuffix(this string str, string suffix)\n        {\n            return str.EndsWith(suffix, StringComparison.Ordinal)\n                ? str.Substring(0, str.Length - suffix.Length)\n                : str;\n        }\n\n        public static string ContextPrefix(string context)\n        {\n            return context.RemoveSuffix(\"Context\");\n        }\n\n        public static string ContextAware(string contextPrefix)\n        {\n            return contextPrefix.Replace(\".\", string.Empty);\n        }\n\n        public static string ComponentMethodParams(ComponentDeclaration component) =>\n            string.Join(\", \", component.Members.Select(static member => $\"{member.Type} {member.ValidLowerFirstName}\"));\n\n        public static string ComponentMethodArgs(ComponentDeclaration component) =>\n            string.Join(\", \", component.Members.Select(static member => $\"{member.ValidLowerFirstName}\"));\n\n        public static string ComponentValueMethodArgs(ComponentDeclaration component) =>\n            string.Join(\", \", component.Members.Select(static member => $\"component.{member.Name}\"));\n\n        public static string ComponentValueAssignments(ComponentDeclaration component) =>\n            string.Join(\"\\n\", component.Members.Select(static member => $\"        component.{member.Name} = {member.ValidLowerFirstName};\"));\n    }\n}\n"
  },
  {
    "path": "samples/Unity/.editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_size = 4\nindent_style = space\ninsert_final_newline = true\ntab_width = 4\ntrim_trailing_whitespace = true\n\n[*.sln]\nindent_style = tab\n\n[*.csproj]\nindent_size = 2\nij_xml_space_inside_empty_tag = true\n\n[*.DotSettings]\nindent_style = tab\nij_xml_attribute_wrap = off\n\n# [*.cs]\n# entitas_generator.component.cleanup_systems = false\n# entitas_generator.component.component_index = false\n# entitas_generator.component.context_extension = false\n# entitas_generator.component.context_initialization_method = false\n# entitas_generator.component.entity_extension = false\n# entitas_generator.component.entity_index_extension = false\n# entitas_generator.component.events = false\n# entitas_generator.component.event_systems_extension = false\n# entitas_generator.component.matcher = false\n# \n# entitas_generator.context.component_index = false\n# entitas_generator.context.context = false\n# entitas_generator.context.entity = false\n# entitas_generator.context.matcher = false\n"
  },
  {
    "path": "samples/Unity/Assets/Plugins.meta",
    "content": "fileFormatVersion: 2\nguid: 2ce47528879ae462f9e00aef0ce4c26b\nfolderAsset: yes\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Editor/CustomObjectDrawer.cs",
    "content": "﻿using System;\nusing Entitas.Unity.Editor;\nusing UnityEditor;\n\npublic class CustomObjectDrawer : ITypeDrawer, IDefaultInstanceCreator\n{\n    public bool HandlesType(Type type) => type == typeof(MyCustomObject);\n\n    public object CreateDefault(Type type) => new MyCustomObject(\"Default\");\n\n    public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target)\n    {\n        var myObject = (MyCustomObject)value;\n        myObject.Name = EditorGUILayout.TextField(memberName, myObject.Name);\n        return myObject;\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Editor/CustomObjectDrawer.cs.meta",
    "content": "fileFormatVersion: 2\nguid: f139ea7f89bfd430ca7ae4bdf876b48d\ntimeCreated: 1487547487\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Editor/PersonComponentDrawer.cs",
    "content": "using System;\nusing Entitas;\nusing Entitas.Unity.Editor;\nusing UnityEditor;\n\npublic class PersonComponentDrawer : IComponentDrawer\n{\n    public bool HandlesType(Type type) => type == typeof(MyPersonComponent);\n\n    public IComponent DrawComponent(IComponent component)\n    {\n        var person = (MyPersonComponent)component;\n        person.Name = EditorGUILayout.TextField(\"Name\", person.Name);\n        person.Gender ??= PersonGender.Male.ToString();\n\n        var gender = (PersonGender)Enum.Parse(typeof(PersonGender), person.Gender);\n        gender = (PersonGender)EditorGUILayout.EnumPopup(\"Gender\", gender);\n        person.Gender = gender.ToString();\n\n        return person;\n    }\n\n    enum PersonGender\n    {\n        Male,\n        Female\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Editor/PersonComponentDrawer.cs.meta",
    "content": "fileFormatVersion: 2\nguid: be7914664e5264280ac6c734caa48785\ntimeCreated: 1460665985\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Editor.meta",
    "content": "fileFormatVersion: 2\nguid: d0d330747609f469d9222aaca8596864\nfolderAsset: yes\ntimeCreated: 1455739666\nlicenseType: Pro\nDefaultImporter:\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyArray2DComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyArray2DComponent : IComponent\n{\n    public string[,] Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyArray2DComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: f31e6e9c6ad04f4b92f11a0a2e0ca9b6\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyArray3DComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyArray3DComponent : IComponent\n{\n    public string[,,] Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyArray3DComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: d616f6566f1f471cbbc373c057650786\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyArrayComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyArrayComponent : IComponent\n{\n    public string[] Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyArrayComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: a4fc4922dfd4d490db56d6180cd6436b\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyCharComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyCharComponent : IComponent\n{\n    public char Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyCharComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 3b77b0155ae246a4b0a585ff0ef3a153\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyCustomObjectComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyCustomObjectComponent : IComponent\n{\n    public MyCustomObject Value;\n}\n\npublic class MyCustomObject\n{\n    public string Name;\n\n    public MyCustomObject(string name)\n    {\n        Name = name;\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyCustomObjectComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: eecc2a73ca63436485acaf861665bf71\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyDateTimeComponent.cs",
    "content": "using System;\nusing Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyDateTimeComponent : IComponent\n{\n    public DateTime Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyDateTimeComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: d00ba15066ed4ae89571832b1702c7fb\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyDictArrayComponent.cs",
    "content": "using System.Collections.Generic;\nusing Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyDictArrayComponent : IComponent\n{\n    public Dictionary<int, string[]> Dict;\n    public Dictionary<int, string[]>[] DictArray;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyDictArrayComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 244ce0249a4241ef98ecb6a50e3403cd\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyDictionaryComponent.cs",
    "content": "using System.Collections.Generic;\nusing Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyDictionaryComponent : IComponent\n{\n    public Dictionary<string, string> Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyDictionaryComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 8d1bfafeb2824ce3ad3f77528ebf1e9b\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyDontDrawComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing Entitas.Unity;\n\n[Context(typeof(GameContext)), DontDrawComponent]\npublic sealed class MyDontDrawComponent : IComponent\n{\n    public MySimpleObject Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyDontDrawComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 9de382a297974f668bf96f81d0322aec\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyFlagComponent.cs",
    "content": "﻿using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyFlagComponent : IComponent { }\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyFlagComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: ffc162171ca324d40985306053b0bc26\ntimeCreated: 1455739666\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyHashSetComponent.cs",
    "content": "using System.Collections.Generic;\nusing Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyHashSetComponent : IComponent\n{\n    public HashSet<string> Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyHashSetComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 86b49e56cb2c45b19c2e1e71e79e4969\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyJaggedArrayComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyJaggedArrayComponent : IComponent\n{\n    public string[][] Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyJaggedArrayComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 441ea2d1ab54433f8f478b274b5895ff\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyListArrayComponent.cs",
    "content": "using System.Collections.Generic;\nusing Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyListArrayComponent : IComponent\n{\n    public List<string>[] Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyListArrayComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: b58f3f34a6f34172bc4c93fed2a79b18\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyListComponent.cs",
    "content": "using System.Collections.Generic;\nusing Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyListComponent : IComponent\n{\n    public List<string> Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyListComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: eaaacc8162f64d25b71d157ba61d15ce\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyMemberListComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyMemberListComponent : IComponent\n{\n    public string Field1;\n    public string Field2;\n    public string Field3;\n    public string Field4;\n    public string Field5;\n    public string Field6;\n    public string Field7;\n    public string Field8;\n    public string Field9;\n    public string Field10;\n    public string Field11;\n    public string Field12;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyMemberListComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: e189a338eb33432d8209e890900c8271\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyMonoBehaviourSubClassComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing UnityEngine;\n\n[Context(typeof(GameContext))]\npublic sealed class MyMonoBehaviourSubClassComponent : IComponent\n{\n    public MyMonoBehaviourSubClass Value;\n}\n\npublic class MyMonoBehaviourSubClass : MonoBehaviour { }\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyMonoBehaviourSubClassComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: e95c61aa3b494c1f8f289c1be247369a\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyPersonComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyPersonComponent : IComponent\n{\n    public string Name;\n    public string Gender;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyPersonComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: a7251cf074c2417d9ab628ebc39842cc\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyPropertyComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyPropertyComponent : IComponent\n{\n    public string Value { get; set; }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyPropertyComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: cc2f53ac7164424ab6219efff219eef2\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MySimpleObjectComponent.cs",
    "content": "using System.Collections.Generic;\nusing Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MySimpleObjectComponent : IComponent\n{\n    public MySimpleObject Value;\n}\n\npublic class MySimpleObject\n{\n    public string Name;\n    public int Age;\n    public Dictionary<string, string> Data;\n    public MyCustomObject MyCustomObject;\n    public MySimpleObject Next;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MySimpleObjectComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 55948d11b3424ecd81ec848e2b893a33\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MySystemObjectComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MySystemObjectComponent : IComponent\n{\n    public System.Object Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MySystemObjectComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: c7d9ee97b0ad4688a2ce1b1b88d1e047\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyUniqueComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext)), Unique]\npublic sealed class MyUniqueComponent : IComponent\n{\n    public string Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyUniqueComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 33368b26a3264a8e8db86b4299e8d7e1\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyUnsupportedObjectComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyUnsupportedObjectComponent : IComponent\n{\n    public UnsupportedObject Value;\n}\n\npublic class UnsupportedObject\n{\n    public string Value;\n\n    public UnsupportedObject(string value)\n    {\n        Value = value;\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/MyUnsupportedObjectComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 97beb1b2da064350968b5eb8d89e386d\ntimeCreated: 1667936395"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyAnimationCurveComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing UnityEngine;\n\n[Context(typeof(GameContext))]\npublic sealed class MyAnimationCurveComponent : IComponent\n{\n    public AnimationCurve Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyAnimationCurveComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: cd6ffe73cc91487da0205160330a0203\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyBoolComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyBoolComponent : IComponent\n{\n    public bool Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyBoolComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 6114f99c89284d02bba2818f93d4b488\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyBoundsComponent.cs",
    "content": "﻿using Entitas;\nusing Entitas.Generators.Attributes;\nusing UnityEngine;\n\n[Context(typeof(GameContext))]\npublic sealed class MyBoundsComponent : IComponent\n{\n    public Bounds Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyBoundsComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 607c2d9959a6e4db58ece12f4d320a0f\ntimeCreated: 1455739666\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyColorComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing UnityEngine;\n\n[Context(typeof(GameContext))]\npublic sealed class MyColorComponent : IComponent\n{\n    public Color Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyColorComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: de957506614f4d9fb03ea4b5267ca0bc\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyDoubleComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyDoubleComponent : IComponent\n{\n    public double Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyDoubleComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: ae6e38e9a97b44d5b79250a7a84d4c83\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyEnumComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyEnumComponent : IComponent\n{\n    public MyEnum Value;\n}\n\npublic enum MyEnum\n{\n    Item1,\n    Item2,\n    Item3\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyEnumComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 13ec734e954d45daa3feb3293b4d4e02\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyFlagsComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyFlagsComponent : IComponent\n{\n    public MyFlags Value;\n}\n\n[System.Flags]\npublic enum MyFlags\n{\n    Item1 = 1,\n    Item2 = 2,\n    Item3 = 4,\n    Item4 = 8\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyFlagsComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 7eca5917c1e943029dca756272db5679\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyFloatComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyFloatComponent : IComponent\n{\n    public float Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyFloatComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 614252080b7d4a03b49a0ed5d2e1682d\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyGameObjectComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing UnityEngine;\n\n[Context(typeof(GameContext))]\npublic sealed class MyGameObjectComponent : IComponent\n{\n    public GameObject Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyGameObjectComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 67a47ddd017646da9db95a6c52a7bbd5\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyIntComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext))]\npublic sealed class MyIntComponent : IComponent\n{\n    public int Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyIntComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 38b3229004104b9aa19c34de5ee2812a\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyRectComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing UnityEngine;\n\n[Context(typeof(GameContext))]\npublic sealed class MyRectComponent : IComponent\n{\n    public Rect Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyRectComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 314993c54360444ebd3ac933a667f11a\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyStringComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext)), Context(typeof(InputContext))]\npublic sealed class MyStringComponent : IComponent\n{\n    public string Value;\n\n    public override string ToString() => $\"MyString({Value})\";\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyStringComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: b4c6e703065242cc95c2c2917ecb9c42\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyTexture2DComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing UnityEngine;\n\n[Context(typeof(GameContext))]\npublic sealed class MyTexture2DComponent : IComponent\n{\n    public Texture2D Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyTexture2DComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: ee9f3e8394d44a99867d24b55aa3e4f4\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyTextureComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing UnityEngine;\n\n[Context(typeof(GameContext))]\npublic sealed class MyTextureComponent : IComponent\n{\n    public Texture Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyTextureComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: c4cdcbb081214b9d9b2b086ecd49f209\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyUnityObjectComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing UnityEngine;\n\n[Context(typeof(GameContext))]\npublic sealed class MyUnityObjectComponent : IComponent\n{\n    public Object Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyUnityObjectComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: d0cfe10a31f443a580841ff640c31a00\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyVector2Component.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing UnityEngine;\n\n[Context(typeof(GameContext))]\npublic sealed class MyVector2Component : IComponent\n{\n    public Vector2 Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyVector2Component.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 4f7d2cc8dac94298abcf672906c17cf7\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyVector3Component.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing UnityEngine;\n\n[Context(typeof(GameContext))]\npublic sealed class MyVector3Component : IComponent\n{\n    public Vector3 Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyVector3Component.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 5df4c97495d94a75ab8ab1a5f1ccef46\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyVector4Component.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing UnityEngine;\n\n[Context(typeof(GameContext))]\npublic sealed class MyVector4Component : IComponent\n{\n    public Vector4 Value;\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes/MyVector4Component.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 3ef196888c544a12b34f68e104a3af96\ntimeCreated: 1667936720"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components/UnityBuiltInTypes.meta",
    "content": "fileFormatVersion: 2\nguid: fc42c211fea84a67a0ed15d5d9a3cb8b\ntimeCreated: 1667936693"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components Scene.unity",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!29 &1\nOcclusionCullingSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 2\n  m_OcclusionBakeSettings:\n    smallestOccluder: 5\n    smallestHole: 0.25\n    backfaceThreshold: 100\n  m_SceneGUID: 00000000000000000000000000000000\n  m_OcclusionCullingData: {fileID: 0}\n--- !u!104 &2\nRenderSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 9\n  m_Fog: 0\n  m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}\n  m_FogMode: 3\n  m_FogDensity: 0.01\n  m_LinearFogStart: 0\n  m_LinearFogEnd: 300\n  m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}\n  m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}\n  m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}\n  m_AmbientIntensity: 1\n  m_AmbientMode: 3\n  m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}\n  m_SkyboxMaterial: {fileID: 0}\n  m_HaloStrength: 0.5\n  m_FlareStrength: 1\n  m_FlareFadeSpeed: 3\n  m_HaloTexture: {fileID: 0}\n  m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}\n  m_DefaultReflectionMode: 0\n  m_DefaultReflectionResolution: 128\n  m_ReflectionBounces: 1\n  m_ReflectionIntensity: 1\n  m_CustomReflection: {fileID: 0}\n  m_Sun: {fileID: 0}\n  m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}\n  m_UseRadianceAmbientProbe: 0\n--- !u!157 &4\nLightmapSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 12\n  m_GIWorkflowMode: 1\n  m_GISettings:\n    serializedVersion: 2\n    m_BounceScale: 1\n    m_IndirectOutputScale: 1\n    m_AlbedoBoost: 1\n    m_EnvironmentLightingMode: 0\n    m_EnableBakedLightmaps: 1\n    m_EnableRealtimeLightmaps: 0\n  m_LightmapEditorSettings:\n    serializedVersion: 12\n    m_Resolution: 1\n    m_BakeResolution: 50\n    m_AtlasSize: 1024\n    m_AO: 0\n    m_AOMaxDistance: 1\n    m_CompAOExponent: 0\n    m_CompAOExponentDirect: 0\n    m_ExtractAmbientOcclusion: 0\n    m_Padding: 2\n    m_LightmapParameters: {fileID: 0}\n    m_LightmapsBakeMode: 1\n    m_TextureCompression: 0\n    m_FinalGather: 0\n    m_FinalGatherFiltering: 1\n    m_FinalGatherRayCount: 1024\n    m_ReflectionCompression: 2\n    m_MixedBakeMode: 1\n    m_BakeBackend: 0\n    m_PVRSampling: 1\n    m_PVRDirectSampleCount: 32\n    m_PVRSampleCount: 500\n    m_PVRBounces: 2\n    m_PVREnvironmentSampleCount: 500\n    m_PVREnvironmentReferencePointCount: 2048\n    m_PVRFilteringMode: 2\n    m_PVRDenoiserTypeDirect: 0\n    m_PVRDenoiserTypeIndirect: 0\n    m_PVRDenoiserTypeAO: 0\n    m_PVRFilterTypeDirect: 0\n    m_PVRFilterTypeIndirect: 0\n    m_PVRFilterTypeAO: 0\n    m_PVREnvironmentMIS: 0\n    m_PVRCulling: 1\n    m_PVRFilteringGaussRadiusDirect: 1\n    m_PVRFilteringGaussRadiusIndirect: 5\n    m_PVRFilteringGaussRadiusAO: 2\n    m_PVRFilteringAtrousPositionSigmaDirect: 0.5\n    m_PVRFilteringAtrousPositionSigmaIndirect: 2\n    m_PVRFilteringAtrousPositionSigmaAO: 1\n    m_ExportTrainingData: 0\n    m_TrainingDataDestination: TrainingData\n    m_LightProbeSampleCountMultiplier: 4\n  m_LightingDataAsset: {fileID: 0}\n  m_LightingSettings: {fileID: 4890085278179872738, guid: 9af8a2892cbe14f82a27a743174607e3, type: 2}\n--- !u!196 &5\nNavMeshSettings:\n  serializedVersion: 2\n  m_ObjectHideFlags: 0\n  m_BuildSettings:\n    serializedVersion: 2\n    agentTypeID: 0\n    agentRadius: 0.5\n    agentHeight: 2\n    agentSlope: 45\n    agentClimb: 0.4\n    ledgeDropHeight: 0\n    maxJumpAcrossDistance: 0\n    minRegionArea: 2\n    manualCellSize: 0\n    cellSize: 0.16666666\n    manualTileSize: 0\n    tileSize: 256\n    accuratePlacement: 0\n    maxJobWorkers: 0\n    preserveTilesOutsideBounds: 0\n    debug:\n      m_Flags: 0\n  m_NavMeshData: {fileID: 0}\n--- !u!1 &1782340940\nGameObject:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  serializedVersion: 6\n  m_Component:\n  - component: {fileID: 1782340942}\n  - component: {fileID: 1782340941}\n  m_Layer: 0\n  m_Name: Controller\n  m_TagString: Untagged\n  m_Icon: {fileID: 0}\n  m_NavMeshLayer: 0\n  m_StaticEditorFlags: 0\n  m_IsActive: 1\n--- !u!114 &1782340941\nMonoBehaviour:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  m_GameObject: {fileID: 1782340940}\n  m_Enabled: 1\n  m_EditorHideFlags: 0\n  m_Script: {fileID: 11500000, guid: b7a971593563c452781677abaf62f41b, type: 3}\n  m_Name: \n  m_EditorClassIdentifier: \n--- !u!4 &1782340942\nTransform:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  m_GameObject: {fileID: 1782340940}\n  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}\n  m_LocalPosition: {x: 0, y: 0, z: 0}\n  m_LocalScale: {x: 1, y: 1, z: 1}\n  m_ConstrainProportionsScale: 0\n  m_Children: []\n  m_Father: {fileID: 0}\n  m_RootOrder: 0\n  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components Scene.unity.meta",
    "content": "fileFormatVersion: 2\nguid: 8646dd6b1da3a4568b60fe085252f2bf\ntimeCreated: 1455739666\nlicenseType: Pro\nDefaultImporter:\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Components.meta",
    "content": "fileFormatVersion: 2\nguid: 713b02e4749e4da889797530373f60e3\ntimeCreated: 1667936307"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/ComponentsController.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing Entitas.Unity;\nusing UnityEngine;\nusing static GameMyGameObjectMatcher;\nusing static GameMyVector3Matcher;\n\npublic class ComponentsController : MonoBehaviour\n{\n    void Start()\n    {\n        ContextInitialization.InitializeAllContexts();\n        var gameContext = new GameContext();\n        gameContext.CreateContextObserver();\n\n        CreateTestGroups(gameContext);\n        CreateTestEntities(gameContext);\n        CreateTestEntityWithNullValues(gameContext);\n        CreateTestEntityError(gameContext);\n    }\n\n    void CreateTestGroups(GameContext context)\n    {\n        context.GetGroup(MyVector3);\n        context.GetGroup(MyGameObject);\n        context.GetGroup(Game.Matcher.AllOf(MyGameObject, MyVector3));\n        context.GetGroup(Game.Matcher.AllOf(MyGameObject, MyVector3));\n    }\n\n    void CreateTestEntities(GameContext context)\n    {\n        for (var i = 0; i < 2; i++)\n        {\n            var entity = context.CreateEntity();\n\n            // Unity's builtIn\n            entity.AddMyAnimationCurve(AnimationCurve.EaseInOut(0f, 0f, 1f, 1f));\n            entity.AddMyBool(true);\n            entity.AddMyBounds(new Bounds());\n            entity.AddMyColor(Color.red);\n            entity.AddMyDouble(4.2f);\n            entity.AddMyEnum(MyEnum.Item2);\n            entity.AddMyFlags(MyFlags.Item2);\n            entity.AddMyFloat(4.2f);\n            entity.AddMyGameObject(new GameObject(\"Player\").Link(entity).gameObject);\n            entity.AddMyInt(42);\n            entity.AddMyRect(new Rect(1f, 2f, 3f, 4f));\n            entity.AddMyString(\"Hello, world!\");\n            entity.AddMyTexture2D(new Texture2D(2, 2));\n            entity.AddMyTexture(new CustomRenderTexture(32, 32));\n            entity.AddMyUnityObject(new UnityEngine.Object());\n            entity.AddMyVector2(new Vector2(1f, 2f));\n            entity.AddMyVector3(new Vector3(1f, 2f, 3f));\n            entity.AddMyVector4(new Vector4(1f, 2f, 3f, 4f));\n\n            // Custom\n            entity.AddMyArray2D(new string[2, 3]);\n            entity.AddMyArray3D(new string[2, 3, 4]);\n            entity.AddMyArray(new[] { \"1\", \"2\", \"3\" });\n            entity.AddMyChar('x');\n            entity.AddMyCustomObject(new MyCustomObject(\"My Custom Object!\"));\n            entity.AddMyDateTime(DateTime.Now);\n            entity.AddMyDictArray(\n                new Dictionary<int, string[]>\n                {\n                    { 1, new[] { \"One\", \"Two\", \"Three\" } },\n                    { 2, new[] { \"Four\", \"Five\", \"Six\" } }\n                },\n                new[]\n                {\n                    new Dictionary<int, string[]>\n                    {\n                        { 1, new[] { \"One\", \"Two\", \"Three\" } },\n                        { 2, new[] { \"Four\", \"Five\", \"Six\" } }\n                    },\n                    new Dictionary<int, string[]>\n                    {\n                        { 3, new[] { \"One\", \"Two\", \"Three\" } },\n                        { 4, new[] { \"Four\", \"Five\", \"Six\" } }\n                    }\n                }\n            );\n            entity.AddMyDictionary(new Dictionary<string, string>\n            {\n                { \"1\", \"One\" },\n                { \"2\", \"Two\" },\n                { \"3\", \"Three\" }\n            });\n            entity.AddMyDontDraw(new MySimpleObject());\n            entity.AddMyFlag();\n            entity.AddMyHashSet(new HashSet<string> { \"1\", \"2\", \"3\" });\n            var jaggedArray = new string[2][];\n            jaggedArray[0] = new[] { \"Entity\", \"Component\", \"System\" };\n            jaggedArray[1] = new[] { \"For\", \"C#\" };\n            entity.AddMyJaggedArray(jaggedArray);\n            entity.AddMyListArray(new[]\n            {\n                new List<string> { \"1\", \"2\", \"3\" },\n                new List<string> { \"One\", \"Two\", \"Three\" }\n            });\n            entity.AddMyList(new List<string> { \"One\", \"Two\", \"Three\" });\n            entity.AddMyMemberList(\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\");\n            entity.AddMyMonoBehaviourSubClass(new GameObject().AddComponent<MyMonoBehaviourSubClass>());\n            entity.AddMyPerson(\"Max\", \"Male\");\n            entity.AddMyProperty(\"My Property!\");\n            entity.AddMySimpleObject(new MySimpleObject());\n            entity.AddMySystemObject(new object());\n            entity.AddMyUnique(\"My Unique!\");\n            entity.AddMyUnsupportedObject(new UnsupportedObject(\"Unsupported Object\"));\n        }\n    }\n\n    void CreateTestEntityWithNullValues(GameContext context)\n    {\n        var entity = context.CreateEntity();\n\n        entity.AddMyAnimationCurve(null);\n        entity.AddMyGameObject(null);\n        entity.AddMyString(null);\n        entity.AddMyTexture2D(null);\n        entity.AddMyTexture(null);\n        entity.AddMyUnityObject(null);\n\n        // Custom\n        entity.AddMyArray2D(null);\n        entity.AddMyArray3D(null);\n        entity.AddMyArray(null);\n        entity.AddMyCustomObject(null);\n        entity.AddMyDictArray(null, null);\n        entity.AddMyDictionary(null);\n        entity.AddMyDontDraw(null);\n        entity.AddMyHashSet(null);\n        entity.AddMyJaggedArray(null);\n        entity.AddMyListArray(null);\n        entity.AddMyList(null);\n        entity.AddMyMemberList(null, null, null, null, null, null, null, null, null, null, null, null);\n        entity.AddMyMonoBehaviourSubClass(null);\n        entity.AddMyPerson(null, null);\n        entity.AddMyProperty(null);\n        entity.AddMySimpleObject(null);\n        entity.AddMySystemObject(null);\n        entity.AddMyUnique(null);\n        entity.AddMyUnsupportedObject(null);\n    }\n\n    void CreateTestEntityError(GameContext context)\n    {\n        var entity = context.CreateEntity();\n        entity.Retain(this);\n        entity.Destroy();\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/ComponentsController.cs.meta",
    "content": "fileFormatVersion: 2\nguid: b7a971593563c452781677abaf62f41b\ntimeCreated: 1455739666\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Contexts/ContextInitialization.cs",
    "content": "using Entitas.Generators.Attributes;\n\npublic static partial class ContextInitialization\n{\n    public static void InitializeAllContexts()\n    {\n        InitializeGameContext();\n        InitializeInputContext();\n    }\n\n    [ContextInitialization(typeof(GameContext))]\n    public static partial void InitializeGameContext();\n\n    [ContextInitialization(typeof(InputContext))]\n    public static partial void InitializeInputContext();\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Contexts/ContextInitialization.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 3de139e489844b6fb5d326d5cfe52aff\ntimeCreated: 1690465874"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Contexts/GameContext.cs",
    "content": "using Entitas;\n\npartial class GameContext : IContext { }\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Contexts/GameContext.cs.meta",
    "content": "fileFormatVersion: 2\nguid: a13516d2b8cd420c8a7613f2f3bc4480\ntimeCreated: 1690465381"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Contexts/InputContext.cs",
    "content": "using Entitas;\n\npartial class InputContext : IContext { }\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Contexts/InputContext.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 87b3133efe3d436eb8e6f77b85622d45\ntimeCreated: 1690465697"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Contexts.meta",
    "content": "fileFormatVersion: 2\nguid: 68d5ad989369407ca8a797a7f2921ff1\ntimeCreated: 1690465858"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/AReactiveSystem.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Threading;\nusing Entitas;\n\npublic class AReactiveSystem : ReactiveSystem<Game.Entity>\n{\n    public AReactiveSystem(GameContext context) : base(context) { }\n\n    protected override ICollector<Game.Entity> GetTrigger(IContext<Game.Entity> context) =>\n        context.CreateCollector(GameMyStringMatcher.MyString);\n\n    protected override bool Filter(Game.Entity entity) => true;\n\n    protected override void Execute(List<Game.Entity> entities)\n    {\n        Thread.Sleep(2);\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/AReactiveSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 8133bd2e30cfc4cd9a1ab205c8b3a288\ntimeCreated: 1432070018\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/CleanupSystem.cs",
    "content": "﻿using Entitas;\n\npublic class CleanupSystem : ICleanupSystem\n{\n    public void Cleanup() { }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/CleanupSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 26667bf2484024d36b5cca1aaf56f8de\ntimeCreated: 1475865147\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/FastSystem.cs",
    "content": "﻿using System.Threading;\nusing Entitas;\n\npublic class FastSystem : IExecuteSystem\n{\n    public void Execute()\n    {\n        Thread.Sleep(1);\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/FastSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 4dbba0f12e8184b3a8ab30d670ca9692\ntimeCreated: 1432070018\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/MixedSystem.cs",
    "content": "﻿using Entitas;\n\npublic class MixedSystem : IInitializeSystem, IExecuteSystem, ICleanupSystem, ITearDownSystem\n{\n    public void Initialize()\n    {\n        //UnityEngine.Debug.Log(\"Initialize\");\n    }\n\n    public void Execute()\n    {\n        //UnityEngine.Debug.Log(\"Execute\");\n    }\n\n    public void Cleanup()\n    {\n        //UnityEngine.Debug.Log(\"Cleanup\");\n    }\n\n    public void TearDown()\n    {\n        //UnityEngine.Debug.Log(\"TearDown\");\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/MixedSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 4ec7357cbe250481ebe3f79876871c99\ntimeCreated: 1475869353\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/ProcessRandomValueSystem.cs",
    "content": "using System.Collections.Generic;\nusing Entitas;\n\npublic class ProcessRandomValueSystem : ReactiveSystem<Game.Entity>\n{\n    public ProcessRandomValueSystem(GameContext context) : base(context) { }\n\n    protected override ICollector<Game.Entity> GetTrigger(IContext<Game.Entity> context) =>\n        context.CreateCollector(GameMyFloatMatcher.MyFloat);\n\n    protected override bool Filter(Game.Entity entity) => true;\n\n    protected override void Execute(List<Game.Entity> entities)\n    {\n        foreach (var entity in entities)\n            entity.Destroy();\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/ProcessRandomValueSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: e29e8e4de9c25452882614e48c0287a3\ntimeCreated: 1437218791\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/RandomDurationSystem.cs",
    "content": "﻿using System.Threading;\nusing UnityEngine;\nusing Entitas;\n\npublic class RandomDurationSystem : IExecuteSystem\n{\n    public void Execute()\n    {\n        Thread.Sleep(Random.Range(0, 9));\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/RandomDurationSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 3d923a0b40aec4c62a883bcf5d32266e\ntimeCreated: 1432152477\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/RandomValueSystem.cs",
    "content": "﻿using Entitas;\nusing UnityEngine;\n\npublic class RandomValueSystem : IExecuteSystem\n{\n    readonly GameContext _context;\n\n    public RandomValueSystem(GameContext context)\n    {\n        _context = context;\n    }\n\n    public void Execute()\n    {\n        _context.CreateEntity().AddMyFloat(Random.value);\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/RandomValueSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 5470c556108894357a24a68dd92da480\ntimeCreated: 1437218791\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SlowInitializeExecuteSystem.cs",
    "content": "﻿using System.Threading;\nusing Entitas;\n\npublic class SlowInitializeExecuteSystem : IInitializeSystem, IExecuteSystem\n{\n    public void Initialize()\n    {\n        Thread.Sleep(10);\n    }\n\n    public void Execute()\n    {\n        Thread.Sleep(5);\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SlowInitializeExecuteSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 651ddcb189b494f1fb48addac219efb9\ntimeCreated: 1439754586\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SlowInitializeSystem.cs",
    "content": "﻿using System.Threading;\nusing Entitas;\n\npublic class SlowInitializeSystem : IInitializeSystem\n{\n    public void Initialize()\n    {\n        Thread.Sleep(30);\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SlowInitializeSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 57c7a0da41d924d80a58d9e78528fbbe\ntimeCreated: 1439754586\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SlowSystem.cs",
    "content": "﻿using System.Threading;\nusing Entitas;\n\npublic class SlowSystem : IExecuteSystem\n{\n    public void Execute()\n    {\n        Thread.Sleep(4);\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SlowSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: ae066f52c9bcc4079a6c20142b5150fa\ntimeCreated: 1432070018\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SomeExecuteSystem.cs",
    "content": "﻿using Entitas;\n\npublic class SomeExecuteSystem : IExecuteSystem\n{\n    public void Execute() { }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SomeExecuteSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 351bfdecb9eef45019db0b774e0b0652\ntimeCreated: 1433409297\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SomeInitializeExecuteSystem.cs",
    "content": "﻿using Entitas;\n\npublic class SomeInitializeExecuteSystem : IInitializeSystem, IExecuteSystem\n{\n    public void Initialize() { }\n\n    public void Execute() { }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SomeInitializeExecuteSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: ebb325d92872b412b8b4da1e47651ca7\ntimeCreated: 1439754586\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SomeInitializeReactiveSystem.cs",
    "content": "﻿using System.Collections.Generic;\nusing Entitas;\n\npublic class SomeInitializeReactiveSystem : ReactiveSystem<Game.Entity>, IInitializeSystem\n{\n    public SomeInitializeReactiveSystem(GameContext context) : base(context) { }\n\n    protected override ICollector<Game.Entity> GetTrigger(IContext<Game.Entity> context) =>\n        context.CreateCollector(Game.Matcher.AllOf(0));\n\n    protected override bool Filter(Game.Entity entity) => true;\n\n    public void Initialize() { }\n\n    protected override void Execute(List<Game.Entity> entities) { }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SomeInitializeReactiveSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 13904dc9959364090bef258311f3183a\ntimeCreated: 1439754586\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SomeInitializeSystem.cs",
    "content": "﻿using Entitas;\n\npublic class SomeInitializeSystem : IInitializeSystem\n{\n    public void Initialize() { }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SomeInitializeSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 27103eba44f8a4d8b927a9bcdaf488a5\ntimeCreated: 1439754586\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SomeReactiveSystem.cs",
    "content": "﻿using System.Collections.Generic;\nusing Entitas;\n\npublic class SomeReactiveSystem : ReactiveSystem<Game.Entity>\n{\n    public SomeReactiveSystem(GameContext context) : base(context) { }\n\n    protected override ICollector<Game.Entity> GetTrigger(IContext<Game.Entity> context) =>\n        context.CreateCollector(Matcher<Game.Entity>.AllOf(0));\n\n    protected override bool Filter(Game.Entity entity) => true;\n\n    protected override void Execute(List<Game.Entity> entities) { }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/SomeReactiveSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 5c67dabd77edc40f1b8a6d30e6b54799\ntimeCreated: 1433409297\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/TearDownSystem.cs",
    "content": "﻿using Entitas;\n\npublic class TearDownSystem : ITearDownSystem\n{\n    public void TearDown()\n    {\n        UnityEngine.Debug.Log(\"TearDown\");\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems/TearDownSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: e9f7d828623b24718b8d95c4ec445697\ntimeCreated: 1475865479\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems Scene.unity",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!29 &1\nOcclusionCullingSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 2\n  m_OcclusionBakeSettings:\n    smallestOccluder: 5\n    smallestHole: 0.25\n    backfaceThreshold: 100\n  m_SceneGUID: 00000000000000000000000000000000\n  m_OcclusionCullingData: {fileID: 0}\n--- !u!104 &2\nRenderSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 9\n  m_Fog: 0\n  m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}\n  m_FogMode: 3\n  m_FogDensity: 0.01\n  m_LinearFogStart: 0\n  m_LinearFogEnd: 300\n  m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}\n  m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}\n  m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}\n  m_AmbientIntensity: 1\n  m_AmbientMode: 3\n  m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}\n  m_SkyboxMaterial: {fileID: 0}\n  m_HaloStrength: 0.5\n  m_FlareStrength: 1\n  m_FlareFadeSpeed: 3\n  m_HaloTexture: {fileID: 0}\n  m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}\n  m_DefaultReflectionMode: 0\n  m_DefaultReflectionResolution: 128\n  m_ReflectionBounces: 1\n  m_ReflectionIntensity: 1\n  m_CustomReflection: {fileID: 0}\n  m_Sun: {fileID: 0}\n  m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}\n  m_UseRadianceAmbientProbe: 0\n--- !u!157 &4\nLightmapSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 12\n  m_GIWorkflowMode: 1\n  m_GISettings:\n    serializedVersion: 2\n    m_BounceScale: 1\n    m_IndirectOutputScale: 1\n    m_AlbedoBoost: 1\n    m_EnvironmentLightingMode: 0\n    m_EnableBakedLightmaps: 1\n    m_EnableRealtimeLightmaps: 0\n  m_LightmapEditorSettings:\n    serializedVersion: 12\n    m_Resolution: 1\n    m_BakeResolution: 50\n    m_AtlasSize: 1024\n    m_AO: 0\n    m_AOMaxDistance: 1\n    m_CompAOExponent: 0\n    m_CompAOExponentDirect: 0\n    m_ExtractAmbientOcclusion: 0\n    m_Padding: 2\n    m_LightmapParameters: {fileID: 0}\n    m_LightmapsBakeMode: 1\n    m_TextureCompression: 0\n    m_FinalGather: 0\n    m_FinalGatherFiltering: 1\n    m_FinalGatherRayCount: 1024\n    m_ReflectionCompression: 2\n    m_MixedBakeMode: 1\n    m_BakeBackend: 0\n    m_PVRSampling: 1\n    m_PVRDirectSampleCount: 32\n    m_PVRSampleCount: 500\n    m_PVRBounces: 2\n    m_PVREnvironmentSampleCount: 500\n    m_PVREnvironmentReferencePointCount: 2048\n    m_PVRFilteringMode: 2\n    m_PVRDenoiserTypeDirect: 0\n    m_PVRDenoiserTypeIndirect: 0\n    m_PVRDenoiserTypeAO: 0\n    m_PVRFilterTypeDirect: 0\n    m_PVRFilterTypeIndirect: 0\n    m_PVRFilterTypeAO: 0\n    m_PVREnvironmentMIS: 0\n    m_PVRCulling: 1\n    m_PVRFilteringGaussRadiusDirect: 1\n    m_PVRFilteringGaussRadiusIndirect: 5\n    m_PVRFilteringGaussRadiusAO: 2\n    m_PVRFilteringAtrousPositionSigmaDirect: 0.5\n    m_PVRFilteringAtrousPositionSigmaIndirect: 2\n    m_PVRFilteringAtrousPositionSigmaAO: 1\n    m_ExportTrainingData: 0\n    m_TrainingDataDestination: TrainingData\n    m_LightProbeSampleCountMultiplier: 4\n  m_LightingDataAsset: {fileID: 0}\n  m_LightingSettings: {fileID: 4890085278179872738, guid: a6827277473d94d43b00d874f23fc554, type: 2}\n--- !u!196 &5\nNavMeshSettings:\n  serializedVersion: 2\n  m_ObjectHideFlags: 0\n  m_BuildSettings:\n    serializedVersion: 2\n    agentTypeID: 0\n    agentRadius: 0.5\n    agentHeight: 2\n    agentSlope: 45\n    agentClimb: 0.4\n    ledgeDropHeight: 0\n    maxJumpAcrossDistance: 0\n    minRegionArea: 2\n    manualCellSize: 0\n    cellSize: 0.16666666\n    manualTileSize: 0\n    tileSize: 256\n    accuratePlacement: 0\n    maxJobWorkers: 0\n    preserveTilesOutsideBounds: 0\n    debug:\n      m_Flags: 0\n  m_NavMeshData: {fileID: 0}\n--- !u!1 &1782340940\nGameObject:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  serializedVersion: 6\n  m_Component:\n  - component: {fileID: 1782340942}\n  - component: {fileID: 1782340943}\n  m_Layer: 0\n  m_Name: Controller\n  m_TagString: Untagged\n  m_Icon: {fileID: 0}\n  m_NavMeshLayer: 0\n  m_StaticEditorFlags: 0\n  m_IsActive: 1\n--- !u!4 &1782340942\nTransform:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  m_GameObject: {fileID: 1782340940}\n  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}\n  m_LocalPosition: {x: 0, y: 0, z: 0}\n  m_LocalScale: {x: 1, y: 1, z: 1}\n  m_ConstrainProportionsScale: 0\n  m_Children: []\n  m_Father: {fileID: 0}\n  m_RootOrder: 0\n  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n--- !u!114 &1782340943\nMonoBehaviour:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  m_GameObject: {fileID: 1782340940}\n  m_Enabled: 1\n  m_EditorHideFlags: 0\n  m_Script: {fileID: 11500000, guid: 673279bc6aa4344039fa3f2674348d6f, type: 3}\n  m_Name: \n  m_EditorClassIdentifier: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems Scene.unity.meta",
    "content": "fileFormatVersion: 2\nguid: e2a9126de78c74296a0da24cc0363b9a\ntimeCreated: 1455739666\nlicenseType: Pro\nDefaultImporter:\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/Systems.meta",
    "content": "fileFormatVersion: 2\nguid: 6b323d75517db4e3ba60b474a4c6c595\nfolderAsset: yes\ntimeCreated: 1455739666\nlicenseType: Pro\nDefaultImporter:\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/SystemsController.cs",
    "content": "using Entitas;\nusing Entitas.Unity;\nusing UnityEngine;\n\npublic class SystemsController : MonoBehaviour\n{\n    GameContext _gameContext;\n    Systems _systems;\n\n    void Start()\n    {\n        ContextInitialization.InitializeAllContexts();\n        _gameContext = new GameContext();\n        _gameContext.CreateContextObserver();\n\n        _systems = CreateNestedSystems();\n        //// Test calls\n        _systems.Initialize();\n        _systems.Execute();\n        _systems.Cleanup();\n        _systems.TearDown();\n\n        _gameContext.CreateEntity().AddMyString(\"\");\n    }\n\n    Systems CreateNestedSystems()\n    {\n        var systems1 = new Feature(\"Nested 1\");\n        var systems2 = new Feature(\"Nested 2\");\n        var systems3 = new Feature(\"Nested 3\");\n\n        systems1.Add(systems2);\n        systems2.Add(systems3);\n        systems1.Add(CreateSomeSystems());\n\n        return new Feature(\"Nested Systems\")\n            .Add(systems1);\n    }\n\n    Systems CreateSomeSystems()\n    {\n        return new SomeSystems(_gameContext);\n    }\n\n    void Update()\n    {\n        _gameContext.GetGroup(GameMyStringMatcher.MyString).GetSingleEntity()\n            .ReplaceMyString(Random.value.ToString());\n\n        _systems.Execute();\n        _systems.Cleanup();\n    }\n\n    Systems CreateAllSystemCombinations()\n    {\n        return new Feature(\"All System Combinations\")\n            .Add(new SomeInitializeSystem())\n            .Add(new SomeExecuteSystem())\n            .Add(new SomeReactiveSystem(_gameContext))\n            .Add(new SomeInitializeExecuteSystem())\n            .Add(new SomeInitializeReactiveSystem(_gameContext));\n    }\n\n    Systems CreateSubSystems()\n    {\n        var allSystems = CreateAllSystemCombinations();\n        var subSystems = new Feature(\"Sub Systems\").Add(allSystems);\n        return new Feature(\"Systems with SubSystems\")\n            .Add(allSystems)\n            .Add(allSystems)\n            .Add(subSystems)\n            .Add(subSystems);\n    }\n\n    Systems CreateSameInstance()\n    {\n        var system = new RandomDurationSystem();\n        return new Feature(\"Same System Instances\")\n            .Add(system)\n            .Add(system)\n            .Add(system);\n    }\n\n    Systems CreateEmptySystems()\n    {\n        var systems1 = new Feature(\"Empty 1\");\n        var systems2 = new Feature(\"Empty 2\");\n        var systems3 = new Feature(\"Empty 3\");\n\n        systems1.Add(systems2);\n        systems2.Add(systems3);\n\n        return new Feature(\"Empty Systems\")\n            .Add(systems1);\n    }\n\n    sealed class SomeSystems : Feature\n    {\n        public SomeSystems(GameContext gameContext)\n        {\n            Add(new SlowInitializeSystem());\n            Add(new SlowInitializeExecuteSystem());\n            Add(new FastSystem());\n            Add(new SlowSystem());\n            Add(new RandomDurationSystem());\n            Add(new AReactiveSystem(gameContext));\n\n            Add(new RandomValueSystem(gameContext));\n            Add(new ProcessRandomValueSystem(gameContext));\n            Add(new CleanupSystem());\n            Add(new TearDownSystem());\n            Add(new MixedSystem());\n        }\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime/SystemsController.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 673279bc6aa4344039fa3f2674348d6f\ntimeCreated: 1455739666\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Runtime.meta",
    "content": "fileFormatVersion: 2\nguid: 48b3b593753ab4ac48e8623ed018ed73\nfolderAsset: yes\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Editor/Tests/ContextTests.cs",
    "content": "using System.Linq;\nusing NUnit.Framework;\nusing Entitas;\n\n[TestFixture]\nclass ContextTests\n{\n    [Test]\n    public void EnsuresSameDeterministicOrderWhenGettingEntitiesAfterDestroyAllEntities()\n    {\n        ContextInitialization.InitializeAllContexts();\n        var gameContext = new Context<Entity>(1, () => new Game.Entity());\n\n        const int numEntities = 10;\n\n        for (var i = 0; i < numEntities; i++)\n            gameContext.CreateEntity();\n\n        var order1 = gameContext.GetEntities().Select(entity => entity.Id).ToArray();\n\n        gameContext.Reset();\n\n        for (var i = 0; i < numEntities; i++)\n            gameContext.CreateEntity();\n\n        var order2 = gameContext.GetEntities().Select(entity => entity.Id).ToArray();\n\n        for (var i = 0; i < numEntities; i++)\n        {\n            var index1 = order1[i];\n            var index2 = order2[i];\n\n            Assert.AreEqual(index1, index2);\n        }\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Editor/Tests/ContextTests.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 640477ba833484d4b9ca68074efa0c9a\ntimeCreated: 1483966795\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Editor/Tests/EntityLinkTests.cs",
    "content": "﻿using System;\nusing Entitas;\nusing Entitas.Unity;\nusing NUnit.Framework;\nusing UnityEngine;\n\npublic class EntityLinkTests\n{\n    GameContext _context;\n    Entity _entity;\n    GameObject _gameObject;\n    EntityLink _link;\n\n    [SetUp]\n    public void BeforeEach()\n    {\n        ContextInitialization.InitializeAllContexts();\n        _context = new GameContext();\n        _context.CreateContextObserver();\n        _entity = _context.CreateEntity();\n        _gameObject = new GameObject(\"TestGameObject\");\n        _link = _gameObject.AddComponent<EntityLink>();\n    }\n\n    [Test]\n    public void LinksEntityAndContextAndRetainsEntity()\n    {\n        var retainCount = _entity.RetainCount;\n        _link.Link(_entity);\n        Assert.AreSame(_entity, _link.Entity);\n        Assert.AreEqual(retainCount + 1, _entity.RetainCount);\n#if !ENTITAS_FAST_AND_UNSAFE\n        Assert.IsTrue(((SafeAERC)_entity.Aerc).Owners.Contains(_link));\n#endif\n    }\n\n    [Test]\n    public void ThrowsWhenAlreadyLinked()\n    {\n        Assert.Throws(typeof(Exception), () =>\n        {\n            _link.Link(_entity);\n            _link.Link(_entity);\n        });\n    }\n\n    [Test]\n    public void UnlinksEntityReleasesEntity()\n    {\n        _link.Link(_entity);\n        var retainCount = _entity.RetainCount;\n        _link.Unlink();\n        Assert.AreEqual(retainCount - 1, _entity.RetainCount);\n        Assert.IsNull(_link.Entity);\n#if !ENTITAS_FAST_AND_UNSAFE\n        Assert.IsFalse(((SafeAERC)_entity.Aerc).Owners.Contains(_link));\n#endif\n    }\n\n    [Test]\n    public void ThrowsWhenAlreadyUnlinked()\n    {\n        Assert.Throws(typeof(Exception), () => _link.Unlink());\n    }\n\n    [Test]\n    public void GetSameEntityLink()\n    {\n        Assert.AreSame(_link, _gameObject.GetEntityLink());\n    }\n\n    [Test]\n    public void AddsEntityLinkAndLinks()\n    {\n        var gameObject = new GameObject();\n        var retainCount = _entity.RetainCount;\n        var link = gameObject.Link(_entity);\n        Assert.AreSame(link, gameObject.GetEntityLink());\n        Assert.AreSame(_entity, link.Entity);\n        Assert.AreEqual(retainCount + 1, _entity.RetainCount);\n    }\n\n    [Test]\n    public void Unlinks()\n    {\n        var gameObject = new GameObject();\n        var link = gameObject.Link(_entity);\n        var retainCount = _entity.RetainCount;\n        gameObject.Unlink();\n        Assert.AreSame(link, gameObject.GetEntityLink());\n        Assert.AreEqual(retainCount - 1, _entity.RetainCount);\n        Assert.IsNull(link.Entity);\n    }\n\n    [Test]\n    public void ReusesLink()\n    {\n        var gameObject = new GameObject();\n        var link1 = gameObject.Link(_context.CreateEntity());\n        gameObject.Unlink();\n        var link2 = gameObject.Link(_entity);\n        Assert.AreEqual(1, gameObject.GetComponents<EntityLink>().Length);\n        Assert.AreSame(link1, link2);\n        Assert.AreSame(_entity, link2.Entity);\n    }\n\n    [Test]\n    public void CanToString()\n    {\n        Assert.AreEqual(\"EntityLink(TestGameObject)\", _link.ToString());\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Editor/Tests/EntityLinkTests.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 56872c04364084e3c9fdd237e9f388c4\ntimeCreated: 1486169352\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Editor/Tests.meta",
    "content": "fileFormatVersion: 2\nguid: 99230376fec554ead9805e15092fc6a8\nfolderAsset: yes\ntimeCreated: 1450119188\nlicenseType: Pro\nDefaultImporter:\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Editor.meta",
    "content": "fileFormatVersion: 2\nguid: 24957586ae4bc4cc383f088a35ff09de\nfolderAsset: yes\ntimeCreated: 1455740206\nlicenseType: Pro\nDefaultImporter:\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Collector Destructor/Collector Destructor.unity",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!29 &1\nSceneSettings:\n  m_ObjectHideFlags: 0\n  m_PVSData: \n  m_PVSObjectsArray: []\n  m_PVSPortalsArray: []\n  m_OcclusionBakeSettings:\n    smallestOccluder: 5\n    smallestHole: 0.25\n    backfaceThreshold: 100\n--- !u!104 &2\nRenderSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 6\n  m_Fog: 0\n  m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}\n  m_FogMode: 3\n  m_FogDensity: 0.01\n  m_LinearFogStart: 0\n  m_LinearFogEnd: 300\n  m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}\n  m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}\n  m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}\n  m_AmbientIntensity: 1\n  m_AmbientMode: 0\n  m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}\n  m_HaloStrength: 0.5\n  m_FlareStrength: 1\n  m_FlareFadeSpeed: 3\n  m_HaloTexture: {fileID: 0}\n  m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}\n  m_DefaultReflectionMode: 0\n  m_DefaultReflectionResolution: 128\n  m_ReflectionBounces: 1\n  m_ReflectionIntensity: 1\n  m_CustomReflection: {fileID: 0}\n  m_Sun: {fileID: 0}\n--- !u!157 &3\nLightmapSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 6\n  m_GIWorkflowMode: 0\n  m_LightmapsMode: 1\n  m_GISettings:\n    serializedVersion: 2\n    m_BounceScale: 1\n    m_IndirectOutputScale: 1\n    m_AlbedoBoost: 1\n    m_TemporalCoherenceThreshold: 1\n    m_EnvironmentLightingMode: 0\n    m_EnableBakedLightmaps: 1\n    m_EnableRealtimeLightmaps: 1\n  m_LightmapEditorSettings:\n    serializedVersion: 3\n    m_Resolution: 2\n    m_BakeResolution: 40\n    m_TextureWidth: 1024\n    m_TextureHeight: 1024\n    m_AOMaxDistance: 1\n    m_Padding: 2\n    m_CompAOExponent: 0\n    m_LightmapParameters: {fileID: 0}\n    m_TextureCompression: 1\n    m_FinalGather: 0\n    m_FinalGatherRayCount: 1024\n    m_ReflectionCompression: 2\n  m_LightingDataAsset: {fileID: 0}\n  m_RuntimeCPUUsage: 25\n--- !u!196 &4\nNavMeshSettings:\n  serializedVersion: 2\n  m_ObjectHideFlags: 0\n  m_BuildSettings:\n    serializedVersion: 2\n    agentRadius: 0.5\n    agentHeight: 2\n    agentSlope: 45\n    agentClimb: 0.4\n    ledgeDropHeight: 0\n    maxJumpAcrossDistance: 0\n    accuratePlacement: 0\n    minRegionArea: 2\n    cellSize: 0.16666667\n    manualCellSize: 0\n  m_NavMeshData: {fileID: 0}\n--- !u!1 &1576095025\nGameObject:\n  m_ObjectHideFlags: 0\n  m_PrefabParentObject: {fileID: 0}\n  m_PrefabInternal: {fileID: 0}\n  serializedVersion: 4\n  m_Component:\n  - 4: {fileID: 1576095027}\n  - 114: {fileID: 1576095026}\n  m_Layer: 0\n  m_Name: Controller\n  m_TagString: Untagged\n  m_Icon: {fileID: 0}\n  m_NavMeshLayer: 0\n  m_StaticEditorFlags: 0\n  m_IsActive: 1\n--- !u!114 &1576095026\nMonoBehaviour:\n  m_ObjectHideFlags: 0\n  m_PrefabParentObject: {fileID: 0}\n  m_PrefabInternal: {fileID: 0}\n  m_GameObject: {fileID: 1576095025}\n  m_Enabled: 1\n  m_EditorHideFlags: 0\n  m_Script: {fileID: 11500000, guid: 10fd605a7d77b4db381962061246c923, type: 3}\n  m_Name: \n  m_EditorClassIdentifier: \n--- !u!4 &1576095027\nTransform:\n  m_ObjectHideFlags: 0\n  m_PrefabParentObject: {fileID: 0}\n  m_PrefabInternal: {fileID: 0}\n  m_GameObject: {fileID: 1576095025}\n  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}\n  m_LocalPosition: {x: 0, y: 0, z: 0}\n  m_LocalScale: {x: 1, y: 1, z: 1}\n  m_Children: []\n  m_Father: {fileID: 0}\n  m_RootOrder: 0\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Collector Destructor/Collector Destructor.unity.meta",
    "content": "fileFormatVersion: 2\nguid: 2bcfbecd3f0a64750a3d8f54424d44fe\ntimeCreated: 1454970059\nlicenseType: Pro\nDefaultImporter:\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Collector Destructor/CollectorDestructorController.cs",
    "content": "using UnityEngine;\nusing Entitas;\nusing Entitas.Unity;\nusing UnityEditor;\n\npublic class CollectorDestructorController : MonoBehaviour\n{\n    GameContext _gameContext;\n    Game.Entity _initialEntity;\n\n    void Start()\n    {\n        ContextInitialization.InitializeAllContexts();\n        _gameContext = new GameContext();\n        _gameContext.CreateContextObserver();\n        _gameContext.GetGroup(GameTestMatcher.Test).CreateCollector();\n        _initialEntity = _gameContext.CreateEntity();\n        _initialEntity.AddTest();\n        _initialEntity.Destroy();\n        // TODO\n        // context.ClearGroups();\n    }\n\n    void Update()\n    {\n        for (var i = 0; i < 5000; i++)\n        {\n            var entity = _gameContext.CreateEntity();\n            if (entity == _initialEntity)\n            {\n                Debug.Log(\"Reusing entity!\");\n                EditorApplication.isPlaying = false;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Collector Destructor/CollectorDestructorController.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 10fd605a7d77b4db381962061246c923\ntimeCreated: 1454970059\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Collector Destructor.meta",
    "content": "fileFormatVersion: 2\nguid: 5a4cd696ee62a4922a0f739f7afaa6fb\nfolderAsset: yes\ntimeCreated: 1454970059\nlicenseType: Pro\nDefaultImporter:\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Entity Stress Test/Entity Stress Test Scene.unity",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!29 &1\nOcclusionCullingSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 2\n  m_OcclusionBakeSettings:\n    smallestOccluder: 5\n    smallestHole: 0.25\n    backfaceThreshold: 100\n  m_SceneGUID: 00000000000000000000000000000000\n  m_OcclusionCullingData: {fileID: 0}\n--- !u!104 &2\nRenderSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 9\n  m_Fog: 0\n  m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}\n  m_FogMode: 3\n  m_FogDensity: 0.01\n  m_LinearFogStart: 0\n  m_LinearFogEnd: 300\n  m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}\n  m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}\n  m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}\n  m_AmbientIntensity: 1\n  m_AmbientMode: 0\n  m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}\n  m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}\n  m_HaloStrength: 0.5\n  m_FlareStrength: 1\n  m_FlareFadeSpeed: 3\n  m_HaloTexture: {fileID: 0}\n  m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}\n  m_DefaultReflectionMode: 0\n  m_DefaultReflectionResolution: 128\n  m_ReflectionBounces: 1\n  m_ReflectionIntensity: 1\n  m_CustomReflection: {fileID: 0}\n  m_Sun: {fileID: 0}\n  m_IndirectSpecularColor: {r: 0.3731196, g: 0.38074002, b: 0.35872707, a: 1}\n  m_UseRadianceAmbientProbe: 0\n--- !u!157 &3\nLightmapSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 11\n  m_GIWorkflowMode: 0\n  m_GISettings:\n    serializedVersion: 2\n    m_BounceScale: 1\n    m_IndirectOutputScale: 1\n    m_AlbedoBoost: 1\n    m_TemporalCoherenceThreshold: 1\n    m_EnvironmentLightingMode: 0\n    m_EnableBakedLightmaps: 1\n    m_EnableRealtimeLightmaps: 1\n  m_LightmapEditorSettings:\n    serializedVersion: 10\n    m_Resolution: 2\n    m_BakeResolution: 40\n    m_AtlasSize: 1024\n    m_AO: 0\n    m_AOMaxDistance: 1\n    m_CompAOExponent: 1\n    m_CompAOExponentDirect: 0\n    m_Padding: 2\n    m_LightmapParameters: {fileID: 0}\n    m_LightmapsBakeMode: 1\n    m_TextureCompression: 1\n    m_FinalGather: 0\n    m_FinalGatherFiltering: 1\n    m_FinalGatherRayCount: 256\n    m_ReflectionCompression: 2\n    m_MixedBakeMode: 2\n    m_BakeBackend: 1\n    m_PVRSampling: 1\n    m_PVRDirectSampleCount: 32\n    m_PVRSampleCount: 500\n    m_PVRBounces: 2\n    m_PVRFilterTypeDirect: 0\n    m_PVRFilterTypeIndirect: 0\n    m_PVRFilterTypeAO: 0\n    m_PVRFilteringMode: 1\n    m_PVRCulling: 1\n    m_PVRFilteringGaussRadiusDirect: 1\n    m_PVRFilteringGaussRadiusIndirect: 5\n    m_PVRFilteringGaussRadiusAO: 2\n    m_PVRFilteringAtrousPositionSigmaDirect: 0.5\n    m_PVRFilteringAtrousPositionSigmaIndirect: 2\n    m_PVRFilteringAtrousPositionSigmaAO: 1\n    m_ShowResolutionOverlay: 1\n  m_LightingDataAsset: {fileID: 0}\n  m_UseShadowmask: 1\n--- !u!196 &4\nNavMeshSettings:\n  serializedVersion: 2\n  m_ObjectHideFlags: 0\n  m_BuildSettings:\n    serializedVersion: 2\n    agentTypeID: 0\n    agentRadius: 0.5\n    agentHeight: 2\n    agentSlope: 45\n    agentClimb: 0.4\n    ledgeDropHeight: 0\n    maxJumpAcrossDistance: 0\n    minRegionArea: 2\n    manualCellSize: 0\n    cellSize: 0.16666667\n    manualTileSize: 0\n    tileSize: 256\n    accuratePlacement: 0\n    debug:\n      m_Flags: 0\n  m_NavMeshData: {fileID: 0}\n--- !u!1 &619302619\nGameObject:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInternal: {fileID: 0}\n  serializedVersion: 6\n  m_Component:\n  - component: {fileID: 619302621}\n  - component: {fileID: 619302620}\n  m_Layer: 0\n  m_Name: Controller\n  m_TagString: Untagged\n  m_Icon: {fileID: 0}\n  m_NavMeshLayer: 0\n  m_StaticEditorFlags: 0\n  m_IsActive: 1\n--- !u!114 &619302620\nMonoBehaviour:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInternal: {fileID: 0}\n  m_GameObject: {fileID: 619302619}\n  m_Enabled: 1\n  m_EditorHideFlags: 0\n  m_Script: {fileID: 11500000, guid: 285cc2b6c9e60419fb51e48c0011bb12, type: 3}\n  m_Name: \n  m_EditorClassIdentifier: \n  count: 1000\n--- !u!4 &619302621\nTransform:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInternal: {fileID: 0}\n  m_GameObject: {fileID: 619302619}\n  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}\n  m_LocalPosition: {x: 0, y: 0, z: 0}\n  m_LocalScale: {x: 1, y: 1, z: 1}\n  m_Children: []\n  m_Father: {fileID: 0}\n  m_RootOrder: 0\n  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Entity Stress Test/Entity Stress Test Scene.unity.meta",
    "content": "fileFormatVersion: 2\nguid: 9693b73c9c95a4c2e951176a1fb5b355\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Entity Stress Test/EntityStressTestController.cs",
    "content": "﻿using Entitas.Unity;\nusing UnityEngine;\n\npublic class EntityStressTestController : MonoBehaviour\n{\n    public int count;\n\n    GameContext _gameContext;\n    bool _flag;\n\n    void Start()\n    {\n        ContextInitialization.InitializeAllContexts();\n        _gameContext = new GameContext();\n        _gameContext.CreateContextObserver();\n\n        // for (var i = 0; i < count; i++)\n        // {\n        //     var e = _contexts.game.CreateEntity();\n        //     e.AddMyInt(i);\n        //     e.AddMyString(i.ToString());\n        // }\n    }\n\n    void Update()\n    {\n        // foreach (var e in _contexts.game.GetEntities())\n        //     e.ReplaceMyInt(e.myInt.Value + 1);\n\n        if (Time.frameCount % 60 == 0)\n        {\n            _flag = !_flag;\n            if (_flag)\n                for (var i = 0; i < count; i++)\n                    _gameContext.CreateEntity().AddMyInt(i);\n            else\n                foreach (var entity in _gameContext.GetEntities())\n                    entity.Destroy();\n        }\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Entity Stress Test/EntityStressTestController.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 285cc2b6c9e60419fb51e48c0011bb12\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Entity Stress Test.meta",
    "content": "fileFormatVersion: 2\nguid: 716397237436b4443bd27b1266b106cf\nfolderAsset: yes\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/EntityLink/EntityLink Scene.unity",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!29 &1\nOcclusionCullingSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 2\n  m_OcclusionBakeSettings:\n    smallestOccluder: 5\n    smallestHole: 0.25\n    backfaceThreshold: 100\n  m_SceneGUID: 00000000000000000000000000000000\n  m_OcclusionCullingData: {fileID: 0}\n--- !u!104 &2\nRenderSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 9\n  m_Fog: 0\n  m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}\n  m_FogMode: 3\n  m_FogDensity: 0.01\n  m_LinearFogStart: 0\n  m_LinearFogEnd: 300\n  m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}\n  m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}\n  m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}\n  m_AmbientIntensity: 1\n  m_AmbientMode: 0\n  m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}\n  m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}\n  m_HaloStrength: 0.5\n  m_FlareStrength: 1\n  m_FlareFadeSpeed: 3\n  m_HaloTexture: {fileID: 0}\n  m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}\n  m_DefaultReflectionMode: 0\n  m_DefaultReflectionResolution: 128\n  m_ReflectionBounces: 1\n  m_ReflectionIntensity: 1\n  m_CustomReflection: {fileID: 0}\n  m_Sun: {fileID: 0}\n  m_IndirectSpecularColor: {r: 0.3708625, g: 0.37838694, b: 0.35726872, a: 1}\n  m_UseRadianceAmbientProbe: 0\n--- !u!157 &3\nLightmapSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 12\n  m_GIWorkflowMode: 0\n  m_GISettings:\n    serializedVersion: 2\n    m_BounceScale: 1\n    m_IndirectOutputScale: 1\n    m_AlbedoBoost: 1\n    m_EnvironmentLightingMode: 0\n    m_EnableBakedLightmaps: 1\n    m_EnableRealtimeLightmaps: 1\n  m_LightmapEditorSettings:\n    serializedVersion: 12\n    m_Resolution: 2\n    m_BakeResolution: 40\n    m_AtlasSize: 1024\n    m_AO: 0\n    m_AOMaxDistance: 1\n    m_CompAOExponent: 1\n    m_CompAOExponentDirect: 0\n    m_ExtractAmbientOcclusion: 0\n    m_Padding: 2\n    m_LightmapParameters: {fileID: 0}\n    m_LightmapsBakeMode: 1\n    m_TextureCompression: 1\n    m_FinalGather: 0\n    m_FinalGatherFiltering: 1\n    m_FinalGatherRayCount: 256\n    m_ReflectionCompression: 2\n    m_MixedBakeMode: 2\n    m_BakeBackend: 0\n    m_PVRSampling: 1\n    m_PVRDirectSampleCount: 32\n    m_PVRSampleCount: 500\n    m_PVRBounces: 2\n    m_PVREnvironmentSampleCount: 500\n    m_PVREnvironmentReferencePointCount: 2048\n    m_PVRFilteringMode: 2\n    m_PVRDenoiserTypeDirect: 0\n    m_PVRDenoiserTypeIndirect: 0\n    m_PVRDenoiserTypeAO: 0\n    m_PVRFilterTypeDirect: 0\n    m_PVRFilterTypeIndirect: 0\n    m_PVRFilterTypeAO: 0\n    m_PVREnvironmentMIS: 0\n    m_PVRCulling: 1\n    m_PVRFilteringGaussRadiusDirect: 1\n    m_PVRFilteringGaussRadiusIndirect: 5\n    m_PVRFilteringGaussRadiusAO: 2\n    m_PVRFilteringAtrousPositionSigmaDirect: 0.5\n    m_PVRFilteringAtrousPositionSigmaIndirect: 2\n    m_PVRFilteringAtrousPositionSigmaAO: 1\n    m_ExportTrainingData: 0\n    m_TrainingDataDestination: TrainingData\n    m_LightProbeSampleCountMultiplier: 4\n  m_LightingDataAsset: {fileID: 0}\n  m_LightingSettings: {fileID: 550312199}\n--- !u!196 &4\nNavMeshSettings:\n  serializedVersion: 2\n  m_ObjectHideFlags: 0\n  m_BuildSettings:\n    serializedVersion: 2\n    agentTypeID: 0\n    agentRadius: 0.5\n    agentHeight: 2\n    agentSlope: 45\n    agentClimb: 0.4\n    ledgeDropHeight: 0\n    maxJumpAcrossDistance: 0\n    minRegionArea: 2\n    manualCellSize: 0\n    cellSize: 0.16666667\n    manualTileSize: 0\n    tileSize: 256\n    accuratePlacement: 0\n    maxJobWorkers: 0\n    preserveTilesOutsideBounds: 0\n    debug:\n      m_Flags: 0\n  m_NavMeshData: {fileID: 0}\n--- !u!850595691 &550312199\nLightingSettings:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  m_Name: Settings.lighting\n  serializedVersion: 4\n  m_GIWorkflowMode: 0\n  m_EnableBakedLightmaps: 1\n  m_EnableRealtimeLightmaps: 1\n  m_RealtimeEnvironmentLighting: 1\n  m_BounceScale: 1\n  m_AlbedoBoost: 1\n  m_IndirectOutputScale: 1\n  m_UsingShadowmask: 1\n  m_BakeBackend: 0\n  m_LightmapMaxSize: 1024\n  m_BakeResolution: 40\n  m_Padding: 2\n  m_LightmapCompression: 3\n  m_AO: 0\n  m_AOMaxDistance: 1\n  m_CompAOExponent: 1\n  m_CompAOExponentDirect: 0\n  m_ExtractAO: 0\n  m_MixedBakeMode: 2\n  m_LightmapsBakeMode: 1\n  m_FilterMode: 1\n  m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}\n  m_ExportTrainingData: 0\n  m_TrainingDataDestination: TrainingData\n  m_RealtimeResolution: 2\n  m_ForceWhiteAlbedo: 0\n  m_ForceUpdates: 0\n  m_FinalGather: 0\n  m_FinalGatherRayCount: 256\n  m_FinalGatherFiltering: 1\n  m_PVRCulling: 1\n  m_PVRSampling: 1\n  m_PVRDirectSampleCount: 32\n  m_PVRSampleCount: 500\n  m_PVREnvironmentSampleCount: 500\n  m_PVREnvironmentReferencePointCount: 2048\n  m_LightProbeSampleCountMultiplier: 4\n  m_PVRBounces: 2\n  m_PVRMinBounces: 2\n  m_PVREnvironmentMIS: 0\n  m_PVRFilteringMode: 2\n  m_PVRDenoiserTypeDirect: 0\n  m_PVRDenoiserTypeIndirect: 0\n  m_PVRDenoiserTypeAO: 0\n  m_PVRFilterTypeDirect: 0\n  m_PVRFilterTypeIndirect: 0\n  m_PVRFilterTypeAO: 0\n  m_PVRFilteringGaussRadiusDirect: 1\n  m_PVRFilteringGaussRadiusIndirect: 5\n  m_PVRFilteringGaussRadiusAO: 2\n  m_PVRFilteringAtrousPositionSigmaDirect: 0.5\n  m_PVRFilteringAtrousPositionSigmaIndirect: 2\n  m_PVRFilteringAtrousPositionSigmaAO: 1\n  m_PVRTiledBaking: 0\n--- !u!1 &994460076\nGameObject:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  serializedVersion: 6\n  m_Component:\n  - component: {fileID: 994460078}\n  - component: {fileID: 994460077}\n  m_Layer: 0\n  m_Name: Controller\n  m_TagString: Untagged\n  m_Icon: {fileID: 0}\n  m_NavMeshLayer: 0\n  m_StaticEditorFlags: 0\n  m_IsActive: 1\n--- !u!114 &994460077\nMonoBehaviour:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  m_GameObject: {fileID: 994460076}\n  m_Enabled: 1\n  m_EditorHideFlags: 0\n  m_Script: {fileID: 11500000, guid: 6b7bce7896e0347d7bb51d6f8c8802e2, type: 3}\n  m_Name: \n  m_EditorClassIdentifier: \n--- !u!4 &994460078\nTransform:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  m_GameObject: {fileID: 994460076}\n  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}\n  m_LocalPosition: {x: 0, y: 0, z: 0}\n  m_LocalScale: {x: 1, y: 1, z: 1}\n  m_ConstrainProportionsScale: 0\n  m_Children: []\n  m_Father: {fileID: 0}\n  m_RootOrder: 0\n  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/EntityLink/EntityLink Scene.unity.meta",
    "content": "fileFormatVersion: 2\nguid: 4c3fef27b9afc47678153f816cb06e08\ntimeCreated: 1515794709\nlicenseType: Free\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/EntityLink/EntityLinkController.cs",
    "content": "﻿using Entitas.Unity;\nusing UnityEngine;\n\npublic class EntityLinkController : MonoBehaviour\n{\n    void Start()\n    {\n        ContextInitialization.InitializeAllContexts();\n        var gameContext = new GameContext();\n        gameContext.CreateContextObserver();\n        var entity = gameContext.CreateEntity();\n\n        var go = new GameObject();\n        go.Link(entity);\n\n        entity.AddMyGameObject(go);\n\n//        go.Unlink();\n\n        Destroy(go);\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/EntityLink/EntityLinkController.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 6b7bce7896e0347d7bb51d6f8c8802e2\ntimeCreated: 1515794616\nlicenseType: Free\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/EntityLink.meta",
    "content": "fileFormatVersion: 2\nguid: 802031397194d49dc9b2b8a534477d68\nfolderAsset: yes\ntimeCreated: 1508969008\nlicenseType: Free\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Fixtures/TestComponent.cs",
    "content": "﻿using Entitas;\nusing Entitas.Generators.Attributes;\n\n[Context(typeof(GameContext)), Context(typeof(InputContext))]\npublic sealed class TestComponent : IComponent { }\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Fixtures/TestComponent.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 58dcfa315ac634f55b4f704b27a6d993\ntimeCreated: 1454969455\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Fixtures/TestReactiveSystem.cs",
    "content": "﻿using System.Collections.Generic;\nusing Entitas;\n\npublic class TestReactiveSystem : ReactiveSystem<Game.Entity>\n{\n    public TestReactiveSystem(GameContext context) : base(context) { }\n\n    protected override ICollector<Game.Entity> GetTrigger(IContext<Game.Entity> context) =>\n        context.CreateCollector(GameTestMatcher.Test);\n\n    protected override bool Filter(Game.Entity entity) => true;\n\n    protected override void Execute(List<Game.Entity> entities) { }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Fixtures/TestReactiveSystem.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 224fbeb414af74d3ea0a3ab23bf8ff71\ntimeCreated: 1454969689\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Fixtures.meta",
    "content": "fileFormatVersion: 2\nguid: a264ebe020ce546b183f93b3f1e5a48b\nfolderAsset: yes\ntimeCreated: 1457784847\nlicenseType: Pro\nDefaultImporter:\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Group Alloc/Group Alloc Scene.unity",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!29 &1\nOcclusionCullingSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 2\n  m_OcclusionBakeSettings:\n    smallestOccluder: 5\n    smallestHole: 0.25\n    backfaceThreshold: 100\n  m_SceneGUID: 00000000000000000000000000000000\n  m_OcclusionCullingData: {fileID: 0}\n--- !u!104 &2\nRenderSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 9\n  m_Fog: 0\n  m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}\n  m_FogMode: 3\n  m_FogDensity: 0.01\n  m_LinearFogStart: 0\n  m_LinearFogEnd: 300\n  m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}\n  m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}\n  m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}\n  m_AmbientIntensity: 1\n  m_AmbientMode: 0\n  m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}\n  m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}\n  m_HaloStrength: 0.5\n  m_FlareStrength: 1\n  m_FlareFadeSpeed: 3\n  m_HaloTexture: {fileID: 0}\n  m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}\n  m_DefaultReflectionMode: 0\n  m_DefaultReflectionResolution: 128\n  m_ReflectionBounces: 1\n  m_ReflectionIntensity: 1\n  m_CustomReflection: {fileID: 0}\n  m_Sun: {fileID: 0}\n  m_IndirectSpecularColor: {r: 0.3708625, g: 0.37838694, b: 0.35726872, a: 1}\n  m_UseRadianceAmbientProbe: 0\n--- !u!157 &3\nLightmapSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 12\n  m_GIWorkflowMode: 0\n  m_GISettings:\n    serializedVersion: 2\n    m_BounceScale: 1\n    m_IndirectOutputScale: 1\n    m_AlbedoBoost: 1\n    m_EnvironmentLightingMode: 0\n    m_EnableBakedLightmaps: 1\n    m_EnableRealtimeLightmaps: 1\n  m_LightmapEditorSettings:\n    serializedVersion: 12\n    m_Resolution: 2\n    m_BakeResolution: 40\n    m_AtlasSize: 1024\n    m_AO: 0\n    m_AOMaxDistance: 1\n    m_CompAOExponent: 1\n    m_CompAOExponentDirect: 0\n    m_ExtractAmbientOcclusion: 0\n    m_Padding: 2\n    m_LightmapParameters: {fileID: 0}\n    m_LightmapsBakeMode: 1\n    m_TextureCompression: 1\n    m_FinalGather: 0\n    m_FinalGatherFiltering: 1\n    m_FinalGatherRayCount: 256\n    m_ReflectionCompression: 2\n    m_MixedBakeMode: 2\n    m_BakeBackend: 0\n    m_PVRSampling: 1\n    m_PVRDirectSampleCount: 32\n    m_PVRSampleCount: 500\n    m_PVRBounces: 2\n    m_PVREnvironmentSampleCount: 500\n    m_PVREnvironmentReferencePointCount: 2048\n    m_PVRFilteringMode: 2\n    m_PVRDenoiserTypeDirect: 0\n    m_PVRDenoiserTypeIndirect: 0\n    m_PVRDenoiserTypeAO: 0\n    m_PVRFilterTypeDirect: 0\n    m_PVRFilterTypeIndirect: 0\n    m_PVRFilterTypeAO: 0\n    m_PVREnvironmentMIS: 0\n    m_PVRCulling: 1\n    m_PVRFilteringGaussRadiusDirect: 1\n    m_PVRFilteringGaussRadiusIndirect: 5\n    m_PVRFilteringGaussRadiusAO: 2\n    m_PVRFilteringAtrousPositionSigmaDirect: 0.5\n    m_PVRFilteringAtrousPositionSigmaIndirect: 2\n    m_PVRFilteringAtrousPositionSigmaAO: 1\n    m_ExportTrainingData: 0\n    m_TrainingDataDestination: TrainingData\n    m_LightProbeSampleCountMultiplier: 4\n  m_LightingDataAsset: {fileID: 0}\n  m_LightingSettings: {fileID: 4890085278179872738, guid: bfafbdff0a29d4647bff350c279c1c36, type: 2}\n--- !u!196 &4\nNavMeshSettings:\n  serializedVersion: 2\n  m_ObjectHideFlags: 0\n  m_BuildSettings:\n    serializedVersion: 2\n    agentTypeID: 0\n    agentRadius: 0.5\n    agentHeight: 2\n    agentSlope: 45\n    agentClimb: 0.4\n    ledgeDropHeight: 0\n    maxJumpAcrossDistance: 0\n    minRegionArea: 2\n    manualCellSize: 0\n    cellSize: 0.16666667\n    manualTileSize: 0\n    tileSize: 256\n    accuratePlacement: 0\n    maxJobWorkers: 0\n    preserveTilesOutsideBounds: 0\n    debug:\n      m_Flags: 0\n  m_NavMeshData: {fileID: 0}\n--- !u!1 &1169350011\nGameObject:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  serializedVersion: 6\n  m_Component:\n  - component: {fileID: 1169350013}\n  - component: {fileID: 1169350012}\n  m_Layer: 0\n  m_Name: Controller\n  m_TagString: Untagged\n  m_Icon: {fileID: 0}\n  m_NavMeshLayer: 0\n  m_StaticEditorFlags: 0\n  m_IsActive: 1\n--- !u!114 &1169350012\nMonoBehaviour:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  m_GameObject: {fileID: 1169350011}\n  m_Enabled: 1\n  m_EditorHideFlags: 0\n  m_Script: {fileID: 11500000, guid: 78eba33893cf04b228baa507095ea482, type: 3}\n  m_Name: \n  m_EditorClassIdentifier: \n  Mode: 0\n  Count: 100\n--- !u!4 &1169350013\nTransform:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  m_GameObject: {fileID: 1169350011}\n  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}\n  m_LocalPosition: {x: 0, y: 0, z: 0}\n  m_LocalScale: {x: 1, y: 1, z: 1}\n  m_ConstrainProportionsScale: 0\n  m_Children: []\n  m_Father: {fileID: 0}\n  m_RootOrder: 0\n  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Group Alloc/Group Alloc Scene.unity.meta",
    "content": "fileFormatVersion: 2\nguid: d9150b74acc734ada9a516a0fc679c99\ntimeCreated: 1519479689\nlicenseType: Free\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Group Alloc/GroupAllocController.cs",
    "content": "﻿using System.Collections.Generic;\nusing Entitas;\nusing Entitas.Unity;\nusing UnityEngine;\n\npublic class GroupAllocController : MonoBehaviour\n{\n    public GroupAlloc Mode;\n    public int Count;\n\n    readonly List<Game.Entity> _buffer = new List<Game.Entity>();\n    GameContext _gameContext;\n    IGroup<Game.Entity> _group;\n\n    void Start()\n    {\n        ContextInitialization.InitializeAllContexts();\n        _gameContext = new GameContext();\n        _gameContext.CreateContextObserver();\n        _group = _gameContext.GetGroup(GameMyIntMatcher.MyInt);\n    }\n\n    void Update()\n    {\n        _gameContext.DestroyAllEntities();\n        for (var i = 0; i < Count; i++)\n            _gameContext.CreateEntity().AddMyInt(i);\n\n        Iterate();\n    }\n\n    void Iterate()\n    {\n        switch (Mode)\n        {\n            case GroupAlloc.Group:\n                foreach (var entity in _group)\n                {\n                    var unused = entity.GetMyInt().Value;\n                }\n\n                break;\n            case GroupAlloc.GetEntities:\n                foreach (var entity in _group.GetEntities())\n                {\n                    var unused = entity.GetMyInt().Value;\n                }\n\n                break;\n            case GroupAlloc.GetEntitiesBuffer:\n                foreach (var entity in _group.GetEntities(_buffer))\n                {\n                    var unused = entity.GetMyInt().Value;\n                }\n\n                break;\n        }\n    }\n}\n\npublic enum GroupAlloc\n{\n    Group,\n    GetEntities,\n    GetEntitiesBuffer\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Group Alloc/GroupAllocController.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 78eba33893cf04b228baa507095ea482\ntimeCreated: 1519479366\nlicenseType: Free\nMonoImporter:\n  externalObjects: {}\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Group Alloc.meta",
    "content": "fileFormatVersion: 2\nguid: 8e86e453905c642329467e859a3b8f3b\nfolderAsset: yes\ntimeCreated: 1519479356\nlicenseType: Free\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Reactive System Exception/Reactive System Exception Scene.unity",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!29 &1\nOcclusionCullingSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 2\n  m_OcclusionBakeSettings:\n    smallestOccluder: 5\n    smallestHole: 0.25\n    backfaceThreshold: 100\n  m_SceneGUID: 00000000000000000000000000000000\n  m_OcclusionCullingData: {fileID: 0}\n--- !u!104 &2\nRenderSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 9\n  m_Fog: 0\n  m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}\n  m_FogMode: 3\n  m_FogDensity: 0.01\n  m_LinearFogStart: 0\n  m_LinearFogEnd: 300\n  m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}\n  m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}\n  m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}\n  m_AmbientIntensity: 1\n  m_AmbientMode: 0\n  m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}\n  m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}\n  m_HaloStrength: 0.5\n  m_FlareStrength: 1\n  m_FlareFadeSpeed: 3\n  m_HaloTexture: {fileID: 0}\n  m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}\n  m_DefaultReflectionMode: 0\n  m_DefaultReflectionResolution: 128\n  m_ReflectionBounces: 1\n  m_ReflectionIntensity: 1\n  m_CustomReflection: {fileID: 0}\n  m_Sun: {fileID: 0}\n  m_IndirectSpecularColor: {r: 0.3731196, g: 0.38074002, b: 0.35872707, a: 1}\n  m_UseRadianceAmbientProbe: 0\n--- !u!157 &3\nLightmapSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 11\n  m_GIWorkflowMode: 0\n  m_GISettings:\n    serializedVersion: 2\n    m_BounceScale: 1\n    m_IndirectOutputScale: 1\n    m_AlbedoBoost: 1\n    m_TemporalCoherenceThreshold: 1\n    m_EnvironmentLightingMode: 0\n    m_EnableBakedLightmaps: 1\n    m_EnableRealtimeLightmaps: 1\n  m_LightmapEditorSettings:\n    serializedVersion: 10\n    m_Resolution: 2\n    m_BakeResolution: 40\n    m_AtlasSize: 1024\n    m_AO: 0\n    m_AOMaxDistance: 1\n    m_CompAOExponent: 1\n    m_CompAOExponentDirect: 0\n    m_Padding: 2\n    m_LightmapParameters: {fileID: 0}\n    m_LightmapsBakeMode: 1\n    m_TextureCompression: 1\n    m_FinalGather: 0\n    m_FinalGatherFiltering: 1\n    m_FinalGatherRayCount: 256\n    m_ReflectionCompression: 2\n    m_MixedBakeMode: 2\n    m_BakeBackend: 1\n    m_PVRSampling: 1\n    m_PVRDirectSampleCount: 32\n    m_PVRSampleCount: 500\n    m_PVRBounces: 2\n    m_PVRFilterTypeDirect: 0\n    m_PVRFilterTypeIndirect: 0\n    m_PVRFilterTypeAO: 0\n    m_PVRFilteringMode: 1\n    m_PVRCulling: 1\n    m_PVRFilteringGaussRadiusDirect: 1\n    m_PVRFilteringGaussRadiusIndirect: 5\n    m_PVRFilteringGaussRadiusAO: 2\n    m_PVRFilteringAtrousPositionSigmaDirect: 0.5\n    m_PVRFilteringAtrousPositionSigmaIndirect: 2\n    m_PVRFilteringAtrousPositionSigmaAO: 1\n    m_ShowResolutionOverlay: 1\n  m_LightingDataAsset: {fileID: 0}\n  m_UseShadowmask: 1\n--- !u!196 &4\nNavMeshSettings:\n  serializedVersion: 2\n  m_ObjectHideFlags: 0\n  m_BuildSettings:\n    serializedVersion: 2\n    agentTypeID: 0\n    agentRadius: 0.5\n    agentHeight: 2\n    agentSlope: 45\n    agentClimb: 0.4\n    ledgeDropHeight: 0\n    maxJumpAcrossDistance: 0\n    minRegionArea: 2\n    manualCellSize: 0\n    cellSize: 0.16666667\n    manualTileSize: 0\n    tileSize: 256\n    accuratePlacement: 0\n    debug:\n      m_Flags: 0\n  m_NavMeshData: {fileID: 0}\n--- !u!1 &335183607\nGameObject:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInternal: {fileID: 0}\n  serializedVersion: 6\n  m_Component:\n  - component: {fileID: 335183609}\n  - component: {fileID: 335183608}\n  m_Layer: 0\n  m_Name: Controller\n  m_TagString: Untagged\n  m_Icon: {fileID: 0}\n  m_NavMeshLayer: 0\n  m_StaticEditorFlags: 0\n  m_IsActive: 1\n--- !u!114 &335183608\nMonoBehaviour:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInternal: {fileID: 0}\n  m_GameObject: {fileID: 335183607}\n  m_Enabled: 1\n  m_EditorHideFlags: 0\n  m_Script: {fileID: 11500000, guid: af88d9eb7bda418db410c5a1d92d419b, type: 3}\n  m_Name: \n  m_EditorClassIdentifier: \n--- !u!4 &335183609\nTransform:\n  m_ObjectHideFlags: 0\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInternal: {fileID: 0}\n  m_GameObject: {fileID: 335183607}\n  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}\n  m_LocalPosition: {x: 0, y: 0, z: 0}\n  m_LocalScale: {x: 1, y: 1, z: 1}\n  m_Children: []\n  m_Father: {fileID: 0}\n  m_RootOrder: 0\n  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Reactive System Exception/Reactive System Exception Scene.unity.meta",
    "content": "fileFormatVersion: 2\nguid: a15993e3c6d0c42ca90a69ab47e5418e\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Reactive System Exception/ReactiveSystemExceptionController.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing Entitas;\nusing Entitas.Unity;\nusing UnityEngine;\nusing Random = UnityEngine.Random;\n\npublic class ReactiveSystemExceptionController : MonoBehaviour\n{\n    Game.Entity _entity;\n    ExceptionReactiveSystem _system;\n\n    void Start()\n    {\n        ContextInitialization.InitializeAllContexts();\n        var gameContext = new GameContext();\n        gameContext.CreateContextObserver();\n        _entity = gameContext.CreateEntity();\n        _system = new ExceptionReactiveSystem(gameContext);\n    }\n\n    void Update()\n    {\n        _entity.ReplaceMyString(Random.value.ToString(CultureInfo.InvariantCulture));\n        _system.Execute();\n    }\n}\n\npublic class ExceptionReactiveSystem : ReactiveSystem<Game.Entity>\n{\n    public ExceptionReactiveSystem(GameContext context) : base(context) { }\n\n    protected override ICollector<Game.Entity> GetTrigger(IContext<Game.Entity> context) =>\n        context.CreateCollector(GameMyStringMatcher.MyString);\n\n    protected override bool Filter(Game.Entity entity) => true;\n\n    protected override void Execute(List<Game.Entity> entities)\n    {\n        if (Random.value > 0.99f)\n            throw new Exception(\"ExceptionReactiveSystem Exception!\");\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Reactive System Exception/ReactiveSystemExceptionController.cs.meta",
    "content": "﻿fileFormatVersion: 2\r\nguid: af88d9eb7bda418db410c5a1d92d419b\r\ntimeCreated: 1539714679"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/Reactive System Exception.meta",
    "content": "﻿fileFormatVersion: 2\r\nguid: 95a1991d296b43cdacda4c6f66a842e5\r\ntimeCreated: 1539714655"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/ReactiveSystem Destructor/ReactiveSystem Destructor.unity",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!29 &1\nSceneSettings:\n  m_ObjectHideFlags: 0\n  m_PVSData: \n  m_PVSObjectsArray: []\n  m_PVSPortalsArray: []\n  m_OcclusionBakeSettings:\n    smallestOccluder: 5\n    smallestHole: 0.25\n    backfaceThreshold: 100\n--- !u!104 &2\nRenderSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 6\n  m_Fog: 0\n  m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}\n  m_FogMode: 3\n  m_FogDensity: 0.01\n  m_LinearFogStart: 0\n  m_LinearFogEnd: 300\n  m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}\n  m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}\n  m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}\n  m_AmbientIntensity: 1\n  m_AmbientMode: 0\n  m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}\n  m_HaloStrength: 0.5\n  m_FlareStrength: 1\n  m_FlareFadeSpeed: 3\n  m_HaloTexture: {fileID: 0}\n  m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}\n  m_DefaultReflectionMode: 0\n  m_DefaultReflectionResolution: 128\n  m_ReflectionBounces: 1\n  m_ReflectionIntensity: 1\n  m_CustomReflection: {fileID: 0}\n  m_Sun: {fileID: 0}\n--- !u!157 &3\nLightmapSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 6\n  m_GIWorkflowMode: 0\n  m_LightmapsMode: 1\n  m_GISettings:\n    serializedVersion: 2\n    m_BounceScale: 1\n    m_IndirectOutputScale: 1\n    m_AlbedoBoost: 1\n    m_TemporalCoherenceThreshold: 1\n    m_EnvironmentLightingMode: 0\n    m_EnableBakedLightmaps: 1\n    m_EnableRealtimeLightmaps: 1\n  m_LightmapEditorSettings:\n    serializedVersion: 3\n    m_Resolution: 2\n    m_BakeResolution: 40\n    m_TextureWidth: 1024\n    m_TextureHeight: 1024\n    m_AOMaxDistance: 1\n    m_Padding: 2\n    m_CompAOExponent: 0\n    m_LightmapParameters: {fileID: 0}\n    m_TextureCompression: 1\n    m_FinalGather: 0\n    m_FinalGatherRayCount: 1024\n    m_ReflectionCompression: 2\n  m_LightingDataAsset: {fileID: 0}\n  m_RuntimeCPUUsage: 25\n--- !u!196 &4\nNavMeshSettings:\n  serializedVersion: 2\n  m_ObjectHideFlags: 0\n  m_BuildSettings:\n    serializedVersion: 2\n    agentRadius: 0.5\n    agentHeight: 2\n    agentSlope: 45\n    agentClimb: 0.4\n    ledgeDropHeight: 0\n    maxJumpAcrossDistance: 0\n    accuratePlacement: 0\n    minRegionArea: 2\n    cellSize: 0.16666667\n    manualCellSize: 0\n  m_NavMeshData: {fileID: 0}\n--- !u!1 &1576095025\nGameObject:\n  m_ObjectHideFlags: 0\n  m_PrefabParentObject: {fileID: 0}\n  m_PrefabInternal: {fileID: 0}\n  serializedVersion: 4\n  m_Component:\n  - 4: {fileID: 1576095027}\n  - 114: {fileID: 1576095026}\n  m_Layer: 0\n  m_Name: Controller\n  m_TagString: Untagged\n  m_Icon: {fileID: 0}\n  m_NavMeshLayer: 0\n  m_StaticEditorFlags: 0\n  m_IsActive: 1\n--- !u!114 &1576095026\nMonoBehaviour:\n  m_ObjectHideFlags: 0\n  m_PrefabParentObject: {fileID: 0}\n  m_PrefabInternal: {fileID: 0}\n  m_GameObject: {fileID: 1576095025}\n  m_Enabled: 1\n  m_EditorHideFlags: 0\n  m_Script: {fileID: 11500000, guid: 60cd40ead19244af69139bcae307ac31, type: 3}\n  m_Name: \n  m_EditorClassIdentifier: \n--- !u!4 &1576095027\nTransform:\n  m_ObjectHideFlags: 0\n  m_PrefabParentObject: {fileID: 0}\n  m_PrefabInternal: {fileID: 0}\n  m_GameObject: {fileID: 1576095025}\n  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}\n  m_LocalPosition: {x: 0, y: 0, z: 0}\n  m_LocalScale: {x: 1, y: 1, z: 1}\n  m_Children: []\n  m_Father: {fileID: 0}\n  m_RootOrder: 0\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/ReactiveSystem Destructor/ReactiveSystem Destructor.unity.meta",
    "content": "fileFormatVersion: 2\nguid: 2c07bbb67ef0741c587e02a7ab9a476b\ntimeCreated: 1454969404\nlicenseType: Pro\nDefaultImporter:\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/ReactiveSystem Destructor/ReactiveSystemDestructorController.cs",
    "content": "using Entitas.Unity;\nusing UnityEngine;\nusing UnityEditor;\n\npublic class ReactiveSystemDestructorController : MonoBehaviour\n{\n    GameContext _gameContext;\n    Game.Entity _initialEntity;\n\n    void Start()\n    {\n        ContextInitialization.InitializeAllContexts();\n        _gameContext = new GameContext();\n        _gameContext.CreateContextObserver();\n        new TestReactiveSystem(_gameContext);\n        _initialEntity = _gameContext.CreateEntity();\n        _initialEntity.AddTest();\n        _initialEntity.Destroy();\n    }\n\n    void Update()\n    {\n        for (var i = 0; i < 5000; i++)\n        {\n            var e = _gameContext.CreateEntity();\n            if (e == _initialEntity)\n            {\n                Debug.Log(\"Success: Reusing entity!\");\n                EditorApplication.isPlaying = false;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/ReactiveSystem Destructor/ReactiveSystemDestructorController.cs.meta",
    "content": "fileFormatVersion: 2\nguid: 60cd40ead19244af69139bcae307ac31\ntimeCreated: 1454969436\nlicenseType: Pro\nMonoImporter:\n  serializedVersion: 2\n  defaultReferences: []\n  executionOrder: 0\n  icon: {instanceID: 0}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests/ReactiveSystem Destructor.meta",
    "content": "fileFormatVersion: 2\nguid: 5b42989fff2b74bbf9e97aa602022f12\nfolderAsset: yes\ntimeCreated: 1454969316\nlicenseType: Pro\nDefaultImporter:\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests/Manual Tests.meta",
    "content": "fileFormatVersion: 2\nguid: 8c5e0db5fd8544447bfef576d96efc55\nfolderAsset: yes\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample/Tests.meta",
    "content": "fileFormatVersion: 2\nguid: 403c2dea987524f5abb71c8714c790eb\nfolderAsset: yes\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Assets/Sample.meta",
    "content": "fileFormatVersion: 2\nguid: d06c0160a13c94f329b85a954d6d6ce2\nfolderAsset: yes\nDefaultImporter:\n  externalObjects: {}\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "samples/Unity/Entitas.properties",
    "content": "Entitas.VisualDebugging.Unity.Editor.SystemWarningThreshold = 1\nEntitas.VisualDebugging.Unity.Editor.DefaultInstanceCreatorFolderPath = Assets/Editor/DefaultInstanceCreator\nEntitas.VisualDebugging.Unity.Editor.TypeDrawerFolderPath = Assets/Editor/TypeDrawer\n"
  },
  {
    "path": "samples/Unity/Jenny.properties",
    "content": "Jenny.SearchPaths = ../../tests/Entitas.CodeGeneration.Program/bin/Release\nJenny.Plugins = Entitas.CodeGeneration.Plugins, \\\n                Entitas.Roslyn.CodeGeneration.Plugins, \\\n                Entitas.VisualDebugging.CodeGeneration.Plugins, \\\n                Jenny.Plugins, \\\n                Jenny.Plugins.Unity\nJenny.PreProcessors = Jenny.Plugins.ValidateProjectPathPreProcessor, \\\n                      Jenny.Plugins.TargetFrameworkProfilePreProcessor\nJenny.DataProviders = Entitas.CodeGeneration.Plugins.ContextDataProvider, \\\n                      Entitas.Roslyn.CodeGeneration.Plugins.CleanupDataProvider, \\\n                      Entitas.Roslyn.CodeGeneration.Plugins.ComponentDataProvider, \\\n                      Entitas.Roslyn.CodeGeneration.Plugins.EntityIndexDataProvider\nJenny.CodeGenerators = Entitas.CodeGeneration.Plugins.ComponentContextApiGenerator, \\\n                       Entitas.CodeGeneration.Plugins.ComponentEntityApiGenerator, \\\n                       Entitas.CodeGeneration.Plugins.ComponentEntityApiInterfaceGenerator, \\\n                       Entitas.CodeGeneration.Plugins.ComponentGenerator, \\\n                       Entitas.CodeGeneration.Plugins.ComponentLookupGenerator, \\\n                       Entitas.CodeGeneration.Plugins.ComponentMatcherApiGenerator, \\\n                       Entitas.CodeGeneration.Plugins.ContextAttributeGenerator, \\\n                       Entitas.CodeGeneration.Plugins.ContextGenerator, \\\n                       Entitas.CodeGeneration.Plugins.ContextMatcherGenerator, \\\n                       Entitas.CodeGeneration.Plugins.ContextsGenerator, \\\n                       Entitas.CodeGeneration.Plugins.EntityGenerator, \\\n                       Entitas.CodeGeneration.Plugins.EntityIndexGenerator, \\\n                       Entitas.CodeGeneration.Plugins.EventEntityApiGenerator, \\\n                       Entitas.CodeGeneration.Plugins.EventListenerComponentGenerator, \\\n                       Entitas.CodeGeneration.Plugins.EventListenerInterfaceGenerator, \\\n                       Entitas.CodeGeneration.Plugins.EventSystemGenerator, \\\n                       Entitas.CodeGeneration.Plugins.EventSystemsGenerator, \\\n                       Entitas.VisualDebugging.CodeGeneration.Plugins.ContextObserverGenerator, \\\n                       Entitas.VisualDebugging.CodeGeneration.Plugins.FeatureClassGenerator, \\\n                       Entitas.Roslyn.CodeGeneration.Plugins.CleanupSystemGenerator, \\\n                       Entitas.Roslyn.CodeGeneration.Plugins.CleanupSystemsGenerator\nJenny.PostProcessors = Jenny.Plugins.AddFileHeaderPostProcessor, \\\n                       Jenny.Plugins.CleanTargetDirectoryPostProcessor, \\\n                       Jenny.Plugins.MergeFilesPostProcessor, \\\n                       Jenny.Plugins.UpdateCsprojPostProcessor, \\\n                       Jenny.Plugins.WriteToDiskPostProcessor, \\\n                       Jenny.Plugins.ConsoleWriteLinePostProcessor\nJenny.Server.Port = 3333\nJenny.Client.Host = localhost\nJenny.Plugins.ProjectPath = Assembly-CSharp.csproj\nEntitas.CodeGeneration.Plugins.Contexts = Game, \\\n                                          Input\nEntitas.CodeGeneration.Plugins.IgnoreNamespaces = false\nJenny.Plugins.TargetDirectory = Assets\n"
  },
  {
    "path": "samples/Unity/Packages/manifest.json",
    "content": "{\n  \"dependencies\": {\n    \"com.unity.ide.rider\": \"3.0.24\",\n    \"com.unity.test-framework\": \"1.1.33\",\n    \"com.unity.modules.ai\": \"1.0.0\",\n    \"com.unity.modules.androidjni\": \"1.0.0\",\n    \"com.unity.modules.animation\": \"1.0.0\",\n    \"com.unity.modules.assetbundle\": \"1.0.0\",\n    \"com.unity.modules.audio\": \"1.0.0\",\n    \"com.unity.modules.cloth\": \"1.0.0\",\n    \"com.unity.modules.director\": \"1.0.0\",\n    \"com.unity.modules.imageconversion\": \"1.0.0\",\n    \"com.unity.modules.imgui\": \"1.0.0\",\n    \"com.unity.modules.jsonserialize\": \"1.0.0\",\n    \"com.unity.modules.particlesystem\": \"1.0.0\",\n    \"com.unity.modules.physics\": \"1.0.0\",\n    \"com.unity.modules.physics2d\": \"1.0.0\",\n    \"com.unity.modules.screencapture\": \"1.0.0\",\n    \"com.unity.modules.terrain\": \"1.0.0\",\n    \"com.unity.modules.terrainphysics\": \"1.0.0\",\n    \"com.unity.modules.tilemap\": \"1.0.0\",\n    \"com.unity.modules.ui\": \"1.0.0\",\n    \"com.unity.modules.uielements\": \"1.0.0\",\n    \"com.unity.modules.umbra\": \"1.0.0\",\n    \"com.unity.modules.unityanalytics\": \"1.0.0\",\n    \"com.unity.modules.unitywebrequest\": \"1.0.0\",\n    \"com.unity.modules.unitywebrequestassetbundle\": \"1.0.0\",\n    \"com.unity.modules.unitywebrequestaudio\": \"1.0.0\",\n    \"com.unity.modules.unitywebrequesttexture\": \"1.0.0\",\n    \"com.unity.modules.unitywebrequestwww\": \"1.0.0\",\n    \"com.unity.modules.vehicles\": \"1.0.0\",\n    \"com.unity.modules.video\": \"1.0.0\",\n    \"com.unity.modules.vr\": \"1.0.0\",\n    \"com.unity.modules.wind\": \"1.0.0\",\n    \"com.unity.modules.xr\": \"1.0.0\"\n  }\n}\n"
  },
  {
    "path": "samples/Unity/Packages/packages-lock.json",
    "content": "{\n  \"dependencies\": {\n    \"com.unity.ext.nunit\": {\n      \"version\": \"1.0.6\",\n      \"depth\": 1,\n      \"source\": \"registry\",\n      \"dependencies\": {},\n      \"url\": \"https://packages.unity.com\"\n    },\n    \"com.unity.ide.rider\": {\n      \"version\": \"3.0.24\",\n      \"depth\": 0,\n      \"source\": \"registry\",\n      \"dependencies\": {\n        \"com.unity.ext.nunit\": \"1.0.6\"\n      },\n      \"url\": \"https://packages.unity.com\"\n    },\n    \"com.unity.test-framework\": {\n      \"version\": \"1.1.33\",\n      \"depth\": 0,\n      \"source\": \"registry\",\n      \"dependencies\": {\n        \"com.unity.ext.nunit\": \"1.0.6\",\n        \"com.unity.modules.imgui\": \"1.0.0\",\n        \"com.unity.modules.jsonserialize\": \"1.0.0\"\n      },\n      \"url\": \"https://packages.unity.com\"\n    },\n    \"com.unity.modules.ai\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.androidjni\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.animation\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.assetbundle\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.audio\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.cloth\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.physics\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.director\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.audio\": \"1.0.0\",\n        \"com.unity.modules.animation\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.imageconversion\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.imgui\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.jsonserialize\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.particlesystem\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.physics\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.physics2d\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.screencapture\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.imageconversion\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.subsystems\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 1,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.jsonserialize\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.terrain\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.terrainphysics\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.physics\": \"1.0.0\",\n        \"com.unity.modules.terrain\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.tilemap\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.physics2d\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.ui\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.uielements\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.ui\": \"1.0.0\",\n        \"com.unity.modules.imgui\": \"1.0.0\",\n        \"com.unity.modules.jsonserialize\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.umbra\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.unityanalytics\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.unitywebrequest\": \"1.0.0\",\n        \"com.unity.modules.jsonserialize\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.unitywebrequest\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.unitywebrequestassetbundle\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.assetbundle\": \"1.0.0\",\n        \"com.unity.modules.unitywebrequest\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.unitywebrequestaudio\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.unitywebrequest\": \"1.0.0\",\n        \"com.unity.modules.audio\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.unitywebrequesttexture\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.unitywebrequest\": \"1.0.0\",\n        \"com.unity.modules.imageconversion\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.unitywebrequestwww\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.unitywebrequest\": \"1.0.0\",\n        \"com.unity.modules.unitywebrequestassetbundle\": \"1.0.0\",\n        \"com.unity.modules.unitywebrequestaudio\": \"1.0.0\",\n        \"com.unity.modules.audio\": \"1.0.0\",\n        \"com.unity.modules.assetbundle\": \"1.0.0\",\n        \"com.unity.modules.imageconversion\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.vehicles\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.physics\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.video\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.audio\": \"1.0.0\",\n        \"com.unity.modules.ui\": \"1.0.0\",\n        \"com.unity.modules.unitywebrequest\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.vr\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.jsonserialize\": \"1.0.0\",\n        \"com.unity.modules.physics\": \"1.0.0\",\n        \"com.unity.modules.xr\": \"1.0.0\"\n      }\n    },\n    \"com.unity.modules.wind\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {}\n    },\n    \"com.unity.modules.xr\": {\n      \"version\": \"1.0.0\",\n      \"depth\": 0,\n      \"source\": \"builtin\",\n      \"dependencies\": {\n        \"com.unity.modules.physics\": \"1.0.0\",\n        \"com.unity.modules.jsonserialize\": \"1.0.0\",\n        \"com.unity.modules.subsystems\": \"1.0.0\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/AudioManager.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!11 &1\nAudioManager:\n  m_ObjectHideFlags: 0\n  serializedVersion: 2\n  m_Volume: 1\n  Rolloff Scale: 1\n  Doppler Factor: 1\n  Default Speaker Mode: 2\n  m_SampleRate: 0\n  m_DSPBufferSize: 1024\n  m_VirtualVoiceCount: 512\n  m_RealVoiceCount: 32\n  m_SpatializerPlugin: \n  m_AmbisonicDecoderPlugin: \n  m_DisableAudio: 0\n  m_VirtualizeEffects: 1\n  m_RequestedDSPBufferSize: 1024\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/ClusterInputManager.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!236 &1\nClusterInputManager:\n  m_ObjectHideFlags: 0\n  m_Inputs: []\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/DynamicsManager.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!55 &1\nPhysicsManager:\n  m_ObjectHideFlags: 0\n  serializedVersion: 11\n  m_Gravity: {x: 0, y: -9.81, z: 0}\n  m_DefaultMaterial: {fileID: 0}\n  m_BounceThreshold: 2\n  m_SleepThreshold: 0.005\n  m_DefaultContactOffset: 0.01\n  m_DefaultSolverIterations: 6\n  m_DefaultSolverVelocityIterations: 1\n  m_QueriesHitBackfaces: 0\n  m_QueriesHitTriggers: 1\n  m_EnableAdaptiveForce: 0\n  m_ClothInterCollisionDistance: 0\n  m_ClothInterCollisionStiffness: 0\n  m_ContactsGeneration: 1\n  m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n  m_AutoSimulation: 1\n  m_AutoSyncTransforms: 0\n  m_ReuseCollisionCallbacks: 1\n  m_ClothInterCollisionSettingsToggle: 0\n  m_ContactPairsMode: 0\n  m_BroadphaseType: 0\n  m_WorldBounds:\n    m_Center: {x: 0, y: 0, z: 0}\n    m_Extent: {x: 250, y: 250, z: 250}\n  m_WorldSubdivisions: 8\n  m_FrictionType: 0\n  m_EnableEnhancedDeterminism: 0\n  m_EnableUnifiedHeightmaps: 1\n  m_DefaultMaxAngluarSpeed: 7\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/EditorBuildSettings.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!1045 &1\nEditorBuildSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 2\n  m_Scenes: []\n  m_configObjects: {}\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/EditorSettings.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!159 &1\nEditorSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 11\n  m_SerializationMode: 2\n  m_LineEndingsForNewScripts: 1\n  m_DefaultBehaviorMode: 0\n  m_PrefabRegularEnvironment: {fileID: 0}\n  m_PrefabUIEnvironment: {fileID: 0}\n  m_SpritePackerMode: 0\n  m_SpritePackerPaddingPower: 1\n  m_Bc7TextureCompressor: 0\n  m_EtcTextureCompressorBehavior: 1\n  m_EtcTextureFastCompressor: 1\n  m_EtcTextureNormalCompressor: 2\n  m_EtcTextureBestCompressor: 4\n  m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref\n  m_ProjectGenerationRootNamespace: \n  m_EnableTextureStreamingInEditMode: 1\n  m_EnableTextureStreamingInPlayMode: 1\n  m_AsyncShaderCompilation: 1\n  m_CachingShaderPreprocessor: 1\n  m_PrefabModeAllowAutoSave: 1\n  m_EnterPlayModeOptionsEnabled: 0\n  m_EnterPlayModeOptions: 3\n  m_GameObjectNamingDigits: 1\n  m_GameObjectNamingScheme: 0\n  m_AssetNamingUsesSpace: 1\n  m_UseLegacyProbeSampleCount: 0\n  m_SerializeInlineMappingsOnOneLine: 1\n  m_DisableCookiesInLightmapper: 0\n  m_AssetPipelineMode: 1\n  m_RefreshImportMode: 0\n  m_CacheServerMode: 0\n  m_CacheServerEndpoint: \n  m_CacheServerNamespacePrefix: default\n  m_CacheServerEnableDownload: 1\n  m_CacheServerEnableUpload: 1\n  m_CacheServerEnableAuth: 0\n  m_CacheServerEnableTls: 0\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/GraphicsSettings.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!30 &1\nGraphicsSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 13\n  m_Deferred:\n    m_Mode: 1\n    m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}\n  m_DeferredReflections:\n    m_Mode: 1\n    m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}\n  m_ScreenSpaceShadows:\n    m_Mode: 1\n    m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}\n  m_LegacyDeferred:\n    m_Mode: 1\n    m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}\n  m_DepthNormals:\n    m_Mode: 1\n    m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}\n  m_MotionVectors:\n    m_Mode: 1\n    m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}\n  m_LightHalo:\n    m_Mode: 1\n    m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}\n  m_LensFlare:\n    m_Mode: 1\n    m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}\n  m_AlwaysIncludedShaders:\n  - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}\n  - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}\n  - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}\n  - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}\n  - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}\n  - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}\n  m_PreloadedShaders: []\n  m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,\n    type: 0}\n  m_CustomRenderPipeline: {fileID: 0}\n  m_TransparencySortMode: 0\n  m_TransparencySortAxis: {x: 0, y: 0, z: 1}\n  m_DefaultRenderingPath: 1\n  m_DefaultMobileRenderingPath: 1\n  m_TierSettings: []\n  m_LightmapStripping: 0\n  m_FogStripping: 0\n  m_InstancingStripping: 0\n  m_LightmapKeepPlain: 1\n  m_LightmapKeepDirCombined: 1\n  m_LightmapKeepDynamicPlain: 1\n  m_LightmapKeepDynamicDirCombined: 1\n  m_LightmapKeepShadowMask: 1\n  m_LightmapKeepSubtractive: 1\n  m_FogKeepLinear: 1\n  m_FogKeepExp: 1\n  m_FogKeepExp2: 1\n  m_AlbedoSwatchInfos: []\n  m_LightsUseLinearIntensity: 0\n  m_LightsUseColorTemperature: 0\n  m_LogWhenShaderIsCompiled: 0\n  m_AllowEnlightenSupportForUpgradedProject: 0\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/InputManager.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!13 &1\nInputManager:\n  m_ObjectHideFlags: 0\n  serializedVersion: 2\n  m_Axes:\n  - serializedVersion: 3\n    m_Name: Horizontal\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: left\n    positiveButton: right\n    altNegativeButton: a\n    altPositiveButton: d\n    gravity: 3\n    dead: 0.001\n    sensitivity: 3\n    snap: 1\n    invert: 0\n    type: 0\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Vertical\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: down\n    positiveButton: up\n    altNegativeButton: s\n    altPositiveButton: w\n    gravity: 3\n    dead: 0.001\n    sensitivity: 3\n    snap: 1\n    invert: 0\n    type: 0\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Fire1\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: left ctrl\n    altNegativeButton: \n    altPositiveButton: mouse 0\n    gravity: 1000\n    dead: 0.001\n    sensitivity: 1000\n    snap: 0\n    invert: 0\n    type: 0\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Fire2\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: left alt\n    altNegativeButton: \n    altPositiveButton: mouse 1\n    gravity: 1000\n    dead: 0.001\n    sensitivity: 1000\n    snap: 0\n    invert: 0\n    type: 0\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Fire3\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: left shift\n    altNegativeButton: \n    altPositiveButton: mouse 2\n    gravity: 1000\n    dead: 0.001\n    sensitivity: 1000\n    snap: 0\n    invert: 0\n    type: 0\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Jump\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: space\n    altNegativeButton: \n    altPositiveButton: \n    gravity: 1000\n    dead: 0.001\n    sensitivity: 1000\n    snap: 0\n    invert: 0\n    type: 0\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Mouse X\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: \n    altNegativeButton: \n    altPositiveButton: \n    gravity: 0\n    dead: 0\n    sensitivity: 0.1\n    snap: 0\n    invert: 0\n    type: 1\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Mouse Y\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: \n    altNegativeButton: \n    altPositiveButton: \n    gravity: 0\n    dead: 0\n    sensitivity: 0.1\n    snap: 0\n    invert: 0\n    type: 1\n    axis: 1\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Mouse ScrollWheel\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: \n    altNegativeButton: \n    altPositiveButton: \n    gravity: 0\n    dead: 0\n    sensitivity: 0.1\n    snap: 0\n    invert: 0\n    type: 1\n    axis: 2\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Horizontal\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: \n    altNegativeButton: \n    altPositiveButton: \n    gravity: 0\n    dead: 0.19\n    sensitivity: 1\n    snap: 0\n    invert: 0\n    type: 2\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Vertical\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: \n    altNegativeButton: \n    altPositiveButton: \n    gravity: 0\n    dead: 0.19\n    sensitivity: 1\n    snap: 0\n    invert: 1\n    type: 2\n    axis: 1\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Fire1\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: joystick button 0\n    altNegativeButton: \n    altPositiveButton: \n    gravity: 1000\n    dead: 0.001\n    sensitivity: 1000\n    snap: 0\n    invert: 0\n    type: 0\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Fire2\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: joystick button 1\n    altNegativeButton: \n    altPositiveButton: \n    gravity: 1000\n    dead: 0.001\n    sensitivity: 1000\n    snap: 0\n    invert: 0\n    type: 0\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Fire3\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: joystick button 2\n    altNegativeButton: \n    altPositiveButton: \n    gravity: 1000\n    dead: 0.001\n    sensitivity: 1000\n    snap: 0\n    invert: 0\n    type: 0\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Jump\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: joystick button 3\n    altNegativeButton: \n    altPositiveButton: \n    gravity: 1000\n    dead: 0.001\n    sensitivity: 1000\n    snap: 0\n    invert: 0\n    type: 0\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Submit\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: return\n    altNegativeButton: \n    altPositiveButton: joystick button 0\n    gravity: 1000\n    dead: 0.001\n    sensitivity: 1000\n    snap: 0\n    invert: 0\n    type: 0\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Submit\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: enter\n    altNegativeButton: \n    altPositiveButton: space\n    gravity: 1000\n    dead: 0.001\n    sensitivity: 1000\n    snap: 0\n    invert: 0\n    type: 0\n    axis: 0\n    joyNum: 0\n  - serializedVersion: 3\n    m_Name: Cancel\n    descriptiveName: \n    descriptiveNegativeName: \n    negativeButton: \n    positiveButton: escape\n    altNegativeButton: \n    altPositiveButton: joystick button 1\n    gravity: 1000\n    dead: 0.001\n    sensitivity: 1000\n    snap: 0\n    invert: 0\n    type: 0\n    axis: 0\n    joyNum: 0\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/MemorySettings.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!387306366 &1\nMemorySettings:\n  m_ObjectHideFlags: 0\n  m_EditorMemorySettings:\n    m_MainAllocatorBlockSize: -1\n    m_ThreadAllocatorBlockSize: -1\n    m_MainGfxBlockSize: -1\n    m_ThreadGfxBlockSize: -1\n    m_CacheBlockSize: -1\n    m_TypetreeBlockSize: -1\n    m_ProfilerBlockSize: -1\n    m_ProfilerEditorBlockSize: -1\n    m_BucketAllocatorGranularity: -1\n    m_BucketAllocatorBucketsCount: -1\n    m_BucketAllocatorBlockSize: -1\n    m_BucketAllocatorBlockCount: -1\n    m_ProfilerBucketAllocatorGranularity: -1\n    m_ProfilerBucketAllocatorBucketsCount: -1\n    m_ProfilerBucketAllocatorBlockSize: -1\n    m_ProfilerBucketAllocatorBlockCount: -1\n    m_TempAllocatorSizeMain: -1\n    m_JobTempAllocatorBlockSize: -1\n    m_BackgroundJobTempAllocatorBlockSize: -1\n    m_JobTempAllocatorReducedBlockSize: -1\n    m_TempAllocatorSizeGIBakingWorker: -1\n    m_TempAllocatorSizeNavMeshWorker: -1\n    m_TempAllocatorSizeAudioWorker: -1\n    m_TempAllocatorSizeCloudWorker: -1\n    m_TempAllocatorSizeGfx: -1\n    m_TempAllocatorSizeJobWorker: -1\n    m_TempAllocatorSizeBackgroundWorker: -1\n    m_TempAllocatorSizePreloadManager: -1\n  m_PlatformMemorySettings: {}\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/NavMeshAreas.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!126 &1\nNavMeshProjectSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 2\n  areas:\n  - name: Walkable\n    cost: 1\n  - name: Not Walkable\n    cost: 1\n  - name: Jump\n    cost: 2\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  - name: \n    cost: 1\n  m_LastAgentTypeID: -887442657\n  m_Settings:\n  - serializedVersion: 2\n    agentTypeID: 0\n    agentRadius: 0.5\n    agentHeight: 2\n    agentSlope: 45\n    agentClimb: 0.75\n    ledgeDropHeight: 0\n    maxJumpAcrossDistance: 0\n    minRegionArea: 2\n    manualCellSize: 0\n    cellSize: 0.16666667\n    manualTileSize: 0\n    tileSize: 256\n    accuratePlacement: 0\n    debug:\n      m_Flags: 0\n  m_SettingNames:\n  - Humanoid\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/PackageManagerSettings.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!114 &1\nMonoBehaviour:\n  m_ObjectHideFlags: 61\n  m_CorrespondingSourceObject: {fileID: 0}\n  m_PrefabInstance: {fileID: 0}\n  m_PrefabAsset: {fileID: 0}\n  m_GameObject: {fileID: 0}\n  m_Enabled: 1\n  m_EditorHideFlags: 0\n  m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0}\n  m_Name: \n  m_EditorClassIdentifier: \n  m_EnablePreReleasePackages: 0\n  m_EnablePackageDependencies: 0\n  m_AdvancedSettingsExpanded: 1\n  m_ScopedRegistriesSettingsExpanded: 1\n  m_SeeAllPackageVersions: 0\n  oneTimeWarningShown: 0\n  m_Registries:\n  - m_Id: main\n    m_Name: \n    m_Url: https://packages.unity.com\n    m_Scopes: []\n    m_IsDefault: 1\n    m_Capabilities: 7\n  m_UserSelectedRegistryName: \n  m_UserAddingNewScopedRegistry: 0\n  m_RegistryInfoDraft:\n    m_Modified: 0\n    m_ErrorMessage: \n    m_UserModificationsInstanceId: -830\n    m_OriginalInstanceId: -832\n  m_LoadAssets: 0\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/Physics2DSettings.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!19 &1\nPhysics2DSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 4\n  m_Gravity: {x: 0, y: -9.81}\n  m_DefaultMaterial: {fileID: 0}\n  m_VelocityIterations: 8\n  m_PositionIterations: 3\n  m_VelocityThreshold: 1\n  m_MaxLinearCorrection: 0.2\n  m_MaxAngularCorrection: 8\n  m_MaxTranslationSpeed: 100\n  m_MaxRotationSpeed: 360\n  m_BaumgarteScale: 0.2\n  m_BaumgarteTimeOfImpactScale: 0.75\n  m_TimeToSleep: 0.5\n  m_LinearSleepTolerance: 0.01\n  m_AngularSleepTolerance: 2\n  m_DefaultContactOffset: 0.01\n  m_JobOptions:\n    serializedVersion: 2\n    useMultithreading: 0\n    useConsistencySorting: 0\n    m_InterpolationPosesPerJob: 100\n    m_NewContactsPerJob: 30\n    m_CollideContactsPerJob: 100\n    m_ClearFlagsPerJob: 200\n    m_ClearBodyForcesPerJob: 200\n    m_SyncDiscreteFixturesPerJob: 50\n    m_SyncContinuousFixturesPerJob: 50\n    m_FindNearestContactsPerJob: 100\n    m_UpdateTriggerContactsPerJob: 100\n    m_IslandSolverCostThreshold: 100\n    m_IslandSolverBodyCostScale: 1\n    m_IslandSolverContactCostScale: 10\n    m_IslandSolverJointCostScale: 10\n    m_IslandSolverBodiesPerJob: 50\n    m_IslandSolverContactsPerJob: 50\n  m_AutoSimulation: 1\n  m_QueriesHitTriggers: 1\n  m_QueriesStartInColliders: 1\n  m_CallbacksOnDisable: 1\n  m_ReuseCollisionCallbacks: 1\n  m_AutoSyncTransforms: 0\n  m_AlwaysShowColliders: 0\n  m_ShowColliderSleep: 1\n  m_ShowColliderContacts: 0\n  m_ShowColliderAABB: 0\n  m_ContactArrowScale: 0.2\n  m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}\n  m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}\n  m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}\n  m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}\n  m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/PresetManager.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!1386491679 &1\nPresetManager:\n  m_ObjectHideFlags: 0\n  serializedVersion: 2\n  m_DefaultPresets: {}\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/ProjectSettings.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!129 &1\nPlayerSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 23\n  productGUID: b98e35bd39cfe4a29bca36f0d9bf339f\n  AndroidProfiler: 0\n  AndroidFilterTouchesWhenObscured: 0\n  AndroidEnableSustainedPerformanceMode: 0\n  defaultScreenOrientation: 4\n  targetDevice: 2\n  useOnDemandResources: 0\n  accelerometerFrequency: 60\n  companyName: DefaultCompany\n  productName: Unity-2021.3\n  defaultCursor: {fileID: 0}\n  cursorHotspot: {x: 0, y: 0}\n  m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}\n  m_ShowUnitySplashScreen: 1\n  m_ShowUnitySplashLogo: 1\n  m_SplashScreenOverlayOpacity: 1\n  m_SplashScreenAnimation: 1\n  m_SplashScreenLogoStyle: 1\n  m_SplashScreenDrawMode: 0\n  m_SplashScreenBackgroundAnimationZoom: 1\n  m_SplashScreenLogoAnimationZoom: 1\n  m_SplashScreenBackgroundLandscapeAspect: 1\n  m_SplashScreenBackgroundPortraitAspect: 1\n  m_SplashScreenBackgroundLandscapeUvs:\n    serializedVersion: 2\n    x: 0\n    y: 0\n    width: 1\n    height: 1\n  m_SplashScreenBackgroundPortraitUvs:\n    serializedVersion: 2\n    x: 0\n    y: 0\n    width: 1\n    height: 1\n  m_SplashScreenLogos: []\n  m_VirtualRealitySplashScreen: {fileID: 0}\n  m_HolographicTrackingLossScreen: {fileID: 0}\n  defaultScreenWidth: 1920\n  defaultScreenHeight: 1080\n  defaultScreenWidthWeb: 960\n  defaultScreenHeightWeb: 600\n  m_StereoRenderingPath: 0\n  m_ActiveColorSpace: 0\n  m_MTRendering: 1\n  mipStripping: 0\n  numberOfMipsStripped: 0\n  m_StackTraceTypes: 010000000100000001000000010000000100000001000000\n  iosShowActivityIndicatorOnLoading: -1\n  androidShowActivityIndicatorOnLoading: -1\n  iosUseCustomAppBackgroundBehavior: 0\n  iosAllowHTTPDownload: 1\n  allowedAutorotateToPortrait: 1\n  allowedAutorotateToPortraitUpsideDown: 1\n  allowedAutorotateToLandscapeRight: 1\n  allowedAutorotateToLandscapeLeft: 1\n  useOSAutorotation: 1\n  use32BitDisplayBuffer: 1\n  preserveFramebufferAlpha: 0\n  disableDepthAndStencilBuffers: 0\n  androidStartInFullscreen: 1\n  androidRenderOutsideSafeArea: 1\n  androidUseSwappy: 1\n  androidBlitType: 0\n  androidResizableWindow: 0\n  androidDefaultWindowWidth: 1920\n  androidDefaultWindowHeight: 1080\n  androidMinimumWindowWidth: 400\n  androidMinimumWindowHeight: 300\n  androidFullscreenMode: 1\n  defaultIsNativeResolution: 1\n  macRetinaSupport: 1\n  runInBackground: 1\n  captureSingleScreen: 0\n  muteOtherAudioSources: 0\n  Prepare IOS For Recording: 0\n  Force IOS Speakers When Recording: 0\n  deferSystemGesturesMode: 0\n  hideHomeButton: 0\n  submitAnalytics: 1\n  usePlayerLog: 1\n  bakeCollisionMeshes: 0\n  forceSingleInstance: 0\n  useFlipModelSwapchain: 1\n  resizableWindow: 0\n  useMacAppStoreValidation: 0\n  macAppStoreCategory: public.app-category.games\n  gpuSkinning: 1\n  xboxPIXTextureCapture: 0\n  xboxEnableAvatar: 0\n  xboxEnableKinect: 0\n  xboxEnableKinectAutoTracking: 0\n  xboxEnableFitness: 0\n  visibleInBackground: 1\n  allowFullscreenSwitch: 1\n  fullscreenMode: 1\n  xboxSpeechDB: 0\n  xboxEnableHeadOrientation: 0\n  xboxEnableGuest: 0\n  xboxEnablePIXSampling: 0\n  metalFramebufferOnly: 0\n  xboxOneResolution: 0\n  xboxOneSResolution: 0\n  xboxOneXResolution: 3\n  xboxOneMonoLoggingLevel: 0\n  xboxOneLoggingLevel: 1\n  xboxOneDisableEsram: 0\n  xboxOneEnableTypeOptimization: 0\n  xboxOnePresentImmediateThreshold: 0\n  switchQueueCommandMemory: 0\n  switchQueueControlMemory: 16384\n  switchQueueComputeMemory: 262144\n  switchNVNShaderPoolsGranularity: 33554432\n  switchNVNDefaultPoolsGranularity: 16777216\n  switchNVNOtherPoolsGranularity: 16777216\n  switchNVNMaxPublicTextureIDCount: 0\n  switchNVNMaxPublicSamplerIDCount: 0\n  stadiaPresentMode: 0\n  stadiaTargetFramerate: 0\n  vulkanNumSwapchainBuffers: 3\n  vulkanEnableSetSRGBWrite: 0\n  vulkanEnablePreTransform: 1\n  vulkanEnableLateAcquireNextImage: 0\n  vulkanEnableCommandBufferRecycling: 1\n  m_SupportedAspectRatios:\n    4:3: 1\n    5:4: 1\n    16:10: 1\n    16:9: 1\n    Others: 1\n  bundleVersion: 0.1\n  preloadedAssets: []\n  metroInputSource: 0\n  wsaTransparentSwapchain: 0\n  m_HolographicPauseOnTrackingLoss: 1\n  xboxOneDisableKinectGpuReservation: 1\n  xboxOneEnable7thCore: 1\n  vrSettings:\n    enable360StereoCapture: 0\n  isWsaHolographicRemotingEnabled: 0\n  enableFrameTimingStats: 0\n  useHDRDisplay: 0\n  D3DHDRBitDepth: 0\n  m_ColorGamuts: 00000000\n  targetPixelDensity: 30\n  resolutionScalingMode: 0\n  androidSupportedAspectRatio: 1\n  androidMaxAspectRatio: 2.1\n  applicationIdentifier:\n    Standalone: com.DefaultCompany.Unity-2021.3\n  buildNumber:\n    Standalone: 0\n    iPhone: 0\n    tvOS: 0\n  overrideDefaultApplicationIdentifier: 0\n  AndroidBundleVersionCode: 1\n  AndroidMinSdkVersion: 22\n  AndroidTargetSdkVersion: 0\n  AndroidPreferredInstallLocation: 1\n  aotOptions: \n  stripEngineCode: 1\n  iPhoneStrippingLevel: 0\n  iPhoneScriptCallOptimization: 0\n  ForceInternetPermission: 0\n  ForceSDCardPermission: 0\n  CreateWallpaper: 0\n  APKExpansionFiles: 0\n  keepLoadedShadersAlive: 0\n  StripUnusedMeshComponents: 1\n  VertexChannelCompressionMask: 4054\n  iPhoneSdkVersion: 988\n  iOSTargetOSVersionString: 11.0\n  tvOSSdkVersion: 0\n  tvOSRequireExtendedGameController: 0\n  tvOSTargetOSVersionString: 11.0\n  uIPrerenderedIcon: 0\n  uIRequiresPersistentWiFi: 0\n  uIRequiresFullScreen: 1\n  uIStatusBarHidden: 1\n  uIExitOnSuspend: 0\n  uIStatusBarStyle: 0\n  appleTVSplashScreen: {fileID: 0}\n  appleTVSplashScreen2x: {fileID: 0}\n  tvOSSmallIconLayers: []\n  tvOSSmallIconLayers2x: []\n  tvOSLargeIconLayers: []\n  tvOSLargeIconLayers2x: []\n  tvOSTopShelfImageLayers: []\n  tvOSTopShelfImageLayers2x: []\n  tvOSTopShelfImageWideLayers: []\n  tvOSTopShelfImageWideLayers2x: []\n  iOSLaunchScreenType: 0\n  iOSLaunchScreenPortrait: {fileID: 0}\n  iOSLaunchScreenLandscape: {fileID: 0}\n  iOSLaunchScreenBackgroundColor:\n    serializedVersion: 2\n    rgba: 0\n  iOSLaunchScreenFillPct: 100\n  iOSLaunchScreenSize: 100\n  iOSLaunchScreenCustomXibPath: \n  iOSLaunchScreeniPadType: 0\n  iOSLaunchScreeniPadImage: {fileID: 0}\n  iOSLaunchScreeniPadBackgroundColor:\n    serializedVersion: 2\n    rgba: 0\n  iOSLaunchScreeniPadFillPct: 100\n  iOSLaunchScreeniPadSize: 100\n  iOSLaunchScreeniPadCustomXibPath: \n  iOSLaunchScreenCustomStoryboardPath: \n  iOSLaunchScreeniPadCustomStoryboardPath: \n  iOSDeviceRequirements: []\n  iOSURLSchemes: []\n  macOSURLSchemes: []\n  iOSBackgroundModes: 0\n  iOSMetalForceHardShadows: 0\n  metalEditorSupport: 1\n  metalAPIValidation: 1\n  iOSRenderExtraFrameOnPause: 0\n  iosCopyPluginsCodeInsteadOfSymlink: 0\n  appleDeveloperTeamID: \n  iOSManualSigningProvisioningProfileID: \n  tvOSManualSigningProvisioningProfileID: \n  iOSManualSigningProvisioningProfileType: 0\n  tvOSManualSigningProvisioningProfileType: 0\n  appleEnableAutomaticSigning: 0\n  iOSRequireARKit: 0\n  iOSAutomaticallyDetectAndAddCapabilities: 1\n  appleEnableProMotion: 0\n  shaderPrecisionModel: 0\n  clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea\n  templatePackageId: com.unity.template.3d@8.1.0\n  templateDefaultScene: Assets/Scenes/SampleScene.unity\n  useCustomMainManifest: 0\n  useCustomLauncherManifest: 0\n  useCustomMainGradleTemplate: 0\n  useCustomLauncherGradleManifest: 0\n  useCustomBaseGradleTemplate: 0\n  useCustomGradlePropertiesTemplate: 0\n  useCustomProguardFile: 0\n  AndroidTargetArchitectures: 1\n  AndroidTargetDevices: 0\n  AndroidSplashScreenScale: 0\n  androidSplashScreen: {fileID: 0}\n  AndroidKeystoreName: \n  AndroidKeyaliasName: \n  AndroidBuildApkPerCpuArchitecture: 0\n  AndroidTVCompatibility: 0\n  AndroidIsGame: 1\n  AndroidEnableTango: 0\n  androidEnableBanner: 1\n  androidUseLowAccuracyLocation: 0\n  androidUseCustomKeystore: 0\n  m_AndroidBanners:\n  - width: 320\n    height: 180\n    banner: {fileID: 0}\n  androidGamepadSupportLevel: 0\n  chromeosInputEmulation: 1\n  AndroidMinifyWithR8: 0\n  AndroidMinifyRelease: 0\n  AndroidMinifyDebug: 0\n  AndroidValidateAppBundleSize: 1\n  AndroidAppBundleSizeToValidate: 150\n  m_BuildTargetIcons: []\n  m_BuildTargetPlatformIcons:\n  - m_BuildTarget: iPhone\n    m_Icons:\n    - m_Textures: []\n      m_Width: 180\n      m_Height: 180\n      m_Kind: 0\n      m_SubKind: iPhone\n    - m_Textures: []\n      m_Width: 120\n      m_Height: 120\n      m_Kind: 0\n      m_SubKind: iPhone\n    - m_Textures: []\n      m_Width: 167\n      m_Height: 167\n      m_Kind: 0\n      m_SubKind: iPad\n    - m_Textures: []\n      m_Width: 152\n      m_Height: 152\n      m_Kind: 0\n      m_SubKind: iPad\n    - m_Textures: []\n      m_Width: 76\n      m_Height: 76\n      m_Kind: 0\n      m_SubKind: iPad\n    - m_Textures: []\n      m_Width: 120\n      m_Height: 120\n      m_Kind: 3\n      m_SubKind: iPhone\n    - m_Textures: []\n      m_Width: 80\n      m_Height: 80\n      m_Kind: 3\n      m_SubKind: iPhone\n    - m_Textures: []\n      m_Width: 80\n      m_Height: 80\n      m_Kind: 3\n      m_SubKind: iPad\n    - m_Textures: []\n      m_Width: 40\n      m_Height: 40\n      m_Kind: 3\n      m_SubKind: iPad\n    - m_Textures: []\n      m_Width: 87\n      m_Height: 87\n      m_Kind: 1\n      m_SubKind: iPhone\n    - m_Textures: []\n      m_Width: 58\n      m_Height: 58\n      m_Kind: 1\n      m_SubKind: iPhone\n    - m_Textures: []\n      m_Width: 29\n      m_Height: 29\n      m_Kind: 1\n      m_SubKind: iPhone\n    - m_Textures: []\n      m_Width: 58\n      m_Height: 58\n      m_Kind: 1\n      m_SubKind: iPad\n    - m_Textures: []\n      m_Width: 29\n      m_Height: 29\n      m_Kind: 1\n      m_SubKind: iPad\n    - m_Textures: []\n      m_Width: 60\n      m_Height: 60\n      m_Kind: 2\n      m_SubKind: iPhone\n    - m_Textures: []\n      m_Width: 40\n      m_Height: 40\n      m_Kind: 2\n      m_SubKind: iPhone\n    - m_Textures: []\n      m_Width: 40\n      m_Height: 40\n      m_Kind: 2\n      m_SubKind: iPad\n    - m_Textures: []\n      m_Width: 20\n      m_Height: 20\n      m_Kind: 2\n      m_SubKind: iPad\n    - m_Textures: []\n      m_Width: 1024\n      m_Height: 1024\n      m_Kind: 4\n      m_SubKind: App Store\n  - m_BuildTarget: Android\n    m_Icons:\n    - m_Textures: []\n      m_Width: 432\n      m_Height: 432\n      m_Kind: 2\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 324\n      m_Height: 324\n      m_Kind: 2\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 216\n      m_Height: 216\n      m_Kind: 2\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 162\n      m_Height: 162\n      m_Kind: 2\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 108\n      m_Height: 108\n      m_Kind: 2\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 81\n      m_Height: 81\n      m_Kind: 2\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 192\n      m_Height: 192\n      m_Kind: 1\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 144\n      m_Height: 144\n      m_Kind: 1\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 96\n      m_Height: 96\n      m_Kind: 1\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 72\n      m_Height: 72\n      m_Kind: 1\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 48\n      m_Height: 48\n      m_Kind: 1\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 36\n      m_Height: 36\n      m_Kind: 1\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 192\n      m_Height: 192\n      m_Kind: 0\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 144\n      m_Height: 144\n      m_Kind: 0\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 96\n      m_Height: 96\n      m_Kind: 0\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 72\n      m_Height: 72\n      m_Kind: 0\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 48\n      m_Height: 48\n      m_Kind: 0\n      m_SubKind: \n    - m_Textures: []\n      m_Width: 36\n      m_Height: 36\n      m_Kind: 0\n      m_SubKind: \n  m_BuildTargetBatching:\n  - m_BuildTarget: Standalone\n    m_StaticBatching: 1\n    m_DynamicBatching: 0\n  - m_BuildTarget: tvOS\n    m_StaticBatching: 1\n    m_DynamicBatching: 0\n  - m_BuildTarget: Android\n    m_StaticBatching: 1\n    m_DynamicBatching: 0\n  - m_BuildTarget: iPhone\n    m_StaticBatching: 1\n    m_DynamicBatching: 0\n  - m_BuildTarget: WebGL\n    m_StaticBatching: 0\n    m_DynamicBatching: 0\n  m_BuildTargetGraphicsJobs:\n  - m_BuildTarget: MacStandaloneSupport\n    m_GraphicsJobs: 0\n  - m_BuildTarget: Switch\n    m_GraphicsJobs: 1\n  - m_BuildTarget: MetroSupport\n    m_GraphicsJobs: 1\n  - m_BuildTarget: AppleTVSupport\n    m_GraphicsJobs: 0\n  - m_BuildTarget: BJMSupport\n    m_GraphicsJobs: 1\n  - m_BuildTarget: LinuxStandaloneSupport\n    m_GraphicsJobs: 1\n  - m_BuildTarget: PS4Player\n    m_GraphicsJobs: 1\n  - m_BuildTarget: iOSSupport\n    m_GraphicsJobs: 0\n  - m_BuildTarget: WindowsStandaloneSupport\n    m_GraphicsJobs: 1\n  - m_BuildTarget: XboxOnePlayer\n    m_GraphicsJobs: 1\n  - m_BuildTarget: LuminSupport\n    m_GraphicsJobs: 0\n  - m_BuildTarget: AndroidPlayer\n    m_GraphicsJobs: 0\n  - m_BuildTarget: WebGLSupport\n    m_GraphicsJobs: 0\n  m_BuildTargetGraphicsJobMode:\n  - m_BuildTarget: PS4Player\n    m_GraphicsJobMode: 0\n  - m_BuildTarget: XboxOnePlayer\n    m_GraphicsJobMode: 0\n  m_BuildTargetGraphicsAPIs:\n  - m_BuildTarget: AndroidPlayer\n    m_APIs: 150000000b000000\n    m_Automatic: 1\n  - m_BuildTarget: iOSSupport\n    m_APIs: 10000000\n    m_Automatic: 1\n  - m_BuildTarget: AppleTVSupport\n    m_APIs: 10000000\n    m_Automatic: 1\n  - m_BuildTarget: WebGLSupport\n    m_APIs: 0b000000\n    m_Automatic: 1\n  m_BuildTargetVRSettings:\n  - m_BuildTarget: Standalone\n    m_Enabled: 0\n    m_Devices:\n    - Oculus\n    - OpenVR\n  openGLRequireES31: 0\n  openGLRequireES31AEP: 0\n  openGLRequireES32: 0\n  m_TemplateCustomTags: {}\n  mobileMTRendering:\n    Android: 1\n    iPhone: 1\n    tvOS: 1\n  m_BuildTargetGroupLightmapEncodingQuality:\n  - m_BuildTarget: Android\n    m_EncodingQuality: 1\n  - m_BuildTarget: iPhone\n    m_EncodingQuality: 1\n  - m_BuildTarget: tvOS\n    m_EncodingQuality: 1\n  m_BuildTargetGroupLightmapSettings: []\n  m_BuildTargetNormalMapEncoding:\n  - m_BuildTarget: Android\n    m_Encoding: 1\n  - m_BuildTarget: iPhone\n    m_Encoding: 1\n  - m_BuildTarget: tvOS\n    m_Encoding: 1\n  m_BuildTargetDefaultTextureCompressionFormat:\n  - m_BuildTarget: Android\n    m_Format: 3\n  playModeTestRunnerEnabled: 0\n  runPlayModeTestAsEditModeTest: 0\n  actionOnDotNetUnhandledException: 1\n  enableInternalProfiler: 0\n  logObjCUncaughtExceptions: 1\n  enableCrashReportAPI: 0\n  cameraUsageDescription: \n  locationUsageDescription: \n  microphoneUsageDescription: \n  bluetoothUsageDescription: \n  switchNMETAOverride: \n  switchNetLibKey: \n  switchSocketMemoryPoolSize: 6144\n  switchSocketAllocatorPoolSize: 128\n  switchSocketConcurrencyLimit: 14\n  switchScreenResolutionBehavior: 2\n  switchUseCPUProfiler: 0\n  switchUseGOLDLinker: 0\n  switchLTOSetting: 0\n  switchApplicationID: 0x01004b9000490000\n  switchNSODependencies: \n  switchTitleNames_0: \n  switchTitleNames_1: \n  switchTitleNames_2: \n  switchTitleNames_3: \n  switchTitleNames_4: \n  switchTitleNames_5: \n  switchTitleNames_6: \n  switchTitleNames_7: \n  switchTitleNames_8: \n  switchTitleNames_9: \n  switchTitleNames_10: \n  switchTitleNames_11: \n  switchTitleNames_12: \n  switchTitleNames_13: \n  switchTitleNames_14: \n  switchTitleNames_15: \n  switchPublisherNames_0: \n  switchPublisherNames_1: \n  switchPublisherNames_2: \n  switchPublisherNames_3: \n  switchPublisherNames_4: \n  switchPublisherNames_5: \n  switchPublisherNames_6: \n  switchPublisherNames_7: \n  switchPublisherNames_8: \n  switchPublisherNames_9: \n  switchPublisherNames_10: \n  switchPublisherNames_11: \n  switchPublisherNames_12: \n  switchPublisherNames_13: \n  switchPublisherNames_14: \n  switchPublisherNames_15: \n  switchIcons_0: {fileID: 0}\n  switchIcons_1: {fileID: 0}\n  switchIcons_2: {fileID: 0}\n  switchIcons_3: {fileID: 0}\n  switchIcons_4: {fileID: 0}\n  switchIcons_5: {fileID: 0}\n  switchIcons_6: {fileID: 0}\n  switchIcons_7: {fileID: 0}\n  switchIcons_8: {fileID: 0}\n  switchIcons_9: {fileID: 0}\n  switchIcons_10: {fileID: 0}\n  switchIcons_11: {fileID: 0}\n  switchIcons_12: {fileID: 0}\n  switchIcons_13: {fileID: 0}\n  switchIcons_14: {fileID: 0}\n  switchIcons_15: {fileID: 0}\n  switchSmallIcons_0: {fileID: 0}\n  switchSmallIcons_1: {fileID: 0}\n  switchSmallIcons_2: {fileID: 0}\n  switchSmallIcons_3: {fileID: 0}\n  switchSmallIcons_4: {fileID: 0}\n  switchSmallIcons_5: {fileID: 0}\n  switchSmallIcons_6: {fileID: 0}\n  switchSmallIcons_7: {fileID: 0}\n  switchSmallIcons_8: {fileID: 0}\n  switchSmallIcons_9: {fileID: 0}\n  switchSmallIcons_10: {fileID: 0}\n  switchSmallIcons_11: {fileID: 0}\n  switchSmallIcons_12: {fileID: 0}\n  switchSmallIcons_13: {fileID: 0}\n  switchSmallIcons_14: {fileID: 0}\n  switchSmallIcons_15: {fileID: 0}\n  switchManualHTML: \n  switchAccessibleURLs: \n  switchLegalInformation: \n  switchMainThreadStackSize: 1048576\n  switchPresenceGroupId: \n  switchLogoHandling: 0\n  switchReleaseVersion: 0\n  switchDisplayVersion: 1.0.0\n  switchStartupUserAccount: 0\n  switchTouchScreenUsage: 0\n  switchSupportedLanguagesMask: 0\n  switchLogoType: 0\n  switchApplicationErrorCodeCategory: \n  switchUserAccountSaveDataSize: 0\n  switchUserAccountSaveDataJournalSize: 0\n  switchApplicationAttribute: 0\n  switchCardSpecSize: -1\n  switchCardSpecClock: -1\n  switchRatingsMask: 0\n  switchRatingsInt_0: 0\n  switchRatingsInt_1: 0\n  switchRatingsInt_2: 0\n  switchRatingsInt_3: 0\n  switchRatingsInt_4: 0\n  switchRatingsInt_5: 0\n  switchRatingsInt_6: 0\n  switchRatingsInt_7: 0\n  switchRatingsInt_8: 0\n  switchRatingsInt_9: 0\n  switchRatingsInt_10: 0\n  switchRatingsInt_11: 0\n  switchRatingsInt_12: 0\n  switchLocalCommunicationIds_0: \n  switchLocalCommunicationIds_1: \n  switchLocalCommunicationIds_2: \n  switchLocalCommunicationIds_3: \n  switchLocalCommunicationIds_4: \n  switchLocalCommunicationIds_5: \n  switchLocalCommunicationIds_6: \n  switchLocalCommunicationIds_7: \n  switchParentalControl: 0\n  switchAllowsScreenshot: 1\n  switchAllowsVideoCapturing: 1\n  switchAllowsRuntimeAddOnContentInstall: 0\n  switchDataLossConfirmation: 0\n  switchUserAccountLockEnabled: 0\n  switchSystemResourceMemory: 16777216\n  switchSupportedNpadStyles: 22\n  switchNativeFsCacheSize: 32\n  switchIsHoldTypeHorizontal: 0\n  switchSupportedNpadCount: 8\n  switchSocketConfigEnabled: 0\n  switchTcpInitialSendBufferSize: 32\n  switchTcpInitialReceiveBufferSize: 64\n  switchTcpAutoSendBufferSizeMax: 256\n  switchTcpAutoReceiveBufferSizeMax: 256\n  switchUdpSendBufferSize: 9\n  switchUdpReceiveBufferSize: 42\n  switchSocketBufferEfficiency: 4\n  switchSocketInitializeEnabled: 1\n  switchNetworkInterfaceManagerInitializeEnabled: 1\n  switchPlayerConnectionEnabled: 1\n  switchUseNewStyleFilepaths: 0\n  switchUseMicroSleepForYield: 1\n  switchEnableRamDiskSupport: 0\n  switchMicroSleepForYieldTime: 25\n  switchRamDiskSpaceSize: 12\n  ps4NPAgeRating: 12\n  ps4NPTitleSecret: \n  ps4NPTrophyPackPath: \n  ps4ParentalLevel: 11\n  ps4ContentID: ED1633-NPXX51362_00-0000000000000000\n  ps4Category: 0\n  ps4MasterVersion: 01.00\n  ps4AppVersion: 01.00\n  ps4AppType: 0\n  ps4ParamSfxPath: \n  ps4VideoOutPixelFormat: 0\n  ps4VideoOutInitialWidth: 1920\n  ps4VideoOutBaseModeInitialWidth: 1920\n  ps4VideoOutReprojectionRate: 60\n  ps4PronunciationXMLPath: \n  ps4PronunciationSIGPath: \n  ps4BackgroundImagePath: \n  ps4StartupImagePath: \n  ps4StartupImagesFolder: \n  ps4IconImagesFolder: \n  ps4SaveDataImagePath: \n  ps4SdkOverride: \n  ps4BGMPath: \n  ps4ShareFilePath: \n  ps4ShareOverlayImagePath: \n  ps4PrivacyGuardImagePath: \n  ps4ExtraSceSysFile: \n  ps4NPtitleDatPath: \n  ps4RemotePlayKeyAssignment: -1\n  ps4RemotePlayKeyMappingDir: \n  ps4PlayTogetherPlayerCount: 0\n  ps4EnterButtonAssignment: 1\n  ps4ApplicationParam1: 0\n  ps4ApplicationParam2: 0\n  ps4ApplicationParam3: 0\n  ps4ApplicationParam4: 0\n  ps4DownloadDataSize: 0\n  ps4GarlicHeapSize: 2048\n  ps4ProGarlicHeapSize: 2560\n  playerPrefsMaxSize: 32768\n  ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ\n  ps4pnSessions: 1\n  ps4pnPresence: 1\n  ps4pnFriends: 1\n  ps4pnGameCustomData: 1\n  playerPrefsSupport: 0\n  enableApplicationExit: 0\n  resetTempFolder: 1\n  restrictedAudioUsageRights: 0\n  ps4UseResolutionFallback: 0\n  ps4ReprojectionSupport: 0\n  ps4UseAudio3dBackend: 0\n  ps4UseLowGarlicFragmentationMode: 1\n  ps4SocialScreenEnabled: 0\n  ps4ScriptOptimizationLevel: 0\n  ps4Audio3dVirtualSpeakerCount: 14\n  ps4attribCpuUsage: 0\n  ps4PatchPkgPath: \n  ps4PatchLatestPkgPath: \n  ps4PatchChangeinfoPath: \n  ps4PatchDayOne: 0\n  ps4attribUserManagement: 0\n  ps4attribMoveSupport: 0\n  ps4attrib3DSupport: 0\n  ps4attribShareSupport: 0\n  ps4attribExclusiveVR: 0\n  ps4disableAutoHideSplash: 0\n  ps4videoRecordingFeaturesUsed: 0\n  ps4contentSearchFeaturesUsed: 0\n  ps4CompatibilityPS5: 0\n  ps4GPU800MHz: 1\n  ps4attribEyeToEyeDistanceSettingVR: 0\n  ps4IncludedModules: []\n  ps4attribVROutputEnabled: 0\n  monoEnv: \n  splashScreenBackgroundSourceLandscape: {fileID: 0}\n  splashScreenBackgroundSourcePortrait: {fileID: 0}\n  blurSplashScreenBackground: 1\n  spritePackerPolicy: \n  webGLMemorySize: 16\n  webGLExceptionSupport: 1\n  webGLNameFilesAsHashes: 0\n  webGLDataCaching: 1\n  webGLDebugSymbols: 0\n  webGLEmscriptenArgs: \n  webGLModulesDirectory: \n  webGLTemplate: APPLICATION:Default\n  webGLAnalyzeBuildSize: 0\n  webGLUseEmbeddedResources: 0\n  webGLCompressionFormat: 1\n  webGLWasmArithmeticExceptions: 0\n  webGLLinkerTarget: 1\n  webGLThreadsSupport: 0\n  webGLDecompressionFallback: 0\n  scriptingDefineSymbols: {}\n  additionalCompilerArguments: {}\n  platformArchitecture: {}\n  scriptingBackend: {}\n  il2cppCompilerConfiguration: {}\n  managedStrippingLevel: {}\n  incrementalIl2cppBuild: {}\n  suppressCommonWarnings: 1\n  allowUnsafeCode: 0\n  useDeterministicCompilation: 1\n  enableRoslynAnalyzers: 1\n  additionalIl2CppArgs: \n  scriptingRuntimeVersion: 1\n  gcIncremental: 1\n  assemblyVersionValidation: 1\n  gcWBarrierValidation: 0\n  apiCompatibilityLevelPerPlatform: {}\n  m_RenderingPath: 1\n  m_MobileRenderingPath: 1\n  metroPackageName: Template_3D\n  metroPackageVersion: \n  metroCertificatePath: \n  metroCertificatePassword: \n  metroCertificateSubject: \n  metroCertificateIssuer: \n  metroCertificateNotAfter: 0000000000000000\n  metroApplicationDescription: Template_3D\n  wsaImages: {}\n  metroTileShortName: \n  metroTileShowName: 0\n  metroMediumTileShowName: 0\n  metroLargeTileShowName: 0\n  metroWideTileShowName: 0\n  metroSupportStreamingInstall: 0\n  metroLastRequiredScene: 0\n  metroDefaultTileSize: 1\n  metroTileForegroundText: 2\n  metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}\n  metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1}\n  metroSplashScreenUseBackgroundColor: 0\n  platformCapabilities: {}\n  metroTargetDeviceFamilies: {}\n  metroFTAName: \n  metroFTAFileTypes: []\n  metroProtocolName: \n  vcxProjDefaultLanguage: \n  XboxOneProductId: \n  XboxOneUpdateKey: \n  XboxOneSandboxId: \n  XboxOneContentId: \n  XboxOneTitleId: \n  XboxOneSCId: \n  XboxOneGameOsOverridePath: \n  XboxOnePackagingOverridePath: \n  XboxOneAppManifestOverridePath: \n  XboxOneVersion: 1.0.0.0\n  XboxOnePackageEncryption: 0\n  XboxOnePackageUpdateGranularity: 2\n  XboxOneDescription: \n  XboxOneLanguage:\n  - enus\n  XboxOneCapability: []\n  XboxOneGameRating: {}\n  XboxOneIsContentPackage: 0\n  XboxOneEnhancedXboxCompatibilityMode: 0\n  XboxOneEnableGPUVariability: 1\n  XboxOneSockets: {}\n  XboxOneSplashScreen: {fileID: 0}\n  XboxOneAllowedProductIds: []\n  XboxOnePersistentLocalStorageSize: 0\n  XboxOneXTitleMemory: 8\n  XboxOneOverrideIdentityName: \n  XboxOneOverrideIdentityPublisher: \n  vrEditorSettings: {}\n  cloudServicesEnabled:\n    UNet: 1\n  luminIcon:\n    m_Name: \n    m_ModelFolderPath: \n    m_PortalFolderPath: \n  luminCert:\n    m_CertPath: \n    m_SignPackage: 1\n  luminIsChannelApp: 0\n  luminVersion:\n    m_VersionCode: 1\n    m_VersionName: \n  apiCompatibilityLevel: 6\n  activeInputHandler: 0\n  cloudProjectId: \n  framebufferDepthMemorylessMode: 0\n  qualitySettingsNames: []\n  projectName: \n  organizationId: \n  cloudEnabled: 0\n  legacyClampBlendShapeWeights: 0\n  playerDataPath: \n  forceSRGBBlit: 1\n  virtualTexturingSupportEnabled: 0\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/ProjectVersion.txt",
    "content": "m_EditorVersion: 2022.3.0f1\nm_EditorVersionWithRevision: 2022.3.0f1 (fb119bb0b476)\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/QualitySettings.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!47 &1\nQualitySettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 5\n  m_CurrentQuality: 5\n  m_QualitySettings:\n  - serializedVersion: 2\n    name: Very Low\n    pixelLightCount: 0\n    shadows: 0\n    shadowResolution: 0\n    shadowProjection: 1\n    shadowCascades: 1\n    shadowDistance: 15\n    shadowNearPlaneOffset: 3\n    shadowCascade2Split: 0.33333334\n    shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}\n    shadowmaskMode: 0\n    blendWeights: 1\n    textureQuality: 1\n    anisotropicTextures: 0\n    antiAliasing: 0\n    softParticles: 0\n    softVegetation: 0\n    realtimeReflectionProbes: 0\n    billboardsFaceCameraPosition: 0\n    vSyncCount: 0\n    lodBias: 0.3\n    maximumLODLevel: 0\n    streamingMipmapsActive: 0\n    streamingMipmapsAddAllCameras: 1\n    streamingMipmapsMemoryBudget: 512\n    streamingMipmapsRenderersPerFrame: 512\n    streamingMipmapsMaxLevelReduction: 2\n    streamingMipmapsMaxFileIORequests: 1024\n    particleRaycastBudget: 4\n    asyncUploadTimeSlice: 2\n    asyncUploadBufferSize: 16\n    asyncUploadPersistentBuffer: 1\n    resolutionScalingFixedDPIFactor: 1\n    excludedTargetPlatforms: []\n  - serializedVersion: 2\n    name: Low\n    pixelLightCount: 0\n    shadows: 0\n    shadowResolution: 0\n    shadowProjection: 1\n    shadowCascades: 1\n    shadowDistance: 20\n    shadowNearPlaneOffset: 3\n    shadowCascade2Split: 0.33333334\n    shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}\n    shadowmaskMode: 0\n    blendWeights: 2\n    textureQuality: 0\n    anisotropicTextures: 0\n    antiAliasing: 0\n    softParticles: 0\n    softVegetation: 0\n    realtimeReflectionProbes: 0\n    billboardsFaceCameraPosition: 0\n    vSyncCount: 0\n    lodBias: 0.4\n    maximumLODLevel: 0\n    streamingMipmapsActive: 0\n    streamingMipmapsAddAllCameras: 1\n    streamingMipmapsMemoryBudget: 512\n    streamingMipmapsRenderersPerFrame: 512\n    streamingMipmapsMaxLevelReduction: 2\n    streamingMipmapsMaxFileIORequests: 1024\n    particleRaycastBudget: 16\n    asyncUploadTimeSlice: 2\n    asyncUploadBufferSize: 16\n    asyncUploadPersistentBuffer: 1\n    resolutionScalingFixedDPIFactor: 1\n    excludedTargetPlatforms: []\n  - serializedVersion: 2\n    name: Medium\n    pixelLightCount: 1\n    shadows: 1\n    shadowResolution: 0\n    shadowProjection: 1\n    shadowCascades: 1\n    shadowDistance: 20\n    shadowNearPlaneOffset: 3\n    shadowCascade2Split: 0.33333334\n    shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}\n    shadowmaskMode: 0\n    blendWeights: 2\n    textureQuality: 0\n    anisotropicTextures: 1\n    antiAliasing: 0\n    softParticles: 0\n    softVegetation: 0\n    realtimeReflectionProbes: 0\n    billboardsFaceCameraPosition: 0\n    vSyncCount: 1\n    lodBias: 0.7\n    maximumLODLevel: 0\n    streamingMipmapsActive: 0\n    streamingMipmapsAddAllCameras: 1\n    streamingMipmapsMemoryBudget: 512\n    streamingMipmapsRenderersPerFrame: 512\n    streamingMipmapsMaxLevelReduction: 2\n    streamingMipmapsMaxFileIORequests: 1024\n    particleRaycastBudget: 64\n    asyncUploadTimeSlice: 2\n    asyncUploadBufferSize: 16\n    asyncUploadPersistentBuffer: 1\n    resolutionScalingFixedDPIFactor: 1\n    excludedTargetPlatforms: []\n  - serializedVersion: 2\n    name: High\n    pixelLightCount: 2\n    shadows: 2\n    shadowResolution: 1\n    shadowProjection: 1\n    shadowCascades: 2\n    shadowDistance: 40\n    shadowNearPlaneOffset: 3\n    shadowCascade2Split: 0.33333334\n    shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}\n    shadowmaskMode: 1\n    blendWeights: 2\n    textureQuality: 0\n    anisotropicTextures: 1\n    antiAliasing: 0\n    softParticles: 0\n    softVegetation: 1\n    realtimeReflectionProbes: 1\n    billboardsFaceCameraPosition: 1\n    vSyncCount: 1\n    lodBias: 1\n    maximumLODLevel: 0\n    streamingMipmapsActive: 0\n    streamingMipmapsAddAllCameras: 1\n    streamingMipmapsMemoryBudget: 512\n    streamingMipmapsRenderersPerFrame: 512\n    streamingMipmapsMaxLevelReduction: 2\n    streamingMipmapsMaxFileIORequests: 1024\n    particleRaycastBudget: 256\n    asyncUploadTimeSlice: 2\n    asyncUploadBufferSize: 16\n    asyncUploadPersistentBuffer: 1\n    resolutionScalingFixedDPIFactor: 1\n    excludedTargetPlatforms: []\n  - serializedVersion: 2\n    name: Very High\n    pixelLightCount: 3\n    shadows: 2\n    shadowResolution: 2\n    shadowProjection: 1\n    shadowCascades: 2\n    shadowDistance: 70\n    shadowNearPlaneOffset: 3\n    shadowCascade2Split: 0.33333334\n    shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}\n    shadowmaskMode: 1\n    blendWeights: 4\n    textureQuality: 0\n    anisotropicTextures: 2\n    antiAliasing: 2\n    softParticles: 1\n    softVegetation: 1\n    realtimeReflectionProbes: 1\n    billboardsFaceCameraPosition: 1\n    vSyncCount: 1\n    lodBias: 1.5\n    maximumLODLevel: 0\n    streamingMipmapsActive: 0\n    streamingMipmapsAddAllCameras: 1\n    streamingMipmapsMemoryBudget: 512\n    streamingMipmapsRenderersPerFrame: 512\n    streamingMipmapsMaxLevelReduction: 2\n    streamingMipmapsMaxFileIORequests: 1024\n    particleRaycastBudget: 1024\n    asyncUploadTimeSlice: 2\n    asyncUploadBufferSize: 16\n    asyncUploadPersistentBuffer: 1\n    resolutionScalingFixedDPIFactor: 1\n    excludedTargetPlatforms: []\n  - serializedVersion: 2\n    name: Ultra\n    pixelLightCount: 4\n    shadows: 2\n    shadowResolution: 2\n    shadowProjection: 1\n    shadowCascades: 4\n    shadowDistance: 150\n    shadowNearPlaneOffset: 3\n    shadowCascade2Split: 0.33333334\n    shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}\n    shadowmaskMode: 1\n    blendWeights: 4\n    textureQuality: 0\n    anisotropicTextures: 2\n    antiAliasing: 2\n    softParticles: 1\n    softVegetation: 1\n    realtimeReflectionProbes: 1\n    billboardsFaceCameraPosition: 1\n    vSyncCount: 1\n    lodBias: 2\n    maximumLODLevel: 0\n    streamingMipmapsActive: 0\n    streamingMipmapsAddAllCameras: 1\n    streamingMipmapsMemoryBudget: 512\n    streamingMipmapsRenderersPerFrame: 512\n    streamingMipmapsMaxLevelReduction: 2\n    streamingMipmapsMaxFileIORequests: 1024\n    particleRaycastBudget: 4096\n    asyncUploadTimeSlice: 2\n    asyncUploadBufferSize: 16\n    asyncUploadPersistentBuffer: 1\n    resolutionScalingFixedDPIFactor: 1\n    excludedTargetPlatforms: []\n  m_PerPlatformDefaultQuality:\n    Android: 2\n    Lumin: 5\n    Nintendo 3DS: 5\n    Nintendo Switch: 5\n    PS4: 5\n    PSP2: 2\n    Stadia: 5\n    Standalone: 5\n    WebGL: 3\n    Windows Store Apps: 5\n    XboxOne: 5\n    iPhone: 2\n    tvOS: 2\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/TagManager.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!78 &1\nTagManager:\n  serializedVersion: 2\n  tags: []\n  layers:\n  - Default\n  - TransparentFX\n  - Ignore Raycast\n  - \n  - Water\n  - UI\n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  - \n  m_SortingLayers:\n  - name: Default\n    uniqueID: 0\n    locked: 0\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/TimeManager.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!5 &1\nTimeManager:\n  m_ObjectHideFlags: 0\n  Fixed Timestep: 0.02\n  Maximum Allowed Timestep: 0.33333334\n  m_TimeScale: 1\n  Maximum Particle Timestep: 0.03\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/UnityConnectSettings.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!310 &1\nUnityConnectSettings:\n  m_ObjectHideFlags: 0\n  serializedVersion: 1\n  m_Enabled: 0\n  m_TestMode: 0\n  m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events\n  m_EventUrl: https://cdp.cloud.unity3d.com/v1/events\n  m_ConfigUrl: https://config.uca.cloud.unity3d.com\n  m_DashboardUrl: https://dashboard.unity3d.com\n  m_TestInitMode: 0\n  CrashReportingSettings:\n    m_EventUrl: https://perf-events.cloud.unity3d.com\n    m_Enabled: 0\n    m_LogBufferSize: 10\n    m_CaptureEditorExceptions: 1\n  UnityPurchasingSettings:\n    m_Enabled: 0\n    m_TestMode: 0\n  UnityAnalyticsSettings:\n    m_Enabled: 0\n    m_TestMode: 0\n    m_InitializeOnStartup: 1\n  UnityAdsSettings:\n    m_Enabled: 0\n    m_InitializeOnStartup: 1\n    m_TestMode: 0\n    m_IosGameId: \n    m_AndroidGameId: \n    m_GameIds: {}\n    m_GameId: \n  PerformanceReportingSettings:\n    m_Enabled: 0\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/VFXManager.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!937362698 &1\nVFXManager:\n  m_ObjectHideFlags: 0\n  m_IndirectShader: {fileID: 0}\n  m_CopyBufferShader: {fileID: 0}\n  m_SortShader: {fileID: 0}\n  m_StripUpdateShader: {fileID: 0}\n  m_RenderPipeSettingsPath: \n  m_FixedTimeStep: 0.016666668\n  m_MaxDeltaTime: 0.05\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/VersionControlSettings.asset",
    "content": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!890905787 &1\nVersionControlSettings:\n  m_ObjectHideFlags: 0\n  m_Mode: Visible Meta Files\n  m_CollabEditorSettings:\n    inProgressEnabled: 1\n"
  },
  {
    "path": "samples/Unity/ProjectSettings/XRSettings.asset",
    "content": "{\n    \"m_SettingKeys\": [\n        \"VR Device Disabled\",\n        \"VR Device User Alert\"\n    ],\n    \"m_SettingValues\": [\n        \"False\",\n        \"False\"\n    ]\n}"
  },
  {
    "path": "samples/Unity/restore_unity.bash",
    "content": "#!/usr/bin/env bash\nset -euo pipefail\nIFS=$'\\n\\t'\n\nUNITY_PROJECTS=(samples/Unity)\n\ndeclare -A PROJECTS=(\n  [Entitas]=Assets/Plugins\n  [Entitas.Generators.Attributes]=Assets/Plugins\n  [Entitas.Unity]=Assets/Plugins\n  [Entitas.Unity.Editor]=Assets/Plugins/Editor\n)\n\nfor unity_project_path in \"${UNITY_PROJECTS[@]}\"; do\n  echo \"Restore Entitas: ${unity_project_path}\"\n  for project in \"${!PROJECTS[@]}\"; do\n    echo \"Restore ${project}: ${unity_project_path}\"\n    project_path=\"${unity_project_path}/${PROJECTS[\"${project}\"]}\"\n    mkdir -p \"${project_path}\"\n    rsync \\\n      --archive \\\n      --recursive \\\n      --prune-empty-dirs \\\n      --include='*/' \\\n      --include='**/*.cs' \\\n      --include='**/*.png' \\\n      --include='**/*.png.meta' \\\n      --exclude='*' \\\n      \"src/${project}\" \"${project_path}\"\n  done\n\n  echo \"Restore Dotfiles: ${unity_project_path}\"\n  mkdir -p \"${unity_project_path}/.sln.dotsettings/\"\n  cp Entitas.sln.DotSettings \"${unity_project_path}/$(basename \"${unity_project_path}\").sln.DotSettings\"\n  cp .sln.dotsettings/*.DotSettings \"${unity_project_path}/.sln.dotsettings/\"\n  cp .editorconfig \"${unity_project_path}\"\ndone\n"
  },
  {
    "path": "src/Entitas/Collector/Collector.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\n\nnamespace Entitas\n{\n    /// A Collector can observe one or more groups from the same context\n    /// and collects changed entities based on the specified groupEvent.\n    public class Collector<TEntity> : ICollector<TEntity> where TEntity : Entity\n    {\n        /// Returns all collected entities.\n        /// Call collector.ClearCollectedEntities()\n        /// once you processed all entities.\n        public HashSet<TEntity> CollectedEntities => _collectedEntities;\n\n        /// Returns the number of all collected entities.\n        public int Count => _collectedEntities.Count;\n\n        readonly HashSet<TEntity> _collectedEntities;\n        readonly IGroup<TEntity>[] _groups;\n        readonly GroupEvent[] _groupEvents;\n\n        // Cache delegate to reduce gc allocations\n        readonly GroupChanged<TEntity> _onEntityDelegate;\n\n        string _toStringCache;\n\n        /// Creates a Collector and will collect changed entities\n        /// based on the specified groupEvent.\n        public Collector(IGroup<TEntity> group, GroupEvent groupEvent) : this(new[] { group }, new[] { groupEvent }) { }\n\n        /// Creates a Collector and will collect changed entities\n        /// based on the specified groupEvents.\n        public Collector(IGroup<TEntity>[] groups, GroupEvent[] groupEvents)\n        {\n            _collectedEntities = new HashSet<TEntity>(EntityEqualityComparer<TEntity>.Comparer);\n            _groups = groups;\n            _groupEvents = groupEvents;\n\n            if (groups.Length != groupEvents.Length)\n            {\n                throw new CollectorException(\n                    $\"Unbalanced count with groups ({groups.Length}) and group events ({groupEvents.Length}).\",\n                    \"Group and GroupEvents count must be equal.\"\n                );\n            }\n\n            _onEntityDelegate = (_, entity, _, _) =>\n            {\n                if (_collectedEntities.Add(entity))\n                    entity.Retain(this);\n            };\n\n            Activate();\n        }\n\n        /// Activates the Collector and will start collecting\n        /// changed entities. Collectors are activated by default.\n        public void Activate()\n        {\n            for (var i = 0; i < _groups.Length; i++)\n            {\n                var group = _groups[i];\n                var groupEvent = _groupEvents[i];\n                switch (groupEvent)\n                {\n                    case GroupEvent.Added:\n                        group.OnEntityAdded -= _onEntityDelegate;\n                        group.OnEntityAdded += _onEntityDelegate;\n                        break;\n                    case GroupEvent.Removed:\n                        group.OnEntityRemoved -= _onEntityDelegate;\n                        group.OnEntityRemoved += _onEntityDelegate;\n                        break;\n                    case GroupEvent.AddedOrRemoved:\n                        group.OnEntityAdded -= _onEntityDelegate;\n                        group.OnEntityAdded += _onEntityDelegate;\n                        group.OnEntityRemoved -= _onEntityDelegate;\n                        group.OnEntityRemoved += _onEntityDelegate;\n                        break;\n                }\n            }\n        }\n\n        /// Deactivates the Collector.\n        /// This will also clear all collected entities.\n        /// Collectors are activated by default.\n        public void Deactivate()\n        {\n            for (var i = 0; i < _groups.Length; i++)\n            {\n                var group = _groups[i];\n                group.OnEntityAdded -= _onEntityDelegate;\n                group.OnEntityRemoved -= _onEntityDelegate;\n            }\n\n            ClearCollectedEntities();\n        }\n\n        /// Clears all collected entities.\n        public void ClearCollectedEntities()\n        {\n            foreach (var entity in _collectedEntities)\n                entity.Release(this);\n\n            _collectedEntities.Clear();\n        }\n\n        public override string ToString()\n        {\n            return _toStringCache ??= \"Collector(\" + string.Join(\", \", _groups.Select(group => group.ToString())) + \")\";\n        }\n\n        ~Collector() => Deactivate();\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Collector/CollectorContextExtension.cs",
    "content": "﻿namespace Entitas\n{\n    public static class CollectorContextExtension\n    {\n        /// Creates a Collector.\n        public static ICollector<TEntity> CreateCollector<TEntity>(\n            this IContext<TEntity> context, IMatcher<TEntity> matcher) where TEntity : Entity\n        {\n            return context.CreateCollector(new TriggerOnEvent<TEntity>(matcher, GroupEvent.Added));\n        }\n\n        /// Creates a Collector.\n        public static ICollector<TEntity> CreateCollector<TEntity>(\n            this IContext<TEntity> context, params TriggerOnEvent<TEntity>[] triggers) where TEntity : Entity\n        {\n            var groups = new IGroup<TEntity>[triggers.Length];\n            var groupEvents = new GroupEvent[triggers.Length];\n\n            for (var i = 0; i < triggers.Length; i++)\n            {\n                groups[i] = context.GetGroup(triggers[i].Matcher);\n                groupEvents[i] = triggers[i].GroupEvent;\n            }\n\n            return new Collector<TEntity>(groups, groupEvents);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Collector/CollectorException.cs",
    "content": "﻿namespace Entitas\n{\n    public class CollectorException : EntitasException\n    {\n        public CollectorException(string message, string hint) : base(message, hint) { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Collector/ICollector.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Entitas\n{\n    public interface ICollector\n    {\n        int Count { get; }\n\n        void Activate();\n        void Deactivate();\n        void ClearCollectedEntities();\n    }\n\n    public interface ICollector<TEntity> : ICollector where TEntity : Entity\n    {\n        HashSet<TEntity> CollectedEntities { get; }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Collector/TriggerOnEvent.cs",
    "content": "﻿namespace Entitas\n{\n    public struct TriggerOnEvent<TEntity> where TEntity : Entity\n    {\n        public readonly IMatcher<TEntity> Matcher;\n        public readonly GroupEvent GroupEvent;\n\n        public TriggerOnEvent(IMatcher<TEntity> matcher, GroupEvent groupEvent)\n        {\n            Matcher = matcher;\n            GroupEvent = groupEvent;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Collector/TriggerOnEventMatcherExtension.cs",
    "content": "﻿namespace Entitas\n{\n    public static class TriggerOnEventMatcherExtension\n    {\n        public static TriggerOnEvent<TEntity> Added<TEntity>(this IMatcher<TEntity> matcher) where TEntity : Entity =>\n            new TriggerOnEvent<TEntity>(matcher, GroupEvent.Added);\n\n        public static TriggerOnEvent<TEntity> Removed<TEntity>(this IMatcher<TEntity> matcher) where TEntity : Entity =>\n            new TriggerOnEvent<TEntity>(matcher, GroupEvent.Removed);\n\n        public static TriggerOnEvent<TEntity> AddedOrRemoved<TEntity>(this IMatcher<TEntity> matcher) where TEntity : Entity =>\n            new TriggerOnEvent<TEntity>(matcher, GroupEvent.AddedOrRemoved);\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Context/Context.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Entitas\n{\n    /// A context manages the lifecycle of entities and groups.\n    /// You can create and destroy entities and get groups of entities.\n    /// The preferred way to create a context is to use the generated methods\n    /// from the code generator, e.g. var context = new GameContext();\n    public class Context<TEntity> : IContext<TEntity> where TEntity : Entity\n    {\n        /// Occurs when an entity gets created.\n        public event ContextEntityChanged OnEntityCreated;\n\n        /// Occurs when an entity will be destroyed.\n        public event ContextEntityChanged OnEntityWillBeDestroyed;\n\n        /// Occurs when an entity got destroyed.\n        public event ContextEntityChanged OnEntityDestroyed;\n\n        /// Occurs when a group gets created for the first time.\n        public event ContextGroupChanged OnGroupCreated;\n\n        /// The total amount of components an entity can possibly have.\n        /// This value is generated by the code generator.\n        public int TotalComponents => _totalComponents;\n\n        /// Returns all ComponentPools. ComponentPools is used to reuse\n        /// removed components.\n        /// Removed components will be pushed to the ComponentPool.\n        /// Use entity.CreateComponent(index, type) to get a new or reusable\n        /// component from the ComponentPool.\n        public Stack<IComponent>[] ComponentPools => _componentPools;\n\n        /// The ContextInfo contains information about the context.\n        /// It's used to provide better error messages.\n        public ContextInfo ContextInfo => _contextInfo;\n\n        /// Returns the number of entities in the context.\n        public int Count => _entities.Count;\n\n        /// Returns the number of entities in the internal ObjectPool\n        /// for entities which can be reused.\n        public int ReusableEntitiesCount => _reusableEntities.Count;\n\n        /// Returns the number of entities that are currently retained by\n        /// other objects (e.g. Group, Collector, ReactiveSystem).\n        public int RetainedEntitiesCount => _retainedEntities.Count;\n\n        readonly int _totalComponents;\n\n        readonly Stack<IComponent>[] _componentPools;\n        readonly ContextInfo _contextInfo;\n        readonly Func<Entity, IAERC> _aercFactory;\n        readonly Func<TEntity> _entityFactory;\n\n        readonly HashSet<TEntity> _entities = new HashSet<TEntity>(EntityEqualityComparer<TEntity>.Comparer);\n        readonly Stack<TEntity> _reusableEntities = new Stack<TEntity>();\n        readonly HashSet<TEntity> _retainedEntities = new HashSet<TEntity>(EntityEqualityComparer<TEntity>.Comparer);\n\n        readonly Dictionary<IMatcher<TEntity>, IGroup<TEntity>> _groups = new Dictionary<IMatcher<TEntity>, IGroup<TEntity>>();\n        readonly List<IGroup<TEntity>>[] _groupsForIndex;\n\n        readonly Dictionary<string, IEntityIndex> _entityIndexes;\n\n        int _creationIndex;\n\n        TEntity[] _entitiesCache;\n\n        // Cache delegate to reduce gc allocations\n        readonly EntityComponentChanged _onEntityChangedDelegate;\n        readonly EntityComponentReplaced _onComponentReplacedDelegate;\n        readonly EntityEvent _OnEntityReleasedDelegate;\n        readonly EntityEvent _OnDestroyEntityDelegate;\n\n        /// The preferred way to create a context is to use the generated methods\n        /// from the code generator, e.g. var context = new MainContext();\n        public Context(int totalComponents, Func<TEntity> entityFactory) : this(totalComponents, 0, null, null, entityFactory) { }\n\n        /// The preferred way to create a context is to use the generated methods\n        /// from the code generator, e.g. var context = new GameContext();\n        public Context(int totalComponents, int startCreationIndex, ContextInfo contextInfo, Func<Entity, IAERC> aercFactory, Func<TEntity> entityFactory)\n        {\n            _totalComponents = totalComponents;\n            _creationIndex = startCreationIndex;\n\n            if (contextInfo != null)\n            {\n                _contextInfo = contextInfo;\n                if (contextInfo.ComponentNames.Length != totalComponents)\n                    throw new ContextInfoException(this, contextInfo);\n            }\n            else\n            {\n                var componentNames = new string[_totalComponents];\n                for (var i = 0; i < componentNames.Length; i++)\n                    componentNames[i] = \"Index \" + i;\n\n                _contextInfo = new ContextInfo(\"Unnamed Context\", componentNames, null);\n            }\n\n            _aercFactory = aercFactory ?? SafeAERC.Delegate;\n            _entityFactory = entityFactory;\n\n            _groupsForIndex = new List<IGroup<TEntity>>[totalComponents];\n            _componentPools = new Stack<IComponent>[totalComponents];\n            _entityIndexes = new Dictionary<string, IEntityIndex>();\n\n            var groupChangedListPool = new Stack<List<GroupChanged<TEntity>>>();\n            _onEntityChangedDelegate = (entity, index, component) =>\n            {\n                var groups = _groupsForIndex[index];\n                if (groups != null)\n                {\n                    var events = groupChangedListPool.Count != 0\n                        ? groupChangedListPool.Pop()\n                        : new List<GroupChanged<TEntity>>();\n\n                    var tEntity = (TEntity)entity;\n\n                    for (var i = 0; i < groups.Count; i++)\n                        events.Add(groups[i].HandleEntity(tEntity));\n\n                    for (var i = 0; i < events.Count; i++)\n                        events[i]?.Invoke(groups[i], tEntity, index, component);\n\n                    events.Clear();\n                    groupChangedListPool.Push(events);\n                }\n            };\n\n            _onComponentReplacedDelegate = (entity, index, previousComponent, newComponent) =>\n            {\n                var groups = _groupsForIndex[index];\n                if (groups != null)\n                    for (var i = 0; i < groups.Count; i++)\n                        groups[i].UpdateEntity((TEntity)entity, index, previousComponent, newComponent);\n            };\n\n            _OnEntityReleasedDelegate = entity =>\n            {\n                if (entity.IsEnabled)\n                    throw new EntityIsNotDestroyedException($\"Cannot release {entity}!\");\n\n                var tEntity = (TEntity)entity;\n                entity.RemoveAllOnEntityReleasedHandlers();\n                _retainedEntities.Remove(tEntity);\n                _reusableEntities.Push(tEntity);\n            };\n\n            _OnDestroyEntityDelegate = entity =>\n            {\n                var tEntity = (TEntity)entity;\n                var removed = _entities.Remove(tEntity);\n                if (!removed)\n                    throw new ContextDoesNotContainEntityException(\n                        $\"'{this}' cannot destroy {tEntity}!\",\n                        \"This cannot happen!?!\"\n                    );\n\n                _entitiesCache = null;\n\n                OnEntityWillBeDestroyed?.Invoke(this, tEntity);\n                tEntity.InternalDestroy();\n                OnEntityDestroyed?.Invoke(this, tEntity);\n\n                if (tEntity.RetainCount == 1)\n                {\n                    // Can be released immediately without\n                    // adding to _retainedEntities\n                    tEntity.OnEntityReleased -= _OnEntityReleasedDelegate;\n                    _reusableEntities.Push(tEntity);\n                    tEntity.Release(this);\n                    tEntity.RemoveAllOnEntityReleasedHandlers();\n                }\n                else\n                {\n                    _retainedEntities.Add(tEntity);\n                    tEntity.Release(this);\n                }\n            };\n        }\n\n        /// Creates a new entity or gets a reusable entity from the\n        /// internal ObjectPool for entities.\n        public TEntity CreateEntity()\n        {\n            TEntity entity;\n\n            if (_reusableEntities.Count > 0)\n            {\n                entity = _reusableEntities.Pop();\n                entity.Reuse(_creationIndex++);\n            }\n            else\n            {\n                entity = _entityFactory();\n                entity.Initialize(_creationIndex++, _totalComponents, _componentPools, _contextInfo, _aercFactory(entity));\n            }\n\n            _entities.Add(entity);\n            entity.Retain(this);\n            _entitiesCache = null;\n\n            entity.OnComponentAdded += _onEntityChangedDelegate;\n            entity.OnComponentRemoved += _onEntityChangedDelegate;\n            entity.OnComponentReplaced += _onComponentReplacedDelegate;\n            entity.OnEntityReleased += _OnEntityReleasedDelegate;\n            entity.OnDestroyEntity += _OnDestroyEntityDelegate;\n\n            OnEntityCreated?.Invoke(this, entity);\n\n            return entity;\n        }\n\n        /// Destroys all entities in the context.\n        /// Throws an exception if there are still retained entities.\n        public void DestroyAllEntities()\n        {\n            var entities = GetEntities();\n            for (var i = 0; i < entities.Length; i++)\n                entities[i].Destroy();\n\n            _entities.Clear();\n\n            if (_retainedEntities.Count != 0)\n                throw new ContextStillHasRetainedEntitiesException(this, _retainedEntities);\n        }\n\n        /// Determines whether the context has the specified entity.\n        public bool HasEntity(TEntity entity) => _entities.Contains(entity);\n\n        /// Returns all entities which are currently in the context.\n        public TEntity[] GetEntities()\n        {\n            return _entitiesCache ??= _entities.ToArray();\n        }\n\n        /// Returns all entities matching the specified matcher.\n        public TEntity[] GetEntities(IMatcher<TEntity> matcher)\n        {\n            return GetGroup(matcher).GetEntities();\n        }\n\n        /// Returns a group for the specified matcher.\n        /// Calling context.GetGroup(matcher) with the same matcher will always\n        /// return the same instance of the group.\n        public IGroup<TEntity> GetGroup(IMatcher<TEntity> matcher)\n        {\n            if (!_groups.TryGetValue(matcher, out var group))\n            {\n                group = new Group<TEntity>(matcher);\n                var entities = GetEntities();\n                for (var i = 0; i < entities.Length; i++)\n                    group.HandleEntitySilently(entities[i]);\n\n                _groups.Add(matcher, group);\n\n                for (var i = 0; i < matcher.Indexes.Length; i++)\n                {\n                    var index = matcher.Indexes[i];\n                    _groupsForIndex[index] ??= new List<IGroup<TEntity>>();\n                    _groupsForIndex[index].Add(group);\n                }\n\n                OnGroupCreated?.Invoke(this, group);\n            }\n\n            return group;\n        }\n\n        /// Adds the IEntityIndex for the specified name.\n        /// There can only be one IEntityIndex per name.\n        public void AddEntityIndex(IEntityIndex entityIndex)\n        {\n            if (_entityIndexes.ContainsKey(entityIndex.Name))\n                throw new ContextEntityIndexDoesAlreadyExistException(this, entityIndex.Name);\n\n            _entityIndexes.Add(entityIndex.Name, entityIndex);\n        }\n\n        /// Gets the IEntityIndex for the specified name.\n        public IEntityIndex GetEntityIndex(string name)\n        {\n            if (!_entityIndexes.TryGetValue(name, out var entityIndex))\n                throw new ContextEntityIndexDoesNotExistException(this, name);\n\n            return entityIndex;\n        }\n\n        /// Resets the creationIndex back to 0.\n        public void ResetCreationIndex() => _creationIndex = 0;\n\n        /// Clears the componentPool at the specified index.\n        public void ClearComponentPool(int index) => _componentPools[index]?.Clear();\n\n        /// Clears all componentPools.\n        public void ClearComponentPools()\n        {\n            for (var i = 0; i < _componentPools.Length; i++)\n                ClearComponentPool(i);\n        }\n\n        /// Resets the context (destroys all entities and\n        /// resets creationIndex back to 0).\n        public void Reset()\n        {\n            DestroyAllEntities();\n            ResetCreationIndex();\n        }\n\n        /// Removes all event handlers\n        /// OnEntityCreated, OnEntityWillBeDestroyed,\n        /// OnEntityDestroyed and OnGroupCreated\n        public void RemoveAllEventHandlers()\n        {\n            OnEntityCreated = null;\n            OnEntityWillBeDestroyed = null;\n            OnEntityDestroyed = null;\n            OnGroupCreated = null;\n        }\n\n        public override string ToString() => _contextInfo.Name;\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Context/ContextInfo.cs",
    "content": "﻿using System;\n\nnamespace Entitas\n{\n    public class ContextInfo\n    {\n        public readonly string Name;\n        public readonly string[] ComponentNames;\n        public readonly Type[] ComponentTypes;\n\n        public ContextInfo(string name, string[] componentNames, Type[] componentTypes)\n        {\n            Name = name;\n            ComponentNames = componentNames;\n            ComponentTypes = componentTypes;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Context/Exceptions/ContextDoesNotContainEntityException.cs",
    "content": "﻿namespace Entitas\n{\n    public class ContextDoesNotContainEntityException : EntitasException\n    {\n        public ContextDoesNotContainEntityException(string message, string hint) :\n            base($\"{message}\\nContext does not contain entity!\", hint) { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Context/Exceptions/ContextEntityIndexDoesAlreadyExistException.cs",
    "content": "﻿namespace Entitas\n{\n    public class ContextEntityIndexDoesAlreadyExistException : EntitasException\n    {\n        public ContextEntityIndexDoesAlreadyExistException(IContext context, string name) :\n            base($\"Cannot add EntityIndex '{name}' to context '{context}'!\",\n                \"An EntityIndex with this name has already been added.\") { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Context/Exceptions/ContextEntityIndexDoesNotExistException.cs",
    "content": "﻿namespace Entitas\n{\n    public class ContextEntityIndexDoesNotExistException : EntitasException\n    {\n        public ContextEntityIndexDoesNotExistException(IContext context, string name) :\n            base($\"Cannot get EntityIndex '{name}' from context '{context}'!\",\n                \"No EntityIndex with this name has been added.\") { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Context/Exceptions/ContextInfoException.cs",
    "content": "﻿namespace Entitas\n{\n    public class ContextInfoException : EntitasException\n    {\n        public ContextInfoException(IContext context, ContextInfo contextInfo) :\n            base($\"Invalid ContextInfo for '{context}'!\\nExpected {context.TotalComponents} ComponentName(s) but got {contextInfo.ComponentNames.Length}:\",\n                string.Join(\"\\n\", contextInfo.ComponentNames)) { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Context/Exceptions/ContextStillHasRetainedEntitiesException.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\n\nnamespace Entitas\n{\n    public class ContextStillHasRetainedEntitiesException : EntitasException\n    {\n        public ContextStillHasRetainedEntitiesException(IContext context, IEnumerable<Entity> entities) :\n            base($\"'{context}' detected retained entities although all entities got destroyed!\",\n                $\"Did you release all entities? Try calling systems.DeactivateReactiveSystems() before calling context.DestroyAllEntities() to avoid memory leaks. Do not forget to activate them back when needed.\\n{EntitiesToString(entities)}\") { }\n\n        static string EntitiesToString(IEnumerable<Entity> entities) =>\n            string.Join(\"\\n\", entities.Select(entity => entity.Aerc is SafeAERC safeAerc\n                ? $\"{entity} - {string.Join(\", \", safeAerc.Owners.Select(o => o.ToString()))}\"\n                : entity.ToString())\n            );\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Context/Exceptions/EntityIsNotDestroyedException.cs",
    "content": "﻿namespace Entitas\n{\n    public class EntityIsNotDestroyedException : EntitasException\n    {\n        public EntityIsNotDestroyedException(string message) :\n            base($\"{message}\\nEntity is not destroyed yet!\",\n                \"Did you manually call entity.Release(context) yourself? If so, please don\\'t :)\") { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Context/IContext.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Entitas\n{\n    public delegate void ContextEntityChanged(IContext context, Entity entity);\n\n    public delegate void ContextGroupChanged(IContext context, IGroup group);\n\n    public interface IContext\n    {\n        event ContextEntityChanged OnEntityCreated;\n        event ContextEntityChanged OnEntityWillBeDestroyed;\n        event ContextEntityChanged OnEntityDestroyed;\n\n        event ContextGroupChanged OnGroupCreated;\n\n        int TotalComponents { get; }\n\n        Stack<IComponent>[] ComponentPools { get; }\n        ContextInfo ContextInfo { get; }\n\n        int Count { get; }\n        int ReusableEntitiesCount { get; }\n        int RetainedEntitiesCount { get; }\n\n        void DestroyAllEntities();\n\n        void AddEntityIndex(IEntityIndex entityIndex);\n        IEntityIndex GetEntityIndex(string name);\n\n        void ResetCreationIndex();\n        void ClearComponentPool(int index);\n        void ClearComponentPools();\n        void RemoveAllEventHandlers();\n        void Reset();\n    }\n\n    public interface IContext<TEntity> : IContext where TEntity : Entity\n    {\n        TEntity CreateEntity();\n\n        bool HasEntity(TEntity entity);\n        TEntity[] GetEntities();\n        TEntity[] GetEntities(IMatcher<TEntity> matcher);\n        IGroup<TEntity> GetGroup(IMatcher<TEntity> matcher);\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Entitas.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>$(DefaultTargetFramework)</TargetFramework>\n    <Version>2.0.0</Version>\n  </PropertyGroup>\n\n</Project>\n"
  },
  {
    "path": "src/Entitas/Entitas.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=collector/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=context/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=context_005Cexceptions/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=entity/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=entityindex/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=entity_005Cexceptions/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=extensions/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=group/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=matcher/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=matcher_005Cinterfaces/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=systems/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=systems_005Cinterfaces/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/Entitas/EntitasException.cs",
    "content": "﻿using System;\n\nnamespace Entitas\n{\n    /// Base exception used by Entitas.\n    public class EntitasException : Exception\n    {\n        public EntitasException(string message, string hint) :\n            base(hint != null ? $\"{message}\\n{hint}\" : message) { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Entity/Entity.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nnamespace Entitas\n{\n    public delegate void EntityComponentChanged(\n        Entity entity, int index, IComponent component\n    );\n\n    public delegate void EntityComponentReplaced(\n        Entity entity, int index, IComponent previousComponent, IComponent newComponent\n    );\n\n    public delegate void EntityEvent(Entity entity);\n\n    /// Use context.CreateEntity() to create a new entity and\n    /// entity.Destroy() to destroy it.\n    /// You can add, replace and remove IComponent to an entity.\n    public class Entity\n    {\n        /// Occurs when a component gets added.\n        /// All event handlers will be removed when\n        /// the entity gets destroyed by the context.\n        public event EntityComponentChanged OnComponentAdded;\n\n        /// Occurs when a component gets removed.\n        /// All event handlers will be removed when\n        /// the entity gets destroyed by the context.\n        public event EntityComponentChanged OnComponentRemoved;\n\n        /// Occurs when a component gets replaced.\n        /// All event handlers will be removed when\n        /// the entity gets destroyed by the context.\n        public event EntityComponentReplaced OnComponentReplaced;\n\n        /// Occurs when an entity gets released and is not retained anymore.\n        /// All event handlers will be removed when\n        /// the entity gets destroyed by the context.\n        public event EntityEvent OnEntityReleased;\n\n        /// Occurs when calling entity.Destroy().\n        /// All event handlers will be removed when\n        /// the entity gets destroyed by the context.\n        public event EntityEvent OnDestroyEntity;\n\n        /// The total amount of components an entity can possibly have.\n        public int TotalComponents => _totalComponents;\n\n        /// Each entity has its own unique ID which will be set by\n        /// the context when you create the entity.\n        public int Id => _id;\n\n        /// The context manages the state of an entity.\n        /// Active entities are enabled, destroyed entities are not.\n        public bool IsEnabled => _isEnabled;\n\n        /// ComponentPools is set by the context which created the entity and\n        /// is used to reuse removed components.\n        /// Removed components will be pushed to the ComponentPool.\n        /// Use entity.CreateComponent(index, type) to get a new or\n        /// reusable component from the ComponentPool.\n        /// Use entity.GetComponentPool(index) to get a componentPool for\n        /// a specific component index.\n        public Stack<IComponent>[] ComponentPools => _componentPools;\n\n        /// The ContextInfo is set by the context which created the entity and\n        /// contains information about the context.\n        /// It's used to provide better error messages.\n        public ContextInfo ContextInfo => _contextInfo;\n\n        /// Automatic Entity Reference Counting (AERC)\n        /// is used internally to prevent pooling retained entities.\n        /// If you use retain manually you also have to\n        /// release it manually at some point.\n        public IAERC Aerc => _aerc;\n\n        readonly List<IComponent> _componentBuffer;\n        readonly List<int> _indexBuffer;\n\n        int _id;\n        bool _isEnabled;\n\n        int _totalComponents;\n        IComponent[] _components;\n        Stack<IComponent>[] _componentPools;\n        ContextInfo _contextInfo;\n        IAERC _aerc;\n\n        IComponent[] _componentsCache;\n        int[] _componentIndexesCache;\n        string _toStringCache;\n\n        public Entity()\n        {\n            _componentBuffer = new List<IComponent>();\n            _indexBuffer = new List<int>();\n        }\n\n        public void Initialize(int creationIndex, int totalComponents, Stack<IComponent>[] componentPools, ContextInfo contextInfo = null, IAERC aerc = null)\n        {\n            Reuse(creationIndex);\n\n            _totalComponents = totalComponents;\n            _components = new IComponent[totalComponents];\n            _componentPools = componentPools;\n\n            _contextInfo = contextInfo ?? CreateDefaultContextInfo();\n            _aerc = aerc ?? new SafeAERC(this);\n        }\n\n        ContextInfo CreateDefaultContextInfo()\n        {\n            var componentNames = new string[TotalComponents];\n            for (var i = 0; i < componentNames.Length; i++)\n                componentNames[i] = i.ToString();\n\n            return new ContextInfo(\"No Context\", componentNames, null);\n        }\n\n        public void Reuse(int id)\n        {\n            _id = id;\n            _isEnabled = true;\n        }\n\n        /// Adds a component at the specified index.\n        /// You can only have one component at an index.\n        /// Each component type must have its own constant index.\n        /// The preferred way is to use the\n        /// generated methods from the code generator.\n        public void AddComponent(int index, IComponent component)\n        {\n            if (!_isEnabled)\n                throw new EntityIsNotEnabledException($\"Cannot add component '{_contextInfo.ComponentNames[index]}' to {this}!\");\n\n            if (HasComponent(index))\n                throw new EntityAlreadyHasComponentException(index,\n                    $\"Cannot add component '{_contextInfo.ComponentNames[index]}' to {this}!\",\n                    \"You should check if an entity already has the component before adding it or use entity.ReplaceComponent().\"\n                );\n\n            _components[index] = component;\n            _componentsCache = null;\n            _componentIndexesCache = null;\n            _toStringCache = null;\n            OnComponentAdded?.Invoke(this, index, component);\n        }\n\n        /// Removes a component at the specified index.\n        /// You can only remove a component at an index if it exists.\n        /// The preferred way is to use the\n        /// generated methods from the code generator.\n        public void RemoveComponent(int index)\n        {\n            if (!_isEnabled)\n                throw new EntityIsNotEnabledException($\"Cannot remove component '{_contextInfo.ComponentNames[index]}' from {this}!\");\n\n            if (!HasComponent(index))\n                throw new EntityDoesNotHaveComponentException(index,\n                    $\"Cannot remove component '{_contextInfo.ComponentNames[index]}' from {this}!\",\n                    \"You should check if an entity has the component before removing it.\");\n\n            HandleComponent(index, null);\n        }\n\n        /// Replaces an existing component at the specified index\n        /// or adds it if it doesn't exist yet.\n        /// The preferred way is to use the\n        /// generated methods from the code generator.\n        public void ReplaceComponent(int index, IComponent component)\n        {\n            if (!_isEnabled)\n                throw new EntityIsNotEnabledException($\"Cannot replace component '{_contextInfo.ComponentNames[index]}' on {this}!\");\n\n            if (HasComponent(index))\n                HandleComponent(index, component);\n            else if (component != null)\n                AddComponent(index, component);\n        }\n\n        void HandleComponent(int index, IComponent newComponent)\n        {\n            var previousComponent = _components[index];\n            if (newComponent != previousComponent)\n            {\n                _components[index] = newComponent;\n                _componentsCache = null;\n                _toStringCache = null;\n                if (newComponent != null)\n                {\n                    OnComponentReplaced?.Invoke(this, index, previousComponent, newComponent);\n                }\n                else\n                {\n                    _componentIndexesCache = null;\n                    OnComponentRemoved?.Invoke(this, index, previousComponent);\n                }\n\n                GetComponentPool(index).Push(previousComponent);\n            }\n            else\n            {\n                OnComponentReplaced?.Invoke(this, index, previousComponent, newComponent);\n            }\n        }\n\n        /// Returns a component at the specified index.\n        /// You can only get a component at an index if it exists.\n        /// The preferred way is to use the\n        /// generated methods from the code generator.\n        public IComponent GetComponent(int index)\n        {\n            if (!HasComponent(index))\n                throw new EntityDoesNotHaveComponentException(index,\n                    $\"Cannot get component '{_contextInfo.ComponentNames[index]}' from {this}!\",\n                    \"You should check if an entity has the component before getting it.\");\n\n            return _components[index];\n        }\n\n        /// Returns all added components.\n        public IComponent[] GetComponents()\n        {\n            if (_componentsCache == null)\n            {\n                for (var i = 0; i < _components.Length; i++)\n                {\n                    var component = _components[i];\n                    if (component != null)\n                        _componentBuffer.Add(component);\n                }\n\n                _componentsCache = _componentBuffer.ToArray();\n                _componentBuffer.Clear();\n            }\n\n            return _componentsCache;\n        }\n\n        /// Returns all indexes of added components.\n        public int[] GetComponentIndexes()\n        {\n            if (_componentIndexesCache == null)\n            {\n                for (var i = 0; i < _components.Length; i++)\n                    if (_components[i] != null)\n                        _indexBuffer.Add(i);\n\n                _componentIndexesCache = _indexBuffer.ToArray();\n                _indexBuffer.Clear();\n            }\n\n            return _componentIndexesCache;\n        }\n\n        /// Determines whether this entity has a component\n        /// at the specified index.\n        public bool HasComponent(int index) => _components[index] != null;\n\n        /// Determines whether this entity has components\n        /// at all the specified indexes.\n        public bool HasComponents(int[] indexes)\n        {\n            for (var i = 0; i < indexes.Length; i++)\n                if (_components[indexes[i]] == null)\n                    return false;\n\n            return true;\n        }\n\n        /// Determines whether this entity has a component\n        /// at any of the specified indexes.\n        public bool HasAnyComponent(int[] indexes)\n        {\n            for (var i = 0; i < indexes.Length; i++)\n                if (_components[indexes[i]] != null)\n                    return true;\n\n            return false;\n        }\n\n        /// Determines whether this entity has any component\n        public bool IsEmpty()\n        {\n            for (var i = 0; i < _components.Length; i++)\n                if (_components[i] != null)\n                    return false;\n\n            return true;\n        }\n\n        /// Removes all components.\n        public void RemoveAllComponents()\n        {\n            _toStringCache = null;\n            for (var i = 0; i < _components.Length; i++)\n                if (_components[i] != null)\n                    HandleComponent(i, null);\n        }\n\n        /// Returns the ComponentPool for the specified component index.\n        /// ComponentPools is set by the context which created the entity and\n        /// is used to reuse removed components.\n        /// Removed components will be pushed to the ComponentPool.\n        /// Use entity.CreateComponent(index, type) to get a new or\n        /// reusable component from the componentPool.\n        public Stack<IComponent> GetComponentPool(int index)\n        {\n            var componentPool = _componentPools[index];\n            if (componentPool == null)\n            {\n                componentPool = new Stack<IComponent>();\n                _componentPools[index] = componentPool;\n            }\n\n            return componentPool;\n        }\n\n        /// Returns a new or reusable component from the ComponentPool\n        /// for the specified component index.\n        public IComponent CreateComponent(int index, Type type)\n        {\n            var componentPool = GetComponentPool(index);\n            return componentPool.Count > 0\n                ? componentPool.Pop()\n                : (IComponent)Activator.CreateInstance(type);\n        }\n\n        /// Returns a new or reusable component from the ComponentPool\n        /// for the specified component index.\n        public T CreateComponent<T>(int index) where T : new()\n        {\n            var componentPool = GetComponentPool(index);\n            return componentPool.Count > 0\n                ? (T)componentPool.Pop()\n                : new T();\n        }\n\n        /// Returns the number of objects that retain this entity.\n        public int RetainCount => _aerc.RetainCount;\n\n        /// Retains the entity. An owner can only retain the same entity once.\n        /// Retain/Release is part of AERC (Automatic Entity Reference Counting)\n        /// and is used internally to prevent pooling retained entities.\n        /// If you use retain manually you also have to\n        /// release it manually at some point.\n        public void Retain(object owner) => _aerc.Retain(owner);\n\n        /// Releases the entity. An owner can only release an entity\n        /// if it retains it.\n        /// Retain/Release is part of AERC (Automatic Entity Reference Counting)\n        /// and is used internally to prevent pooling retained entities.\n        /// If you use retain manually you also have to\n        /// release it manually at some point.\n        public void Release(object owner)\n        {\n            _aerc.Release(owner);\n            if (_aerc.RetainCount == 0)\n                OnEntityReleased?.Invoke(this);\n        }\n\n        // Dispatches OnDestroyEntity which will start the destroy process.\n        public void Destroy()\n        {\n            if (!_isEnabled)\n                throw new EntityIsNotEnabledException($\"Cannot destroy {this}!\");\n\n            OnDestroyEntity?.Invoke(this);\n        }\n\n        // This method is used internally. Don't call it yourself.\n        // Use entity.Destroy();\n        public void InternalDestroy()\n        {\n            _isEnabled = false;\n            RemoveAllComponents();\n            OnComponentAdded = null;\n            OnComponentReplaced = null;\n            OnComponentRemoved = null;\n            OnDestroyEntity = null;\n        }\n\n        // Do not call this method manually. This method is called by the context.\n        public void RemoveAllOnEntityReleasedHandlers() => OnEntityReleased = null;\n\n        /// Returns a cached string to describe the entity\n        /// with the following format:\n        /// Entity_{creationIndex}(*{retainCount})({list of components})\n        public override string ToString()\n        {\n            return _toStringCache ??= $\"Entity_{_id}({string.Join(\", \", GetComponents().Select(component => component.ToString()))})\";\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Entity/EntityEqualityComparer.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Entitas\n{\n    public class EntityEqualityComparer<TEntity> : IEqualityComparer<TEntity> where TEntity : Entity\n    {\n        public static readonly IEqualityComparer<TEntity> Comparer = new EntityEqualityComparer<TEntity>();\n\n        public bool Equals(TEntity x, TEntity y) => x == y;\n\n        public int GetHashCode(TEntity obj) => obj.Id;\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Entity/Exceptions/EntityAlreadyHasComponentException.cs",
    "content": "﻿namespace Entitas\n{\n    public class EntityAlreadyHasComponentException : EntitasException\n    {\n        public EntityAlreadyHasComponentException(int index, string message, string hint) :\n            base($\"{message}\\nEntity already has a component at index {index}!\", hint) { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Entity/Exceptions/EntityDoesNotHaveComponentException.cs",
    "content": "﻿namespace Entitas\n{\n    public class EntityDoesNotHaveComponentException : EntitasException\n    {\n        public EntityDoesNotHaveComponentException(int index, string message, string hint) :\n            base($\"{message}\\nEntity does not have a component at index {index}!\", hint) { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Entity/Exceptions/EntityIsAlreadyRetainedByOwnerException.cs",
    "content": "﻿namespace Entitas\n{\n    public class EntityIsAlreadyRetainedByOwnerException : EntitasException\n    {\n        public EntityIsAlreadyRetainedByOwnerException(Entity entity, object owner) :\n            base($\"'{owner}' cannot retain {entity}!\\nEntity is already retained by this object!\",\n                \"The entity must be released by this object first.\") { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Entity/Exceptions/EntityIsNotEnabledException.cs",
    "content": "﻿namespace Entitas\n{\n    public class EntityIsNotEnabledException : EntitasException\n    {\n        public EntityIsNotEnabledException(string message) :\n            base($\"{message}\\nEntity is not enabled!\",\n                \"The entity has already been destroyed. You cannot modify destroyed entities.\") { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Entity/Exceptions/EntityIsNotRetainedByOwnerException.cs",
    "content": "﻿namespace Entitas\n{\n    public class EntityIsNotRetainedByOwnerException : EntitasException\n    {\n        public EntityIsNotRetainedByOwnerException(Entity entity, object owner) :\n            base($\"'{owner}' cannot release {entity}!\\nEntity is not retained by this object!\",\n                \"An entity can only be released from objects that retain it.\") { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Entity/IAERC.cs",
    "content": "﻿namespace Entitas\n{\n    public interface IAERC\n    {\n        int RetainCount { get; }\n        void Retain(object owner);\n        void Release(object owner);\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Entity/SafeAERC.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace Entitas\n{\n    /// Automatic Entity Reference Counting (AERC)\n    /// is used internally to prevent pooling retained entities.\n    /// If you use retain manually you also have to\n    /// release it manually at some point.\n    /// SafeAERC checks if the entity has already been\n    /// retained or released. It's slower than UnsafeAERC, but you keep the information\n    /// about the owners.\n    public sealed class SafeAERC : IAERC\n    {\n        public static readonly Func<Entity, IAERC> Delegate = entity => new SafeAERC(entity);\n\n        public int RetainCount => _owners.Count;\n        public HashSet<object> Owners => _owners;\n\n        readonly Entity _entity;\n        readonly HashSet<object> _owners = new HashSet<object>();\n\n        public SafeAERC(Entity entity)\n        {\n            _entity = entity;\n        }\n\n        public void Retain(object owner)\n        {\n            if (!Owners.Add(owner))\n                throw new EntityIsAlreadyRetainedByOwnerException(_entity, owner);\n        }\n\n        public void Release(object owner)\n        {\n            if (!Owners.Remove(owner))\n                throw new EntityIsNotRetainedByOwnerException(_entity, owner);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Entity/UnsafeAERC.cs",
    "content": "﻿using System;\n\nnamespace Entitas\n{\n    /// Automatic Entity Reference Counting (AERC)\n    /// is used internally to prevent pooling retained entities.\n    /// If you use retain manually you also have to\n    /// release it manually at some point.\n    /// UnsafeAERC doesn't check if the entity has already been\n    /// retained or released. It's faster than SafeAERC, but you lose the information\n    /// about the owners.\n    public sealed class UnsafeAERC : IAERC\n    {\n        public static readonly Func<Entity, IAERC> Delegate = entity => new UnsafeAERC();\n\n        public int RetainCount => _retainCount;\n\n        int _retainCount;\n\n        public void Retain(object owner) => _retainCount += 1;\n\n        public void Release(object owner) => _retainCount -= 1;\n    }\n}\n"
  },
  {
    "path": "src/Entitas/EntityIndex/AbstractEntityIndex.cs",
    "content": "﻿using System;\n\nnamespace Entitas\n{\n    public abstract class AbstractEntityIndex<TEntity, TKey> : IEntityIndex where TEntity : Entity\n    {\n        public string Name => _name;\n\n        protected readonly string _name;\n        protected readonly IGroup<TEntity> _group;\n        protected readonly Func<TEntity, IComponent, TKey> _getKey;\n        protected readonly Func<TEntity, IComponent, TKey[]> _getKeys;\n        protected readonly bool _isSingleKey;\n\n        protected AbstractEntityIndex(string name, IGroup<TEntity> group, Func<TEntity, IComponent, TKey> getKey)\n        {\n            _name = name;\n            _group = group;\n            _getKey = getKey;\n            _isSingleKey = true;\n        }\n\n        protected AbstractEntityIndex(string name, IGroup<TEntity> group, Func<TEntity, IComponent, TKey[]> getKeys)\n        {\n            _name = name;\n            _group = group;\n            _getKeys = getKeys;\n            _isSingleKey = false;\n        }\n\n        public virtual void Activate()\n        {\n            _group.OnEntityAdded += OnEntityAdded;\n            _group.OnEntityRemoved += OnEntityRemoved;\n        }\n\n        public virtual void Deactivate()\n        {\n            _group.OnEntityAdded -= OnEntityAdded;\n            _group.OnEntityRemoved -= OnEntityRemoved;\n            Clear();\n        }\n\n        public override string ToString() => Name;\n\n        protected void IndexEntities(IGroup<TEntity> group)\n        {\n            foreach (var entity in group)\n            {\n                if (_isSingleKey)\n                {\n                    AddEntity(_getKey(entity, null), entity);\n                }\n                else\n                {\n                    var keys = _getKeys(entity, null);\n                    for (var i = 0; i < keys.Length; i++)\n                        AddEntity(keys[i], entity);\n                }\n            }\n        }\n\n        protected void OnEntityAdded(IGroup<TEntity> group, TEntity entity, int index, IComponent component)\n        {\n            if (_isSingleKey)\n            {\n                AddEntity(_getKey(entity, component), entity);\n            }\n            else\n            {\n                var keys = _getKeys(entity, component);\n                for (var i = 0; i < keys.Length; i++)\n                    AddEntity(keys[i], entity);\n            }\n        }\n\n        protected void OnEntityRemoved(IGroup<TEntity> group, TEntity entity, int index, IComponent component)\n        {\n            if (_isSingleKey)\n            {\n                RemoveEntity(_getKey(entity, component), entity);\n            }\n            else\n            {\n                var keys = _getKeys(entity, component);\n                for (var i = 0; i < keys.Length; i++)\n                    RemoveEntity(keys[i], entity);\n            }\n        }\n\n        protected abstract void AddEntity(TKey key, TEntity entity);\n\n        protected abstract void RemoveEntity(TKey key, TEntity entity);\n\n        protected abstract void Clear();\n\n        ~AbstractEntityIndex() => Deactivate();\n    }\n}\n"
  },
  {
    "path": "src/Entitas/EntityIndex/EntityIndex.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Entitas\n{\n    public class EntityIndex<TEntity, TKey> : AbstractEntityIndex<TEntity, TKey> where TEntity : Entity\n    {\n        readonly Dictionary<TKey, HashSet<TEntity>> _index;\n\n        public EntityIndex(string name, IGroup<TEntity> group, Func<TEntity, IComponent, TKey> getKey) : base(name, group, getKey)\n        {\n            _index = new Dictionary<TKey, HashSet<TEntity>>();\n            Activate();\n        }\n\n        public EntityIndex(string name, IGroup<TEntity> group, Func<TEntity, IComponent, TKey[]> getKeys) : base(name, group, getKeys)\n        {\n            _index = new Dictionary<TKey, HashSet<TEntity>>();\n            Activate();\n        }\n\n        public EntityIndex(string name, IGroup<TEntity> group, Func<TEntity, IComponent, TKey> getKey, IEqualityComparer<TKey> comparer) : base(name, group, getKey)\n        {\n            _index = new Dictionary<TKey, HashSet<TEntity>>(comparer);\n            Activate();\n        }\n\n        public EntityIndex(string name, IGroup<TEntity> group, Func<TEntity, IComponent, TKey[]> getKeys, IEqualityComparer<TKey> comparer) : base(name, group, getKeys)\n        {\n            _index = new Dictionary<TKey, HashSet<TEntity>>(comparer);\n            Activate();\n        }\n\n        public override void Activate()\n        {\n            base.Activate();\n            IndexEntities(_group);\n        }\n\n        public HashSet<TEntity> GetEntities(TKey key)\n        {\n            if (!_index.TryGetValue(key, out var entities))\n            {\n                entities = new HashSet<TEntity>(EntityEqualityComparer<TEntity>.Comparer);\n                _index.Add(key, entities);\n            }\n\n            return entities;\n        }\n\n        public override string ToString() => $\"EntityIndex({Name})\";\n\n        protected override void Clear()\n        {\n            foreach (var entities in _index.Values)\n            {\n                foreach (var entity in entities)\n                {\n                    if (entity.Aerc is SafeAERC safeAerc)\n                    {\n                        if (safeAerc.Owners.Contains(this))\n                            entity.Release(this);\n                    }\n                    else\n                    {\n                        entity.Release(this);\n                    }\n                }\n            }\n\n            _index.Clear();\n        }\n\n        protected override void AddEntity(TKey key, TEntity entity)\n        {\n            GetEntities(key).Add(entity);\n\n            if (entity.Aerc is SafeAERC safeAerc)\n            {\n                if (!safeAerc.Owners.Contains(this))\n                    entity.Retain(this);\n            }\n            else\n            {\n                entity.Retain(this);\n            }\n        }\n\n        protected override void RemoveEntity(TKey key, TEntity entity)\n        {\n            GetEntities(key).Remove(entity);\n\n            if (entity.Aerc is SafeAERC safeAerc)\n            {\n                if (safeAerc.Owners.Contains(this))\n                    entity.Release(this);\n            }\n            else\n            {\n                entity.Release(this);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/EntityIndex/EntityIndexException.cs",
    "content": "﻿namespace Entitas\n{\n    public class EntityIndexException : EntitasException\n    {\n        public EntityIndexException(string message, string hint) : base(message, hint) { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/EntityIndex/IEntityIndex.cs",
    "content": "﻿namespace Entitas\n{\n    public interface IEntityIndex\n    {\n        string Name { get; }\n\n        void Activate();\n        void Deactivate();\n    }\n}\n"
  },
  {
    "path": "src/Entitas/EntityIndex/PrimaryEntityIndex.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace Entitas\n{\n    public class PrimaryEntityIndex<TEntity, TKey> : AbstractEntityIndex<TEntity, TKey> where TEntity : Entity\n    {\n        readonly Dictionary<TKey, TEntity> _index;\n\n        public PrimaryEntityIndex(string name, IGroup<TEntity> group, Func<TEntity, IComponent, TKey> getKey) : base(name, group, getKey)\n        {\n            _index = new Dictionary<TKey, TEntity>();\n            Activate();\n        }\n\n        public PrimaryEntityIndex(string name, IGroup<TEntity> group, Func<TEntity, IComponent, TKey[]> getKeys) : base(name, group, getKeys)\n        {\n            _index = new Dictionary<TKey, TEntity>();\n            Activate();\n        }\n\n        public PrimaryEntityIndex(string name, IGroup<TEntity> group, Func<TEntity, IComponent, TKey> getKey, IEqualityComparer<TKey> comparer) : base(name, group, getKey)\n        {\n            _index = new Dictionary<TKey, TEntity>(comparer);\n            Activate();\n        }\n\n        public PrimaryEntityIndex(string name, IGroup<TEntity> group, Func<TEntity, IComponent, TKey[]> getKeys, IEqualityComparer<TKey> comparer) : base(name, group, getKeys)\n        {\n            _index = new Dictionary<TKey, TEntity>(comparer);\n            Activate();\n        }\n\n        public override void Activate()\n        {\n            base.Activate();\n            IndexEntities(_group);\n        }\n\n        public TEntity GetEntity(TKey key)\n        {\n            _index.TryGetValue(key, out var entity);\n            return entity;\n        }\n\n        public override string ToString() => $\"PrimaryEntityIndex({Name})\";\n\n        protected override void Clear()\n        {\n            foreach (var entity in _index.Values)\n            {\n                if (entity.Aerc is SafeAERC safeAerc)\n                {\n                    if (safeAerc.Owners.Contains(this))\n                        entity.Release(this);\n                }\n                else\n                {\n                    entity.Release(this);\n                }\n            }\n\n            _index.Clear();\n        }\n\n        protected override void AddEntity(TKey key, TEntity entity)\n        {\n            if (_index.ContainsKey(key))\n                throw new EntityIndexException(\n                    $\"Entity for key '{key}' already exists!\",\n                    \"Only one entity for a primary key is allowed.\");\n\n            _index.Add(key, entity);\n\n            if (entity.Aerc is SafeAERC safeAerc)\n            {\n                if (!safeAerc.Owners.Contains(this))\n                    entity.Retain(this);\n            }\n            else\n            {\n                entity.Retain(this);\n            }\n        }\n\n        protected override void RemoveEntity(TKey key, TEntity entity)\n        {\n            _index.Remove(key);\n\n            if (entity.Aerc is SafeAERC safeAerc)\n            {\n                if (safeAerc.Owners.Contains(this))\n                    entity.Release(this);\n            }\n            else\n            {\n                entity.Release(this);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Extensions/CollectionExtension.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\n\nnamespace Entitas\n{\n    public static class CollectionExtension\n    {\n        /// Returns the only entity in the collection.\n        /// It will throw an exception if the collection doesn't have\n        /// exactly one entity.\n        public static Entity SingleEntity(this ICollection<Entity> collection)\n        {\n            if (collection.Count != 1)\n                throw new SingleEntityException(collection.Count);\n\n            return collection.First();\n        }\n\n        /// Returns the only entity in the collection.\n        /// It will throw an exception if the collection doesn't have\n        /// exactly one entity.\n        public static TEntity SingleEntity<TEntity>(this ICollection<TEntity> collection) where TEntity : Entity\n        {\n            if (collection.Count != 1)\n                throw new SingleEntityException(collection.Count);\n\n            return collection.First();\n        }\n    }\n\n    public class SingleEntityException : EntitasException\n    {\n        public SingleEntityException(int count) :\n            base($\"Expected exactly one entity in collection but found {count}!\",\n                \"Use collection.SingleEntity() only when you are sure that there is exactly one entity.\") { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Extensions/EntitasStringExtension.cs",
    "content": "﻿namespace Entitas\n{\n    public static class EntitasStringExtension\n    {\n        public static string RemoveSuffix(this string str, string suffix)\n        {\n            return str.EndsWith(suffix, System.StringComparison.Ordinal)\n                ? str.Substring(0, str.Length - suffix.Length)\n                : str;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Group/Group.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\n\nnamespace Entitas\n{\n    /// Use context.GetGroup(matcher) to get a group of entities which match\n    /// the specified matcher. Calling context.GetGroup(matcher) with the\n    /// same matcher will always return the same instance of the group.\n    /// The created group is managed by the context and will always be up to date.\n    /// It will automatically add entities that match the matcher or\n    /// remove entities as soon as they don't match the matcher anymore.\n    public class Group<TEntity> : IGroup<TEntity> where TEntity : Entity\n    {\n        /// Occurs when an entity gets added.\n        public event GroupChanged<TEntity> OnEntityAdded;\n\n        /// Occurs when an entity gets removed.\n        public event GroupChanged<TEntity> OnEntityRemoved;\n\n        /// Occurs when a component of an entity in the group gets replaced.\n        public event GroupUpdated<TEntity> OnEntityUpdated;\n\n        /// Returns the number of entities in the group.\n        public int Count => _entities.Count;\n\n        /// Returns the matcher which was used to create this group.\n        public IMatcher<TEntity> Matcher => _matcher;\n\n        readonly IMatcher<TEntity> _matcher;\n        readonly HashSet<TEntity> _entities = new HashSet<TEntity>(EntityEqualityComparer<TEntity>.Comparer);\n\n        TEntity[] _entitiesCache;\n        TEntity _singleEntityCache;\n        string _toStringCache;\n\n        /// Use context.GetGroup(matcher) to get a group of entities which match\n        /// the specified matcher.\n        public Group(IMatcher<TEntity> matcher)\n        {\n            _matcher = matcher;\n        }\n\n        /// This is used by the context to manage the group.\n        public void HandleEntitySilently(TEntity entity)\n        {\n            if (_matcher.Matches(entity))\n                AddEntitySilently(entity);\n            else\n                RemoveEntitySilently(entity);\n        }\n\n        /// This is used by the context to manage the group.\n        public void HandleEntity(TEntity entity, int index, IComponent component)\n        {\n            if (_matcher.Matches(entity))\n                AddEntity(entity, index, component);\n            else\n                RemoveEntity(entity, index, component);\n        }\n\n        /// This is used by the context to manage the group.\n        public void UpdateEntity(TEntity entity, int index, IComponent previousComponent, IComponent newComponent)\n        {\n            if (_entities.Contains(entity))\n            {\n                OnEntityRemoved?.Invoke(this, entity, index, previousComponent);\n                OnEntityAdded?.Invoke(this, entity, index, newComponent);\n                OnEntityUpdated?.Invoke(this, entity, index, previousComponent, newComponent);\n            }\n        }\n\n        /// Removes all event handlers from this group.\n        /// Keep in mind that this will break reactive systems and\n        /// entity indexes which rely on this group.\n        public void RemoveAllEventHandlers()\n        {\n            OnEntityAdded = null;\n            OnEntityRemoved = null;\n            OnEntityUpdated = null;\n        }\n\n        public GroupChanged<TEntity> HandleEntity(TEntity entity) =>\n            _matcher.Matches(entity)\n                ? AddEntitySilently(entity) ? OnEntityAdded : null\n                : RemoveEntitySilently(entity)\n                    ? OnEntityRemoved\n                    : null;\n\n        bool AddEntitySilently(TEntity entity)\n        {\n            if (entity.IsEnabled)\n            {\n                var added = _entities.Add(entity);\n                if (added)\n                {\n                    _entitiesCache = null;\n                    _singleEntityCache = null;\n                    entity.Retain(this);\n                }\n\n                return added;\n            }\n\n            return false;\n        }\n\n        void AddEntity(TEntity entity, int index, IComponent component)\n        {\n            if (AddEntitySilently(entity))\n                OnEntityAdded?.Invoke(this, entity, index, component);\n        }\n\n        bool RemoveEntitySilently(TEntity entity)\n        {\n            var removed = _entities.Remove(entity);\n            if (removed)\n            {\n                _entitiesCache = null;\n                _singleEntityCache = null;\n                entity.Release(this);\n            }\n\n            return removed;\n        }\n\n        void RemoveEntity(TEntity entity, int index, IComponent component)\n        {\n            var removed = _entities.Remove(entity);\n            if (removed)\n            {\n                _entitiesCache = null;\n                _singleEntityCache = null;\n                OnEntityRemoved?.Invoke(this, entity, index, component);\n                entity.Release(this);\n            }\n        }\n\n        /// Determines whether this group has the specified entity.\n        public bool ContainsEntity(TEntity entity) => _entities.Contains(entity);\n\n        /// Returns all entities which are currently in this group.\n        public TEntity[] GetEntities()\n        {\n            return _entitiesCache ??= _entities.ToArray();\n        }\n\n        /// Fills the buffer with all entities which are currently in this group.\n        public List<TEntity> GetEntities(List<TEntity> buffer)\n        {\n            buffer.Clear();\n            buffer.AddRange(_entities);\n            return buffer;\n        }\n\n        public IEnumerable<TEntity> AsEnumerable() => _entities;\n\n        public HashSet<TEntity>.Enumerator GetEnumerator() => _entities.GetEnumerator();\n\n        /// Returns the only entity in this group. It will return null\n        /// if the group is empty. It will throw an exception if the group\n        /// has more than one entity.\n        public TEntity GetSingleEntity()\n        {\n            if (_singleEntityCache == null)\n            {\n                var c = _entities.Count;\n                if (c == 1)\n                {\n                    using (var enumerator = _entities.GetEnumerator())\n                    {\n                        enumerator.MoveNext();\n                        _singleEntityCache = enumerator.Current;\n                    }\n                }\n                else if (c == 0)\n                {\n                    return null;\n                }\n                else\n                {\n                    throw new GroupSingleEntityException<TEntity>(this);\n                }\n            }\n\n            return _singleEntityCache;\n        }\n\n        public override string ToString() => _toStringCache ??= $\"Group({_matcher})\";\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Group/GroupEvent.cs",
    "content": "namespace Entitas\n{\n    public enum GroupEvent : byte\n    {\n        Added,\n        Removed,\n        AddedOrRemoved\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Group/GroupExtension.cs",
    "content": "﻿namespace Entitas\n{\n    public static class GroupExtension\n    {\n        /// Creates a Collector for this group.\n        public static ICollector<TEntity> CreateCollector<TEntity>(this IGroup<TEntity> group, GroupEvent groupEvent = GroupEvent.Added) where TEntity : Entity =>\n            new Collector<TEntity>(group, groupEvent);\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Group/GroupSingleEntityException.cs",
    "content": "﻿using System.Linq;\n\nnamespace Entitas\n{\n    public class GroupSingleEntityException<TEntity> : EntitasException where TEntity : Entity\n    {\n        public GroupSingleEntityException(IGroup<TEntity> group) :\n            base($\"Cannot get the single entity from {group}!\\nGroup contains {group.Count} entities:\",\n                string.Join(\"\\n\", group.GetEntities().Select(entity => entity.ToString()))) { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Group/IGroup.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Entitas\n{\n    public delegate void GroupChanged<TEntity>(\n        IGroup<TEntity> group, TEntity entity, int index, IComponent component\n    ) where TEntity : Entity;\n\n    public delegate void GroupUpdated<TEntity>(\n        IGroup<TEntity> group, TEntity entity, int index,\n        IComponent previousComponent, IComponent newComponent\n    ) where TEntity : Entity;\n\n    public interface IGroup\n    {\n        int Count { get; }\n\n        void RemoveAllEventHandlers();\n    }\n\n    public interface IGroup<TEntity> : IGroup where TEntity : Entity\n    {\n        event GroupChanged<TEntity> OnEntityAdded;\n        event GroupChanged<TEntity> OnEntityRemoved;\n        event GroupUpdated<TEntity> OnEntityUpdated;\n\n        IMatcher<TEntity> Matcher { get; }\n\n        void HandleEntitySilently(TEntity entity);\n        void HandleEntity(TEntity entity, int index, IComponent component);\n        GroupChanged<TEntity> HandleEntity(TEntity entity);\n\n        void UpdateEntity(TEntity entity, int index, IComponent previousComponent, IComponent newComponent);\n\n        bool ContainsEntity(TEntity entity);\n\n        TEntity[] GetEntities();\n        List<TEntity> GetEntities(List<TEntity> buffer);\n        TEntity GetSingleEntity();\n\n        IEnumerable<TEntity> AsEnumerable();\n        HashSet<TEntity>.Enumerator GetEnumerator();\n    }\n}\n"
  },
  {
    "path": "src/Entitas/IComponent.cs",
    "content": "﻿namespace Entitas\n{\n    /// Implement this interface if you want to create a component which\n    /// you can add to an entity.\n    /// Mandatory attributes from Entitas.Generators.Attributes:\n    /// [Context(typeof(MainContext))]: Use the context attribute to make this\n    /// component available in the specified context.\n    /// Optionally, you can add these attributes:\n    /// [Unique]: the code generator will generate additional methods for\n    /// the context to ensure that only one entity with this component exists.\n    /// E.g. context.AddLoading() or context.SetPlayerName(name);\n    /// More available attributes can be found in Entitas.Generators.Attributes.\n    public interface IComponent { }\n}\n"
  },
  {
    "path": "src/Entitas/Matcher/Interfaces/IAllOfMatcher.cs",
    "content": "﻿namespace Entitas\n{\n    public interface IAllOfMatcher<TEntity> : IAnyOfMatcher<TEntity> where TEntity : Entity\n    {\n        IAnyOfMatcher<TEntity> AnyOf(params int[] indexes);\n        IAnyOfMatcher<TEntity> AnyOf(params IMatcher<TEntity>[] matchers);\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Matcher/Interfaces/IAnyOfMatcher.cs",
    "content": "﻿namespace Entitas\n{\n    public interface IAnyOfMatcher<TEntity> : INoneOfMatcher<TEntity> where TEntity : Entity\n    {\n        INoneOfMatcher<TEntity> NoneOf(params int[] indexes);\n        INoneOfMatcher<TEntity> NoneOf(params IMatcher<TEntity>[] matchers);\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Matcher/Interfaces/ICompoundMatcher.cs",
    "content": "﻿namespace Entitas\n{\n    public interface ICompoundMatcher<TEntity> : IMatcher<TEntity> where TEntity : Entity\n    {\n        int[] AllOfIndexes { get; }\n        int[] AnyOfIndexes { get; }\n        int[] NoneOfIndexes { get; }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Matcher/Interfaces/IMatcher.cs",
    "content": "﻿namespace Entitas\n{\n    public interface IMatcher<TEntity> where TEntity : Entity\n    {\n        int[] Indexes { get; }\n        bool Matches(TEntity entity);\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Matcher/Interfaces/INoneOfMatcher.cs",
    "content": "﻿namespace Entitas\n{\n    public interface INoneOfMatcher<TEntity> : ICompoundMatcher<TEntity> where TEntity : Entity { }\n}\n"
  },
  {
    "path": "src/Entitas/Matcher/Matcher.cs",
    "content": "﻿namespace Entitas\n{\n    public partial class Matcher<TEntity> : IAllOfMatcher<TEntity> where TEntity : Entity\n    {\n        public int[] Indexes => _indexes ??= MergeIndexes(_allOfIndexes, _anyOfIndexes, _noneOfIndexes);\n        public int[] AllOfIndexes => _allOfIndexes;\n        public int[] AnyOfIndexes => _anyOfIndexes;\n        public int[] NoneOfIndexes => _noneOfIndexes;\n\n        public string[] ComponentNames { get; set; }\n\n        int[] _indexes;\n        int[] _allOfIndexes;\n        int[] _anyOfIndexes;\n        int[] _noneOfIndexes;\n\n        Matcher() { }\n\n        IAnyOfMatcher<TEntity> IAllOfMatcher<TEntity>.AnyOf(params int[] indexes)\n        {\n            _anyOfIndexes = DistinctIndexes(indexes);\n            _indexes = null;\n            _isHashCached = false;\n            return this;\n        }\n\n        IAnyOfMatcher<TEntity> IAllOfMatcher<TEntity>.AnyOf(params IMatcher<TEntity>[] matchers) =>\n            ((IAllOfMatcher<TEntity>)this).AnyOf(MergeIndexes(matchers));\n\n        public INoneOfMatcher<TEntity> NoneOf(params int[] indexes)\n        {\n            _noneOfIndexes = DistinctIndexes(indexes);\n            _indexes = null;\n            _isHashCached = false;\n            return this;\n        }\n\n        public INoneOfMatcher<TEntity> NoneOf(params IMatcher<TEntity>[] matchers) =>\n            NoneOf(MergeIndexes(matchers));\n\n        public bool Matches(TEntity entity) =>\n            (_allOfIndexes == null || entity.HasComponents(_allOfIndexes))\n            && (_anyOfIndexes == null || entity.HasAnyComponent(_anyOfIndexes))\n            && (_noneOfIndexes == null || !entity.HasAnyComponent(_noneOfIndexes));\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Matcher/MatcherEquals.cs",
    "content": "namespace Entitas\n{\n    public partial class Matcher<TEntity>\n    {\n        public override bool Equals(object obj)\n        {\n            if (obj == null || obj.GetType() != GetType() || obj.GetHashCode() != GetHashCode())\n                return false;\n\n            var matcher = (Matcher<TEntity>)obj;\n            if (!EqualIndexes(matcher._allOfIndexes, _allOfIndexes))\n                return false;\n\n            if (!EqualIndexes(matcher._anyOfIndexes, _anyOfIndexes))\n                return false;\n\n            if (!EqualIndexes(matcher._noneOfIndexes, _noneOfIndexes))\n                return false;\n\n            return true;\n        }\n\n        static bool EqualIndexes(int[] i1, int[] i2)\n        {\n            if ((i1 == null) != (i2 == null))\n                return false;\n\n            if (i1 == null)\n                return true;\n\n            if (i1.Length != i2.Length)\n                return false;\n\n            for (var i = 0; i < i1.Length; i++)\n                if (i1[i] != i2[i])\n                    return false;\n\n            return true;\n        }\n\n        int _hash;\n        bool _isHashCached;\n\n        public override int GetHashCode()\n        {\n            if (!_isHashCached)\n            {\n                var hash = GetType().GetHashCode();\n                hash = ApplyHash(hash, _allOfIndexes, 3, 53);\n                hash = ApplyHash(hash, _anyOfIndexes, 307, 367);\n                hash = ApplyHash(hash, _noneOfIndexes, 647, 683);\n                _hash = hash;\n                _isHashCached = true;\n            }\n\n            return _hash;\n        }\n\n        static int ApplyHash(int hash, int[] indexes, int i1, int i2)\n        {\n            if (indexes != null)\n            {\n                for (var i = 0; i < indexes.Length; i++)\n                    hash ^= indexes[i] * i1;\n\n                hash ^= indexes.Length * i2;\n            }\n\n            return hash;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Matcher/MatcherException.cs",
    "content": "using System;\n\nnamespace Entitas\n{\n    public class MatcherException : Exception\n    {\n        public MatcherException(int indexes) : base($\"Matcher.Indexes.Length must be 1 but was {indexes}\") { }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Matcher/MatcherStatic.cs",
    "content": "using System;\nusing System.Collections.Generic;\n\nnamespace Entitas\n{\n    public partial class Matcher<TEntity>\n    {\n        [ThreadStatic] static List<int> _indexBufferThreadStatic;\n        static List<int> _indexBuffer => _indexBufferThreadStatic ??= new List<int>();\n\n        [ThreadStatic] static HashSet<int> _indexSetBufferThreadStatic;\n        static HashSet<int> _indexSetBuffer => _indexSetBufferThreadStatic ??= new HashSet<int>();\n\n        public static IAllOfMatcher<TEntity> AllOf(params int[] indexes)\n        {\n            var matcher = new Matcher<TEntity>();\n            matcher._allOfIndexes = DistinctIndexes(indexes);\n            return matcher;\n        }\n\n        public static IAllOfMatcher<TEntity> AllOf(params IMatcher<TEntity>[] matchers)\n        {\n            var allOfMatcher = (Matcher<TEntity>)AllOf(MergeIndexes(matchers));\n            SetComponentNames(allOfMatcher, matchers);\n            return allOfMatcher;\n        }\n\n        public static IAnyOfMatcher<TEntity> AnyOf(params int[] indexes)\n        {\n            var matcher = new Matcher<TEntity>();\n            matcher._anyOfIndexes = DistinctIndexes(indexes);\n            return matcher;\n        }\n\n        public static IAnyOfMatcher<TEntity> AnyOf(params IMatcher<TEntity>[] matchers)\n        {\n            var anyOfMatcher = (Matcher<TEntity>)AnyOf(MergeIndexes(matchers));\n            SetComponentNames(anyOfMatcher, matchers);\n            return anyOfMatcher;\n        }\n\n        static int[] MergeIndexes(int[] allOfIndexes, int[] anyOfIndexes, int[] noneOfIndexes)\n        {\n            if (allOfIndexes != null) _indexBuffer.AddRange(allOfIndexes);\n            if (anyOfIndexes != null) _indexBuffer.AddRange(anyOfIndexes);\n            if (noneOfIndexes != null) _indexBuffer.AddRange(noneOfIndexes);\n\n            var mergedIndexes = DistinctIndexes(_indexBuffer);\n            _indexBuffer.Clear();\n            return mergedIndexes;\n        }\n\n        static int[] MergeIndexes(IMatcher<TEntity>[] matchers)\n        {\n            var indexes = new int[matchers.Length];\n            for (var i = 0; i < matchers.Length; i++)\n            {\n                var matcher = matchers[i];\n                if (matcher.Indexes.Length != 1)\n                    throw new MatcherException(matcher.Indexes.Length);\n\n                indexes[i] = matcher.Indexes[0];\n            }\n\n            return indexes;\n        }\n\n        static string[] GetComponentNames(IMatcher<TEntity>[] matchers)\n        {\n            for (var i = 0; i < matchers.Length; i++)\n            {\n                if (matchers[i] is Matcher<TEntity> { ComponentNames: not null } m)\n                    return m.ComponentNames;\n            }\n\n            return null;\n        }\n\n        static void SetComponentNames(Matcher<TEntity> matcher, IMatcher<TEntity>[] matchers)\n        {\n            var componentNames = GetComponentNames(matchers);\n            if (componentNames != null)\n                matcher.ComponentNames = componentNames;\n        }\n\n        static int[] DistinctIndexes(IList<int> indexes)\n        {\n            foreach (var index in indexes)\n                _indexSetBuffer.Add(index);\n\n            var uniqueIndexes = new int[_indexSetBuffer.Count];\n            _indexSetBuffer.CopyTo(uniqueIndexes);\n            Array.Sort(uniqueIndexes);\n\n            _indexSetBuffer.Clear();\n\n            return uniqueIndexes;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Matcher/MatcherToString.cs",
    "content": "using System.Linq;\nusing System.Text;\n\nnamespace Entitas\n{\n    public partial class Matcher<TEntity>\n    {\n        string _toStringCache;\n\n        public override string ToString()\n        {\n            if (_toStringCache == null)\n            {\n                var sb = new StringBuilder();\n                if (_allOfIndexes != null)\n                {\n                    sb.Append(GetComponentNames(\"AllOf\", _allOfIndexes, ComponentNames));\n                }\n\n                if (_anyOfIndexes != null)\n                {\n                    if (_allOfIndexes != null)\n                        sb.Append(\".\");\n\n                    sb.Append(GetComponentNames(\"AnyOf\", _anyOfIndexes, ComponentNames));\n                }\n\n                if (_noneOfIndexes != null)\n                {\n                    sb.Append(GetComponentNames(\".NoneOf\", _noneOfIndexes, ComponentNames));\n                }\n\n                _toStringCache = sb.ToString();\n            }\n\n            return _toStringCache;\n        }\n\n        static string GetComponentNames(string prefix, int[] indexArray, string[] componentNames)\n        {\n            return componentNames != null\n                ? $\"{prefix}({string.Join(\", \", indexArray.Select(index => componentNames[index]))})\"\n                : $\"{prefix}({string.Join(\", \", indexArray.Select(index => index.ToString()))})\";\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Systems/Interfaces/ICleanupSystem.cs",
    "content": "﻿namespace Entitas\n{\n    /// Implement this interface if you want to create a system which should\n    /// execute cleanup logic after execution.\n    public interface ICleanupSystem : ISystem\n    {\n        void Cleanup();\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Systems/Interfaces/IExecuteSystem.cs",
    "content": "﻿namespace Entitas\n{\n    /// Implement this interface if you want to create a system which should be\n    /// executed every frame.\n    public interface IExecuteSystem : ISystem\n    {\n        void Execute();\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Systems/Interfaces/IInitializeSystem.cs",
    "content": "﻿namespace Entitas\n{\n    /// Implement this interface if you want to create a system which should be\n    /// initialized once in the beginning.\n    public interface IInitializeSystem : ISystem\n    {\n        void Initialize();\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Systems/Interfaces/IReactiveSystem.cs",
    "content": "﻿namespace Entitas\n{\n    public interface IReactiveSystem : IExecuteSystem\n    {\n        void Activate();\n        void Deactivate();\n        void Clear();\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Systems/Interfaces/ISystem.cs",
    "content": "﻿namespace Entitas\n{\n    /// This is the base interface for all systems.\n    /// It's not meant to be implemented.\n    /// Use IInitializeSystem, IExecuteSystem,\n    /// ICleanupSystem or ITearDownSystem.\n    public interface ISystem { }\n}\n"
  },
  {
    "path": "src/Entitas/Systems/Interfaces/ITearDownSystem.cs",
    "content": "﻿namespace Entitas\n{\n    /// Implement this interface if you want to create a system which should\n    /// tear down once in the end.\n    public interface ITearDownSystem : ISystem\n    {\n        void TearDown();\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Systems/ParallelSystem.cs",
    "content": "﻿using System.Linq;\n\nnamespace Entitas\n{\n    /// A ParallelSystem calls Execute(entities) with subsets of entities\n    /// and distributes the workload over multiple threads.\n    /// Don't use the generated methods like AddXyz() and ReplaceXyz() when\n    /// writing multi-threaded code in Entitas.\n    public abstract class ParallelSystem<TEntity> : IExecuteSystem where TEntity : Entity\n    {\n        readonly IGroup<TEntity> _group;\n\n        protected ParallelSystem(IGroup<TEntity> group)\n        {\n            _group = group;\n        }\n\n        public virtual void Execute()\n        {\n            _group\n                .GetEntities()\n                .AsParallel()\n                .ForAll(Execute);\n        }\n\n        protected abstract void Execute(TEntity entity);\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Systems/ReactiveSystem.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace Entitas\n{\n    /// A ReactiveSystem calls Execute(entities) if there were changes based on\n    /// the specified Collector and will only pass in changed entities.\n    /// A common use-case is to react to changes, e.g. a change of the position\n    /// of an entity to update the gameObject.transform.position\n    /// of the related gameObject.\n    public abstract class ReactiveSystem<TEntity> : IReactiveSystem where TEntity : Entity\n    {\n        readonly ICollector<TEntity> _collector;\n        readonly List<TEntity> _buffer = new List<TEntity>();\n\n        string _toStringCache;\n\n        protected ReactiveSystem(IContext<TEntity> context)\n        {\n            _collector = GetTrigger(context);\n        }\n\n        protected ReactiveSystem(ICollector<TEntity> collector)\n        {\n            _collector = collector;\n        }\n\n        /// Specify the collector that will trigger the ReactiveSystem.\n        protected abstract ICollector<TEntity> GetTrigger(IContext<TEntity> context);\n\n        /// This will exclude all entities which don't pass the filter.\n        protected abstract bool Filter(TEntity entity);\n\n        protected abstract void Execute(List<TEntity> entities);\n\n        /// Activates the ReactiveSystem and starts observing changes\n        /// based on the specified Collector.\n        /// ReactiveSystem are activated by default.\n        public void Activate() => _collector.Activate();\n\n        /// Deactivates the ReactiveSystem.\n        /// No changes will be tracked while deactivated.\n        /// This will also clear the ReactiveSystem.\n        /// ReactiveSystem are activated by default.\n        public void Deactivate() => _collector.Deactivate();\n\n        /// Clears all accumulated changes.\n        public void Clear() => _collector.ClearCollectedEntities();\n\n        /// Will call Execute(entities) with changed entities\n        /// if there are any. Otherwise it will not call Execute(entities).\n        public void Execute()\n        {\n            if (_collector.Count != 0)\n            {\n                foreach (var entity in _collector.CollectedEntities)\n                {\n                    if (Filter(entity))\n                    {\n                        entity.Retain(this);\n                        _buffer.Add(entity);\n                    }\n                }\n\n                _collector.ClearCollectedEntities();\n\n                if (_buffer.Count != 0)\n                {\n                    try\n                    {\n                        Execute(_buffer);\n                    }\n                    finally\n                    {\n                        for (var i = 0; i < _buffer.Count; i++)\n                            _buffer[i].Release(this);\n\n                        _buffer.Clear();\n                    }\n                }\n            }\n        }\n\n        public override string ToString() => _toStringCache ??= $\"ReactiveSystem({GetType().Name})\";\n\n        ~ReactiveSystem() => Deactivate();\n    }\n}\n"
  },
  {
    "path": "src/Entitas/Systems/Systems.cs",
    "content": "using System.Collections.Generic;\n\nnamespace Entitas\n{\n    /// Systems provide a convenient way to group systems.\n    /// You can add IInitializeSystem, IExecuteSystem, ICleanupSystem,\n    /// ITearDownSystem, ReactiveSystem and other nested Systems instances.\n    /// All systems will be initialized and executed based on the order\n    /// you added them.\n    public class Systems : IInitializeSystem, IExecuteSystem, ICleanupSystem, ITearDownSystem\n    {\n        protected readonly List<IInitializeSystem> _initializeSystems = new List<IInitializeSystem>();\n        protected readonly List<IExecuteSystem> _executeSystems = new List<IExecuteSystem>();\n        protected readonly List<ICleanupSystem> _cleanupSystems = new List<ICleanupSystem>();\n        protected readonly List<ITearDownSystem> _tearDownSystems = new List<ITearDownSystem>();\n\n        /// Adds the system instance to the systems list.\n        public virtual Systems Add(ISystem system)\n        {\n            if (system is IInitializeSystem initializeSystem) _initializeSystems.Add(initializeSystem);\n            if (system is IExecuteSystem executeSystem) _executeSystems.Add(executeSystem);\n            if (system is ICleanupSystem cleanupSystem) _cleanupSystems.Add(cleanupSystem);\n            if (system is ITearDownSystem tearDownSystem) _tearDownSystems.Add(tearDownSystem);\n            return this;\n        }\n\n        /// Removes the system instance from the systems list.\n        public void Remove(ISystem system)\n        {\n            if (system is IInitializeSystem initializeSystem) _initializeSystems.Remove(initializeSystem);\n            if (system is IExecuteSystem executeSystem) _executeSystems.Remove(executeSystem);\n            if (system is ICleanupSystem cleanupSystem) _cleanupSystems.Remove(cleanupSystem);\n            if (system is ITearDownSystem tearDownSystem) _tearDownSystems.Remove(tearDownSystem);\n        }\n\n        /// Calls Initialize() on all IInitializeSystem and other\n        /// nested Systems instances in the order you added them.\n        public virtual void Initialize()\n        {\n            for (var i = 0; i < _initializeSystems.Count; i++)\n                _initializeSystems[i].Initialize();\n        }\n\n        /// Calls Execute() on all IExecuteSystem and other\n        /// nested Systems instances in the order you added them.\n        public virtual void Execute()\n        {\n            for (var i = 0; i < _executeSystems.Count; i++)\n                _executeSystems[i].Execute();\n        }\n\n        /// Calls Cleanup() on all ICleanupSystem and other\n        /// nested Systems instances in the order you added them.\n        public virtual void Cleanup()\n        {\n            for (var i = 0; i < _cleanupSystems.Count; i++)\n                _cleanupSystems[i].Cleanup();\n        }\n\n        /// Calls TearDown() on all ITearDownSystem  and other\n        /// nested Systems instances in the order you added them.\n        public virtual void TearDown()\n        {\n            for (var i = 0; i < _tearDownSystems.Count; i++)\n                _tearDownSystems[i].TearDown();\n        }\n\n        /// Activates all ReactiveSystems in the systems list.\n        public void ActivateReactiveSystems()\n        {\n            for (var i = 0; i < _executeSystems.Count; i++)\n            {\n                var system = _executeSystems[i];\n                if (system is IReactiveSystem reactiveSystem)\n                    reactiveSystem.Activate();\n\n                if (system is Systems nestedSystems)\n                    nestedSystems.ActivateReactiveSystems();\n            }\n        }\n\n        /// Deactivates all ReactiveSystems in the systems list.\n        /// This will also clear all ReactiveSystems.\n        /// This is useful when you want to soft-restart your application and\n        /// want to reuse your existing system instances.\n        public void DeactivateReactiveSystems()\n        {\n            for (var i = 0; i < _executeSystems.Count; i++)\n            {\n                var system = _executeSystems[i];\n                if (system is IReactiveSystem reactiveSystem)\n                    reactiveSystem.Deactivate();\n\n                if (system is Systems nestedSystems)\n                    nestedSystems.DeactivateReactiveSystems();\n            }\n        }\n\n        /// Clears all ReactiveSystems in the systems list.\n        public void ClearReactiveSystems()\n        {\n            for (var i = 0; i < _executeSystems.Count; i++)\n            {\n                var system = _executeSystems[i];\n                if (system is IReactiveSystem reactiveSystem)\n                    reactiveSystem.Clear();\n\n                if (system is Systems nestedSystems)\n                    nestedSystems.ClearReactiveSystems();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Generators.Attributes/CleanupAttribute.cs",
    "content": "using System;\n\nnamespace Entitas.Generators.Attributes\n{\n    [AttributeUsage(AttributeTargets.Class)]\n    public class CleanupAttribute : Attribute\n    {\n        public readonly CleanupMode CleanupMode;\n\n        public CleanupAttribute(CleanupMode cleanupMode)\n        {\n            CleanupMode = cleanupMode;\n        }\n    }\n\n    public enum CleanupMode\n    {\n        RemoveComponent,\n        DestroyEntity\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Generators.Attributes/ContextAttribute.cs",
    "content": "using System;\n\nnamespace Entitas.Generators.Attributes\n{\n    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]\n    public class ContextAttribute : Attribute\n    {\n        public readonly Type Type;\n\n        public ContextAttribute(Type type)\n        {\n            Type = type;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Generators.Attributes/ContextInitializationAttribute.cs",
    "content": "using System;\n\nnamespace Entitas.Generators.Attributes\n{\n    [AttributeUsage(AttributeTargets.Method)]\n    public class ContextInitializationAttribute : Attribute\n    {\n        public readonly Type Type;\n\n        public ContextInitializationAttribute(Type type)\n        {\n            Type = type;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Generators.Attributes/Entitas.Generators.Attributes.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>$(DefaultTargetFramework)</TargetFramework>\n    <Version>2.0.0</Version>\n    <Nullable>enable</Nullable>\n  </PropertyGroup>\n\n</Project>\n"
  },
  {
    "path": "src/Entitas.Generators.Attributes/EntityIndexAttribute.cs",
    "content": "﻿using System;\n\nnamespace Entitas.Generators.Attributes\n{\n    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]\n    public class EntityIndexAttribute : Attribute\n    {\n        public readonly bool IsPrimary;\n\n        public EntityIndexAttribute(bool isPrimary)\n        {\n            IsPrimary = isPrimary;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Generators.Attributes/EventAttribute.cs",
    "content": "using System;\n\nnamespace Entitas.Generators.Attributes\n{\n    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]\n    public class EventAttribute : Attribute\n    {\n        public readonly EventTarget EventTarget;\n        public readonly EventType EventType;\n        public readonly int Order;\n\n        public EventAttribute(EventTarget eventTarget, EventType eventType = EventType.Added, int order = 0)\n        {\n            EventTarget = eventTarget;\n            EventType = eventType;\n            Order = order;\n        }\n    }\n\n    public enum EventTarget\n    {\n        Any,\n        Self\n    }\n\n    public enum EventType\n    {\n        Added,\n        Removed\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Generators.Attributes/UniqueAttribute.cs",
    "content": "using System;\n\nnamespace Entitas.Generators.Attributes\n{\n    [AttributeUsage(AttributeTargets.Class)]\n    public class UniqueAttribute : Attribute { }\n}\n"
  },
  {
    "path": "src/Entitas.Unity/ContextObserver/ContextObserverBehaviour.cs",
    "content": "using System.Collections.Generic;\nusing System.Text;\nusing UnityEngine;\n\nnamespace Entitas.Unity\n{\n    public class ContextObserverBehaviour : MonoBehaviour\n    {\n        public IContext Context => _context;\n\n        public readonly List<IGroup> Groups = new List<IGroup>();\n\n        readonly Stack<EntityBehaviour> _entityBehaviourPool = new Stack<EntityBehaviour>();\n        readonly StringBuilder _toStringBuilder = new StringBuilder();\n\n        IContext _context;\n\n        public void Initialize(IContext context)\n        {\n            _context = context;\n            context.OnEntityCreated += OnEntityCreated;\n            context.OnGroupCreated += OnGroupCreated;\n            Update();\n        }\n\n        void OnEntityCreated(IContext context, Entity entity)\n        {\n            var entityBehaviour = _entityBehaviourPool.Count > 0\n                ? _entityBehaviourPool.Pop()\n                : new GameObject().AddComponent<EntityBehaviour>();\n\n            entityBehaviour.Initialize(context, entity, _entityBehaviourPool);\n            entityBehaviour.transform.SetParent(transform, false);\n            entityBehaviour.transform.SetAsLastSibling();\n        }\n\n        void OnGroupCreated(IContext context, IGroup group)\n        {\n            Groups.Add(group);\n        }\n\n        void Update()\n        {\n            name = ToString();\n        }\n\n        void OnDestroy()\n        {\n            _context.OnEntityCreated -= OnEntityCreated;\n            _context.OnGroupCreated -= OnGroupCreated;\n        }\n\n        public override string ToString()\n        {\n            _toStringBuilder.Length = 0;\n            _toStringBuilder\n                .Append(_context.ContextInfo.Name).Append(\" (\")\n                .Append(_context.Count).Append(\" entities, \")\n                .Append(_context.ReusableEntitiesCount).Append(\" reusable, \");\n\n            if (_context.RetainedEntitiesCount != 0)\n            {\n                _toStringBuilder.Append(_context.RetainedEntitiesCount).Append(\" retained, \");\n            }\n\n            _toStringBuilder.Append(Groups.Count).Append(\" groups)\");\n\n            return _toStringBuilder.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity/ContextObserver/ContextObserverExtension.cs",
    "content": "using UnityEngine;\n\nnamespace Entitas.Unity\n{\n    public static class ContextObserverExtension\n    {\n#if !UNITY_EDITOR || ENTITAS_DISABLE_VISUAL_DEBUGGING\n        [System.Diagnostics.Conditional(\"false\")]\n#endif\n        public static void CreateContextObserver(this IContext context)\n        {\n            var contextObserver = new GameObject().AddComponent<ContextObserverBehaviour>();\n            contextObserver.Initialize(context);\n            Object.DontDestroyOnLoad(contextObserver.gameObject);\n        }\n\n        public static ContextObserverBehaviour FindContextObserver(this IContext context)\n        {\n            foreach (var observer in Object.FindObjectsOfType<ContextObserverBehaviour>())\n                if (observer.Context == context)\n                    return observer;\n\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity/DebugSystems/AvgResetInterval.cs",
    "content": "namespace Entitas.Unity\n{\n    public enum AvgResetInterval\n    {\n        Always = 1,\n        VeryFast = 30,\n        Fast = 60,\n        Normal = 120,\n        Slow = 300,\n        Never = int.MaxValue\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity/DebugSystems/DebugSystems.cs",
    "content": "using System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing UnityEngine;\n\nnamespace Entitas.Unity\n{\n    public class DebugSystems : Systems\n    {\n        public static AvgResetInterval AvgResetInterval = AvgResetInterval.Never;\n\n        public int TotalInitializeSystemsCount => _initializeSystems.Sum(system => system is DebugSystems debugSystems ? debugSystems.TotalInitializeSystemsCount : 1);\n        public int TotalExecuteSystemsCount => _executeSystems.Sum(system => system is DebugSystems debugSystems ? debugSystems.TotalExecuteSystemsCount : 1);\n        public int TotalCleanupSystemsCount => _cleanupSystems.Sum(system => system is DebugSystems debugSystems ? debugSystems.TotalCleanupSystemsCount : 1);\n        public int TotalTearDownSystemsCount => _tearDownSystems.Sum(system => system is DebugSystems debugSystems ? debugSystems.TotalTearDownSystemsCount : 1);\n        public int TotalSystemsCount => AllSystems.Sum(system => system is DebugSystems debugSystems ? debugSystems.TotalSystemsCount : 1);\n\n        public int InitializeSystemsCount => _initializeSystems.Count;\n        public int ExecuteSystemsCount => _executeSystems.Count;\n        public int CleanupSystemsCount => _cleanupSystems.Count;\n        public int TearDownSystemsCount => _tearDownSystems.Count;\n\n        public string Name => _name;\n        public GameObject GameObject => _gameObject;\n\n        public SystemInfo SystemInfo => _systemInfo;\n        public double ExecuteDuration => _executeDuration;\n        public double CleanupDuration => _cleanupDuration;\n\n        public readonly List<SystemInfo> InitializeSystemInfos = new List<SystemInfo>();\n        public readonly List<SystemInfo> ExecuteSystemInfos = new List<SystemInfo>();\n        public readonly List<SystemInfo> CleanupSystemInfos = new List<SystemInfo>();\n        public readonly List<SystemInfo> TearDownSystemInfos = new List<SystemInfo>();\n        public readonly List<ISystem> AllSystems = new List<ISystem>();\n\n        public bool IsPaused;\n\n        string _name;\n        GameObject _gameObject;\n        SystemInfo _systemInfo;\n        Stopwatch _stopwatch;\n        double _executeDuration;\n        double _cleanupDuration;\n\n        public DebugSystems(string name)\n        {\n            Initialize(name);\n        }\n\n        protected DebugSystems(bool noInit) { }\n\n        protected void Initialize(string name)\n        {\n            _name = name;\n            _gameObject = new GameObject(name);\n            _gameObject.AddComponent<DebugSystemsBehaviour>().Initialize(this);\n            _systemInfo = new SystemInfo(this);\n            _stopwatch = new Stopwatch();\n        }\n\n        public override Systems Add(ISystem system)\n        {\n            AllSystems.Add(system);\n\n            SystemInfo childSystemInfo;\n\n            if (system is DebugSystems debugSystems)\n            {\n                childSystemInfo = debugSystems.SystemInfo;\n                debugSystems.GameObject.transform.SetParent(_gameObject.transform, false);\n            }\n            else\n            {\n                childSystemInfo = new SystemInfo(system);\n            }\n\n            childSystemInfo.ParentSystemInfo = _systemInfo;\n\n            if (childSystemInfo.IsInitializeSystems) InitializeSystemInfos.Add(childSystemInfo);\n            if (childSystemInfo.IsExecuteSystems || childSystemInfo.IsReactiveSystems) ExecuteSystemInfos.Add(childSystemInfo);\n            if (childSystemInfo.IsCleanupSystems) CleanupSystemInfos.Add(childSystemInfo);\n            if (childSystemInfo.IsTearDownSystems) TearDownSystemInfos.Add(childSystemInfo);\n\n            return base.Add(system);\n        }\n\n        public void ResetDurations()\n        {\n            foreach (var systemInfo in ExecuteSystemInfos)\n                systemInfo.ResetDurations();\n\n            foreach (var system in AllSystems)\n                if (system is DebugSystems debugSystems)\n                    debugSystems.ResetDurations();\n        }\n\n        public override void Initialize()\n        {\n            for (var i = 0; i < _initializeSystems.Count; i++)\n            {\n                var systemInfo = InitializeSystemInfos[i];\n                if (systemInfo.IsActive)\n                {\n                    _stopwatch.Reset();\n                    _stopwatch.Start();\n                    _initializeSystems[i].Initialize();\n                    _stopwatch.Stop();\n                    systemInfo.InitializationDuration = _stopwatch.Elapsed.TotalMilliseconds;\n                }\n            }\n        }\n\n        public override void Execute()\n        {\n            if (!IsPaused)\n                StepExecute();\n        }\n\n        public override void Cleanup()\n        {\n            if (!IsPaused)\n                StepCleanup();\n        }\n\n        public void StepExecute()\n        {\n            var executeDuration = 0d;\n            if (Time.frameCount % (int)AvgResetInterval == 0)\n                ResetDurations();\n\n            for (var i = 0; i < _executeSystems.Count; i++)\n            {\n                var systemInfo = ExecuteSystemInfos[i];\n                if (systemInfo.IsActive)\n                {\n                    _stopwatch.Reset();\n                    _stopwatch.Start();\n                    _executeSystems[i].Execute();\n                    _stopwatch.Stop();\n                    var duration = _stopwatch.Elapsed.TotalMilliseconds;\n                    executeDuration += duration;\n                    systemInfo.AddExecutionDuration(duration);\n                }\n            }\n\n            _executeDuration = executeDuration;\n        }\n\n        public void StepCleanup()\n        {\n            var cleanupDuration = 0d;\n            for (var i = 0; i < _cleanupSystems.Count; i++)\n            {\n                var systemInfo = CleanupSystemInfos[i];\n                if (systemInfo.IsActive)\n                {\n                    _stopwatch.Reset();\n                    _stopwatch.Start();\n                    _cleanupSystems[i].Cleanup();\n                    _stopwatch.Stop();\n                    var duration = _stopwatch.Elapsed.TotalMilliseconds;\n                    cleanupDuration += duration;\n                    systemInfo.AddCleanupDuration(duration);\n                }\n            }\n\n            _cleanupDuration = cleanupDuration;\n        }\n\n        public override void TearDown()\n        {\n            for (var i = 0; i < _tearDownSystems.Count; i++)\n            {\n                var systemInfo = TearDownSystemInfos[i];\n                if (systemInfo.IsActive)\n                {\n                    _stopwatch.Reset();\n                    _stopwatch.Start();\n                    _tearDownSystems[i].TearDown();\n                    _stopwatch.Stop();\n                    systemInfo.TeardownDuration = _stopwatch.Elapsed.TotalMilliseconds;\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity/DebugSystems/DebugSystemsBehaviour.cs",
    "content": "using UnityEngine;\n\nnamespace Entitas.Unity\n{\n    public class DebugSystemsBehaviour : MonoBehaviour\n    {\n        public DebugSystems Systems => _systems;\n\n        DebugSystems _systems;\n\n        public void Initialize(DebugSystems systems)\n        {\n            _systems = systems;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity/DebugSystems/Feature.cs",
    "content": "namespace Entitas.Unity\n{\n#if (UNITY_EDITOR && !ENTITAS_DISABLE_VISUAL_DEBUGGING)\n    public class Feature : DebugSystems\n    {\n        public Feature(string name) : base(name) { }\n\n        public Feature() : base(true) => Initialize(GetType().FullName);\n    }\n#elif (DEVELOPMENT_BUILD && !ENTITAS_DISABLE_DEEP_PROFILING)\n    public class Feature : Systems\n    {\n        public Feature(string name) : this() { }\n\n        public Feature() { }\n\n        public override void Initialize()\n        {\n            for (var i = 0; i < _initializeSystems.Count; i++)\n            {\n                var system = _initializeSystems[i];\n                UnityEngine.Profiling.Profiler.BeginSample(system.GetType().FullName);\n                system.Initialize();\n                UnityEngine.Profiling.Profiler.EndSample();\n            }\n        }\n\n        public override void Execute()\n        {\n            for (var i = 0; i < _executeSystems.Count; i++)\n            {\n                var system = _executeSystems[i];\n                UnityEngine.Profiling.Profiler.BeginSample(system.GetType().FullName);\n                system.Execute();\n                UnityEngine.Profiling.Profiler.EndSample();\n            }\n        }\n\n        public override void Cleanup()\n        {\n            for (var i = 0; i < _cleanupSystems.Count; i++)\n            {\n                var system = _cleanupSystems[i];\n                UnityEngine.Profiling.Profiler.BeginSample(system.GetType().FullName);\n                system.Cleanup();\n                UnityEngine.Profiling.Profiler.EndSample();\n            }\n        }\n\n        public override void TearDown()\n        {\n            for (var i = 0; i < _tearDownSystems.Count; i++)\n            {\n                var system = _tearDownSystems[i];\n                UnityEngine.Profiling.Profiler.BeginSample(system.GetType().FullName);\n                system.TearDown();\n                UnityEngine.Profiling.Profiler.EndSample();\n            }\n        }\n    }\n#else\n    public class Feature : Systems\n    {\n        public Feature(string name) { }\n\n        public Feature() { }\n    }\n#endif\n}\n"
  },
  {
    "path": "src/Entitas.Unity/DebugSystems/SystemInfo.cs",
    "content": "namespace Entitas.Unity\n{\n    public class SystemInfo\n    {\n        public bool IsInitializeSystems => (_interfaceFlags & SystemInterfaceFlags.InitializeSystem) == SystemInterfaceFlags.InitializeSystem;\n        public bool IsExecuteSystems => (_interfaceFlags & SystemInterfaceFlags.ExecuteSystem) == SystemInterfaceFlags.ExecuteSystem;\n        public bool IsCleanupSystems => (_interfaceFlags & SystemInterfaceFlags.CleanupSystem) == SystemInterfaceFlags.CleanupSystem;\n        public bool IsTearDownSystems => (_interfaceFlags & SystemInterfaceFlags.TearDownSystem) == SystemInterfaceFlags.TearDownSystem;\n        public bool IsReactiveSystems => (_interfaceFlags & SystemInterfaceFlags.ReactiveSystem) == SystemInterfaceFlags.ReactiveSystem;\n\n        public double InitializationDuration { get; set; }\n        public double CleanupDuration { get; set; }\n        public double TeardownDuration { get; set; }\n\n        public double AccumulatedExecutionDuration => _accumulatedExecutionDuration;\n        public double MinExecutionDuration => _minExecutionDuration;\n        public double MaxExecutionDuration => _maxExecutionDuration;\n        public double AverageExecutionDuration => _executionDurationsCount != 0 ? _accumulatedExecutionDuration / _executionDurationsCount : 0;\n        public double AccumulatedCleanupDuration => _accumulatedCleanupDuration;\n        public double MinCleanupDuration => _minCleanupDuration;\n        public double MaxCleanupDuration => _maxCleanupDuration;\n        public double AverageCleanupDuration => _cleanupDurationsCount != 0 ? _accumulatedCleanupDuration / _cleanupDurationsCount : 0;\n\n        public bool AreAllParentsActive => ParentSystemInfo == null || (ParentSystemInfo.IsActive && ParentSystemInfo.AreAllParentsActive);\n\n        public SystemInfo ParentSystemInfo;\n        public bool IsActive;\n\n        public readonly ISystem System;\n        public readonly string SystemName;\n        readonly SystemInterfaceFlags _interfaceFlags;\n\n        double _accumulatedExecutionDuration;\n        double _minExecutionDuration;\n        double _maxExecutionDuration;\n        int _executionDurationsCount;\n\n        double _accumulatedCleanupDuration;\n        double _minCleanupDuration;\n        double _maxCleanupDuration;\n        int _cleanupDurationsCount;\n\n        public SystemInfo(ISystem system)\n        {\n            System = system;\n            _interfaceFlags = GetInterfaceFlags(system);\n\n            SystemName = system is DebugSystems debugSystem\n                ? debugSystem.Name\n                : system.GetType().Name.RemoveSuffix(\"System\");\n\n            IsActive = true;\n        }\n\n        public void AddExecutionDuration(double executionDuration)\n        {\n            if (executionDuration < _minExecutionDuration || _minExecutionDuration == 0)\n                _minExecutionDuration = executionDuration;\n\n            if (executionDuration > _maxExecutionDuration)\n                _maxExecutionDuration = executionDuration;\n\n            _accumulatedExecutionDuration += executionDuration;\n            _executionDurationsCount += 1;\n        }\n\n        public void AddCleanupDuration(double cleanupDuration)\n        {\n            if (cleanupDuration < _minCleanupDuration || _minCleanupDuration == 0)\n                _minCleanupDuration = cleanupDuration;\n\n            if (cleanupDuration > _maxCleanupDuration)\n                _maxCleanupDuration = cleanupDuration;\n\n            _accumulatedCleanupDuration += cleanupDuration;\n            _cleanupDurationsCount += 1;\n        }\n\n        public void ResetDurations()\n        {\n            _accumulatedExecutionDuration = 0;\n            _executionDurationsCount = 0;\n\n            _accumulatedCleanupDuration = 0;\n            _cleanupDurationsCount = 0;\n        }\n\n        static SystemInterfaceFlags GetInterfaceFlags(ISystem system)\n        {\n            var flags = SystemInterfaceFlags.None;\n            if (system is IInitializeSystem)\n                flags |= SystemInterfaceFlags.InitializeSystem;\n\n            if (system is IReactiveSystem)\n                flags |= SystemInterfaceFlags.ReactiveSystem;\n            else if (system is IExecuteSystem)\n                flags |= SystemInterfaceFlags.ExecuteSystem;\n\n            if (system is ICleanupSystem)\n                flags |= SystemInterfaceFlags.CleanupSystem;\n\n            if (system is ITearDownSystem)\n                flags |= SystemInterfaceFlags.TearDownSystem;\n\n            return flags;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity/DebugSystems/SystemInterfaceFlags.cs",
    "content": "using System;\n\nnamespace Entitas.Unity\n{\n    [Flags]\n    public enum SystemInterfaceFlags\n    {\n        None = 0,\n        InitializeSystem = 1 << 1,\n        ExecuteSystem = 1 << 2,\n        CleanupSystem = 1 << 3,\n        TearDownSystem = 1 << 4,\n        ReactiveSystem = 1 << 5\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity/Entitas.Unity.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>$(DefaultTargetFramework)</TargetFramework>\n    <Version>2.0.0</Version>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"../Entitas/Entitas.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Reference Include=\"$(UnityEngine)\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/Entitas.Unity/Entitas.Unity.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=contextobserver/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=debugsystems/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=entity/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/Entitas.Unity/Entity/DontDrawComponentAttribute.cs",
    "content": "﻿using System;\n\nnamespace Entitas.Unity\n{\n    [AttributeUsage(AttributeTargets.Class)]\n    public class DontDrawComponentAttribute : Attribute { }\n}\n"
  },
  {
    "path": "src/Entitas.Unity/Entity/EntityBehaviour.cs",
    "content": "using System.Collections.Generic;\nusing UnityEngine;\n\nnamespace Entitas.Unity\n{\n    public class EntityBehaviour : MonoBehaviour\n    {\n        public IContext Context => _context;\n        public Entity Entity => _entity;\n\n        IContext _context;\n        Entity _entity;\n        Stack<EntityBehaviour> _entityBehaviourPool;\n        string _cachedName;\n\n        public void Initialize(IContext context, Entity entity, Stack<EntityBehaviour> entityBehaviourPool)\n        {\n            _context = context;\n            _entity = entity;\n            _entityBehaviourPool = entityBehaviourPool;\n\n            _entity.OnEntityReleased += OnEntityReleased;\n            gameObject.hideFlags = HideFlags.None;\n            gameObject.SetActive(true);\n            Update();\n        }\n\n        void OnEntityReleased(Entity e)\n        {\n            _entity.OnEntityReleased -= OnEntityReleased;\n            gameObject.hideFlags = HideFlags.HideInHierarchy;\n            gameObject.SetActive(false);\n            _entityBehaviourPool.Push(this);\n            _cachedName = null;\n            name = string.Empty;\n        }\n\n        void Update()\n        {\n            if (_entity != null && _cachedName != _entity.ToString())\n                name = _cachedName = _entity.ToString();\n        }\n\n        void OnDestroy()\n        {\n            if (_entity != null)\n                _entity.OnEntityReleased -= OnEntityReleased;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity/Entity/EntityLink.cs",
    "content": "using System;\nusing UnityEngine;\n\nnamespace Entitas.Unity\n{\n    public class EntityLink : MonoBehaviour\n    {\n        public Entity Entity => _entity;\n\n        Entity _entity;\n        bool _applicationIsQuitting;\n\n        public void Link(Entity entity)\n        {\n            if (_entity != null)\n                throw new Exception($\"EntityLink is already linked to {_entity}!\");\n\n            _entity = entity;\n            _entity.Retain(this);\n        }\n\n        public void Unlink()\n        {\n            if (_entity == null)\n                throw new Exception(\"EntityLink is already unlinked!\");\n\n            _entity.Release(this);\n            _entity = null;\n        }\n\n        void OnDestroy()\n        {\n            if (!_applicationIsQuitting && _entity != null)\n                Debug.LogWarning($\"EntityLink got destroyed but is still linked to {_entity}!\\nPlease call gameObject.Unlink() before it is destroyed.\");\n        }\n\n        void OnApplicationQuit() => _applicationIsQuitting = true;\n\n        public override string ToString() => $\"EntityLink({gameObject.name})\";\n    }\n\n    public static class EntityLinkExtension\n    {\n        public static EntityLink GetEntityLink(this GameObject gameObject) => gameObject.GetComponent<EntityLink>();\n\n        public static EntityLink Link(this GameObject gameObject, Entity entity)\n        {\n            if (!gameObject.TryGetComponent<EntityLink>(out var entityLink))\n            {\n                entityLink = gameObject.AddComponent<EntityLink>();\n                entityLink.Link(entity);\n            }\n            else\n            {\n                entityLink.Link(entity);\n            }\n\n            return entityLink;\n        }\n\n        public static void Unlink(this GameObject gameObject)\n        {\n            gameObject.GetEntityLink().Unlink();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/ContextObserverEditor.cs",
    "content": "using System.Linq;\nusing DesperateDevs.Unity.Editor;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    [CustomEditor(typeof(ContextObserverBehaviour))]\n    public class ContextObserverEditor : UnityEditor.Editor\n    {\n        public override void OnInspectorGUI()\n        {\n            var contextObserver = (ContextObserverBehaviour)target;\n\n            EditorLayout.BeginVerticalBox();\n            {\n                EditorGUILayout.LabelField(contextObserver.Context.ContextInfo.Name, EditorStyles.boldLabel);\n                EditorGUILayout.LabelField(\"Entities\", contextObserver.Context.Count.ToString());\n                EditorGUILayout.LabelField(\"Reusable entities\", contextObserver.Context.ReusableEntitiesCount.ToString());\n\n                var retainedEntitiesCount = contextObserver.Context.RetainedEntitiesCount;\n                if (retainedEntitiesCount != 0)\n                {\n                    var c = GUI.color;\n                    GUI.color = Color.red;\n                    EditorGUILayout.LabelField(\"Retained entities\", retainedEntitiesCount.ToString());\n                    GUI.color = c;\n                    EditorGUILayout.HelpBox(\n                        \"WARNING: There are retained entities.\\nDid you call entity.Retain(owner) and forgot to call entity.Release(owner)?\",\n                        MessageType.Warning);\n                }\n\n                EditorGUILayout.BeginHorizontal();\n                {\n                    if (GUILayout.Button(\"Create Entity\"))\n                    {\n                        var entity = (Entity)contextObserver.Context.GetType().GetMethod(\"CreateEntity\")!\n                            .Invoke(contextObserver.Context, null);\n\n                        var entityBehaviour = FindObjectsOfType<EntityBehaviour>()\n                            .Single(eb => eb.Entity == entity);\n\n                        Selection.activeGameObject = entityBehaviour.gameObject;\n                    }\n\n                    var bgColor = GUI.backgroundColor;\n                    GUI.backgroundColor = Color.red;\n                    if (GUILayout.Button(\"Destroy All Entities\"))\n                        contextObserver.Context.DestroyAllEntities();\n\n                    GUI.backgroundColor = bgColor;\n                }\n                EditorGUILayout.EndHorizontal();\n            }\n            EditorLayout.EndVerticalBox();\n\n            var groups = contextObserver.Groups;\n            if (groups.Count != 0)\n            {\n                EditorLayout.BeginVerticalBox();\n                {\n                    EditorGUILayout.LabelField($\"Groups ({groups.Count})\", EditorStyles.boldLabel);\n                    foreach (var group in groups.OrderByDescending(g => g.Count))\n                    {\n                        EditorGUILayout.BeginHorizontal();\n                        {\n                            EditorGUILayout.LabelField(group.ToString());\n                            EditorGUILayout.LabelField(group.Count.ToString(), GUILayout.Width(48));\n                        }\n                        EditorGUILayout.EndHorizontal();\n                    }\n                }\n                EditorLayout.EndVerticalBox();\n            }\n\n            EditorUtility.SetDirty(target);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/DebugSystemsEditor.cs",
    "content": "using System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing DesperateDevs.Unity.Editor;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    [CustomEditor(typeof(DebugSystemsBehaviour))]\n    public class DebugSystemsEditor : UnityEditor.Editor\n    {\n        enum SortMethod\n        {\n            OrderOfOccurrence,\n\n            Name,\n            NameDescending,\n\n            ExecutionTime,\n            ExecutionTimeDescending\n        }\n\n        Graph _systemsMonitor;\n        Queue<float> _systemMonitorData;\n        const int SystemMonitorDataLength = 60;\n\n        static bool _showDetails = false;\n        static bool _showSystemsMonitor = true;\n        static bool _showSystemsList = true;\n\n        static bool _showInitializeSystems = true;\n        static bool _showExecuteSystems = true;\n        static bool _showCleanupSystems = true;\n        static bool _showTearDownSystems = true;\n        static bool _hideEmptySystems = true;\n        static string _systemNameSearchString = string.Empty;\n\n        int _systemWarningThreshold;\n\n        float _threshold;\n        SortMethod _systemSortMethod;\n\n        int _lastRenderedFrameCount;\n\n        GUIContent _stepButtonContent;\n        GUIContent _pauseButtonContent;\n\n        void OnEnable()\n        {\n            _systemWarningThreshold = EntitasSettings.Instance.SystemWarningThreshold;\n        }\n\n        public override void OnInspectorGUI()\n        {\n            var debugSystemsBehaviour = (DebugSystemsBehaviour)target;\n            var systems = debugSystemsBehaviour.Systems;\n\n            EditorGUILayout.Space();\n            DrawSystemsOverview(systems);\n\n            EditorGUILayout.Space();\n            DrawSystemsMonitor(systems);\n\n            EditorGUILayout.Space();\n            DrawSystemList(systems);\n\n            EditorGUILayout.Space();\n\n            EditorUtility.SetDirty(target);\n        }\n\n        static void DrawSystemsOverview(DebugSystems systems)\n        {\n            _showDetails = EditorLayout.DrawSectionHeaderToggle(\"Details\", _showDetails);\n            if (_showDetails)\n            {\n                EditorLayout.BeginSectionContent();\n                {\n                    EditorGUILayout.LabelField(systems.Name, EditorStyles.boldLabel);\n                    EditorGUILayout.LabelField(\"Initialize Systems\", systems.TotalInitializeSystemsCount.ToString());\n                    EditorGUILayout.LabelField(\"Execute Systems\", systems.TotalExecuteSystemsCount.ToString());\n                    EditorGUILayout.LabelField(\"Cleanup Systems\", systems.TotalCleanupSystemsCount.ToString());\n                    EditorGUILayout.LabelField(\"TearDown Systems\", systems.TotalTearDownSystemsCount.ToString());\n                    EditorGUILayout.LabelField(\"Total Systems\", systems.TotalSystemsCount.ToString());\n                }\n                EditorLayout.EndSectionContent();\n            }\n        }\n\n        void DrawSystemsMonitor(DebugSystems systems)\n        {\n            if (_systemsMonitor == null)\n            {\n                _systemsMonitor = new Graph(SystemMonitorDataLength);\n                _systemMonitorData = new Queue<float>(new float[SystemMonitorDataLength]);\n            }\n\n            _showSystemsMonitor = EditorLayout.DrawSectionHeaderToggle(\"Performance\", _showSystemsMonitor);\n            if (_showSystemsMonitor)\n            {\n                EditorLayout.BeginSectionContent();\n                {\n                    EditorGUILayout.BeginHorizontal();\n                    {\n                        EditorGUILayout.BeginVertical();\n                        {\n                            EditorGUILayout.LabelField(\"Execution duration\", systems.ExecuteDuration.ToString(CultureInfo.InvariantCulture));\n                            EditorGUILayout.LabelField(\"Cleanup duration\", systems.CleanupDuration.ToString(CultureInfo.InvariantCulture));\n                        }\n                        EditorGUILayout.EndVertical();\n\n                        if (_stepButtonContent == null)\n                            _stepButtonContent = EditorGUIUtility.IconContent(\"StepButton On\");\n\n                        if (_pauseButtonContent == null)\n                            _pauseButtonContent = EditorGUIUtility.IconContent(\"PauseButton On\");\n\n                        systems.IsPaused = GUILayout.Toggle(systems.IsPaused, _pauseButtonContent, \"CommandLeft\");\n\n                        if (GUILayout.Button(_stepButtonContent, \"CommandRight\"))\n                        {\n                            systems.IsPaused = true;\n                            systems.StepExecute();\n                            systems.StepCleanup();\n                            AddDuration((float)systems.ExecuteDuration + (float)systems.CleanupDuration);\n                        }\n                    }\n                    EditorGUILayout.EndHorizontal();\n\n                    if (!EditorApplication.isPaused && !systems.IsPaused)\n                        AddDuration((float)systems.ExecuteDuration + (float)systems.CleanupDuration);\n\n                    _systemsMonitor.Draw(_systemMonitorData.ToArray(), 80f);\n                }\n                EditorLayout.EndSectionContent();\n            }\n        }\n\n        void DrawSystemList(DebugSystems systems)\n        {\n            _showSystemsList = EditorLayout.DrawSectionHeaderToggle(\"Systems\", _showSystemsList);\n            if (_showSystemsList)\n            {\n                EditorLayout.BeginSectionContent();\n                {\n                    EditorGUILayout.BeginHorizontal();\n                    {\n                        DebugSystems.AvgResetInterval = (AvgResetInterval)EditorGUILayout.EnumPopup(\"Reset average duration Ø\", DebugSystems.AvgResetInterval);\n                        if (GUILayout.Button(\"Reset Ø now\", EditorStyles.miniButton, GUILayout.Width(88)))\n                            systems.ResetDurations();\n                    }\n                    EditorGUILayout.EndHorizontal();\n\n                    _threshold = EditorGUILayout.Slider(\"Threshold Ø ms\", _threshold, 0f, 33f);\n\n                    _hideEmptySystems = EditorGUILayout.Toggle(\"Hide empty systems\", _hideEmptySystems);\n                    EditorGUILayout.Space();\n\n                    EditorGUILayout.BeginHorizontal();\n                    {\n                        _systemSortMethod = (SortMethod)EditorGUILayout.EnumPopup(_systemSortMethod, EditorStyles.popup, GUILayout.Width(150));\n                        _systemNameSearchString = EditorLayout.SearchTextField(_systemNameSearchString);\n                    }\n                    EditorGUILayout.EndHorizontal();\n\n                    EditorGUILayout.Space();\n\n                    _showInitializeSystems = EditorLayout.DrawSectionHeaderToggle(\"Initialize Systems\", _showInitializeSystems);\n                    if (_showInitializeSystems && ShouldShowSystems(systems, SystemInterfaceFlags.InitializeSystem))\n                    {\n                        EditorLayout.BeginSectionContent();\n                        {\n                            var systemsDrawn = DrawSystemInfos(systems, SystemInterfaceFlags.InitializeSystem);\n                            if (systemsDrawn == 0)\n                                EditorGUILayout.LabelField(string.Empty);\n                        }\n                        EditorLayout.EndSectionContent();\n                    }\n\n                    _showExecuteSystems = EditorLayout.DrawSectionHeaderToggle(\"Execute Systems\", _showExecuteSystems);\n                    if (_showExecuteSystems && ShouldShowSystems(systems, SystemInterfaceFlags.ExecuteSystem))\n                    {\n                        EditorLayout.BeginSectionContent();\n                        {\n                            var systemsDrawn = DrawSystemInfos(systems, SystemInterfaceFlags.ExecuteSystem);\n                            if (systemsDrawn == 0)\n                                EditorGUILayout.LabelField(string.Empty);\n                        }\n                        EditorLayout.EndSectionContent();\n                    }\n\n                    _showCleanupSystems = EditorLayout.DrawSectionHeaderToggle(\"Cleanup Systems\", _showCleanupSystems);\n                    if (_showCleanupSystems && ShouldShowSystems(systems, SystemInterfaceFlags.CleanupSystem))\n                    {\n                        EditorLayout.BeginSectionContent();\n                        {\n                            var systemsDrawn = DrawSystemInfos(systems, SystemInterfaceFlags.CleanupSystem);\n                            if (systemsDrawn == 0)\n                                EditorGUILayout.LabelField(string.Empty);\n                        }\n                        EditorLayout.EndSectionContent();\n                    }\n\n                    _showTearDownSystems = EditorLayout.DrawSectionHeaderToggle(\"TearDown Systems\", _showTearDownSystems);\n                    if (_showTearDownSystems && ShouldShowSystems(systems, SystemInterfaceFlags.TearDownSystem))\n                    {\n                        EditorLayout.BeginSectionContent();\n                        {\n                            var systemsDrawn = DrawSystemInfos(systems, SystemInterfaceFlags.TearDownSystem);\n                            if (systemsDrawn == 0)\n                                EditorGUILayout.LabelField(string.Empty);\n                        }\n                        EditorLayout.EndSectionContent();\n                    }\n                }\n                EditorLayout.EndSectionContent();\n            }\n        }\n\n        int DrawSystemInfos(DebugSystems systems, SystemInterfaceFlags type)\n        {\n            IEnumerable<SystemInfo> systemInfos = null;\n\n            switch (type)\n            {\n                case SystemInterfaceFlags.InitializeSystem:\n                    systemInfos = systems.InitializeSystemInfos.Where(systemInfo => systemInfo.InitializationDuration >= _threshold);\n                    break;\n                case SystemInterfaceFlags.ExecuteSystem:\n                    systemInfos = systems.ExecuteSystemInfos.Where(systemInfo => systemInfo.AverageExecutionDuration >= _threshold);\n                    break;\n                case SystemInterfaceFlags.CleanupSystem:\n                    systemInfos = systems.CleanupSystemInfos.Where(systemInfo => systemInfo.CleanupDuration >= _threshold);\n                    break;\n                case SystemInterfaceFlags.TearDownSystem:\n                    systemInfos = systems.TearDownSystemInfos.Where(systemInfo => systemInfo.TeardownDuration >= _threshold);\n                    break;\n            }\n\n            systemInfos = GetSortedSystemInfos(systemInfos, _systemSortMethod);\n\n            var systemsDrawn = 0;\n            foreach (var systemInfo in systemInfos)\n            {\n                if (systemInfo.System is DebugSystems debugSystems)\n                    if (!ShouldShowSystems(debugSystems, type))\n                        continue;\n\n                if (EditorLayout.MatchesSearchString(systemInfo.SystemName.ToLower(), _systemNameSearchString.ToLower()))\n                {\n                    EditorGUILayout.BeginHorizontal();\n                    {\n                        var indent = EditorGUI.indentLevel;\n                        EditorGUI.indentLevel = 0;\n\n                        var wasActive = systemInfo.IsActive;\n                        if (systemInfo.AreAllParentsActive)\n                        {\n                            systemInfo.IsActive = EditorGUILayout.Toggle(systemInfo.IsActive, GUILayout.Width(20));\n                        }\n                        else\n                        {\n                            EditorGUI.BeginDisabledGroup(true);\n                            {\n                                EditorGUILayout.Toggle(false, GUILayout.Width(20));\n                            }\n                        }\n\n                        EditorGUI.EndDisabledGroup();\n\n                        EditorGUI.indentLevel = indent;\n\n                        if (systemInfo.IsActive != wasActive)\n                        {\n                            if (systemInfo.System is IReactiveSystem reactiveSystem)\n                            {\n                                if (systemInfo.IsActive)\n                                    reactiveSystem.Activate();\n                                else\n                                    reactiveSystem.Deactivate();\n                            }\n                        }\n\n                        switch (type)\n                        {\n                            case SystemInterfaceFlags.InitializeSystem:\n                                EditorGUILayout.LabelField(systemInfo.SystemName, systemInfo.InitializationDuration.ToString(CultureInfo.InvariantCulture), GetSystemStyle(systemInfo, SystemInterfaceFlags.InitializeSystem));\n                                break;\n                            case SystemInterfaceFlags.ExecuteSystem:\n                                var avgE = $\"Ø {systemInfo.AverageExecutionDuration:00.000}\".PadRight(12);\n                                var minE = $\"▼ {systemInfo.MinExecutionDuration:00.000}\".PadRight(12);\n                                var maxE = $\"▲ {systemInfo.MaxExecutionDuration:00.000}\";\n                                EditorGUILayout.LabelField(systemInfo.SystemName, avgE + minE + maxE, GetSystemStyle(systemInfo, SystemInterfaceFlags.ExecuteSystem));\n                                break;\n                            case SystemInterfaceFlags.CleanupSystem:\n                                var avgC = $\"Ø {systemInfo.AverageCleanupDuration:00.000}\".PadRight(12);\n                                var minC = $\"▼ {systemInfo.MinCleanupDuration:00.000}\".PadRight(12);\n                                var maxC = $\"▲ {systemInfo.MaxCleanupDuration:00.000}\";\n                                EditorGUILayout.LabelField(systemInfo.SystemName, avgC + minC + maxC, GetSystemStyle(systemInfo, SystemInterfaceFlags.CleanupSystem));\n                                break;\n                            case SystemInterfaceFlags.TearDownSystem:\n                                EditorGUILayout.LabelField(systemInfo.SystemName, systemInfo.TeardownDuration.ToString(CultureInfo.InvariantCulture), GetSystemStyle(systemInfo, SystemInterfaceFlags.TearDownSystem));\n                                break;\n                        }\n                    }\n                    EditorGUILayout.EndHorizontal();\n\n                    systemsDrawn += 1;\n                }\n\n                if (systemInfo.System is DebugSystems debugSystem)\n                {\n                    var indent = EditorGUI.indentLevel;\n                    EditorGUI.indentLevel += 1;\n                    systemsDrawn += DrawSystemInfos(debugSystem, type);\n                    EditorGUI.indentLevel = indent;\n                }\n            }\n\n            return systemsDrawn;\n        }\n\n        static IEnumerable<SystemInfo> GetSortedSystemInfos(IEnumerable<SystemInfo> systemInfos, SortMethod sortMethod) => sortMethod switch\n        {\n            SortMethod.Name => systemInfos.OrderBy(systemInfo => systemInfo.SystemName),\n            SortMethod.NameDescending => systemInfos.OrderByDescending(systemInfo => systemInfo.SystemName),\n            SortMethod.ExecutionTime => systemInfos.OrderBy(systemInfo => systemInfo.AverageExecutionDuration),\n            SortMethod.ExecutionTimeDescending => systemInfos.OrderByDescending(systemInfo => systemInfo.AverageExecutionDuration),\n            _ => systemInfos\n        };\n\n        static bool ShouldShowSystems(DebugSystems systems, SystemInterfaceFlags type)\n        {\n            if (!_hideEmptySystems)\n                return true;\n\n            return type switch\n            {\n                SystemInterfaceFlags.InitializeSystem => systems.TotalInitializeSystemsCount > 0,\n                SystemInterfaceFlags.ExecuteSystem => systems.TotalExecuteSystemsCount > 0,\n                SystemInterfaceFlags.CleanupSystem => systems.TotalCleanupSystemsCount > 0,\n                SystemInterfaceFlags.TearDownSystem => systems.TotalTearDownSystemsCount > 0,\n                _ => true\n            };\n        }\n\n        GUIStyle GetSystemStyle(SystemInfo systemInfo, SystemInterfaceFlags systemFlag)\n        {\n            var style = new GUIStyle(GUI.skin.label);\n            var color = systemInfo.IsReactiveSystems && EditorGUIUtility.isProSkin\n                ? Color.white\n                : style.normal.textColor;\n\n            if (systemFlag == SystemInterfaceFlags.ExecuteSystem && systemInfo.AverageExecutionDuration >= _systemWarningThreshold)\n                color = Color.red;\n\n            if (systemFlag == SystemInterfaceFlags.CleanupSystem && systemInfo.AverageCleanupDuration >= _systemWarningThreshold)\n                color = Color.red;\n\n            style.normal.textColor = color;\n\n            return style;\n        }\n\n        void AddDuration(float duration)\n        {\n            // OnInspectorGUI is called twice per frame - only add duration once\n            if (Time.renderedFrameCount != _lastRenderedFrameCount)\n            {\n                _lastRenderedFrameCount = Time.renderedFrameCount;\n                if (_systemMonitorData.Count >= SystemMonitorDataLength)\n                    _systemMonitorData.Dequeue();\n\n                _systemMonitorData.Enqueue(duration);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/DefaultInstanceCreator/DefaultArrayCreator.cs",
    "content": "using System;\n\nnamespace Entitas.Unity.Editor\n{\n    public class DefaultArrayCreator : IDefaultInstanceCreator\n    {\n        public bool HandlesType(Type type) => type.IsArray;\n\n        public object CreateDefault(Type type) =>\n            Array.CreateInstance(type.GetElementType(), new int[type.GetArrayRank()]);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/DefaultInstanceCreator/DefaultStringCreator.cs",
    "content": "using System;\n\nnamespace Entitas.Unity.Editor\n{\n    public class DefaultStringCreator : IDefaultInstanceCreator\n    {\n        public bool HandlesType(Type type) => type == typeof(string);\n\n        public object CreateDefault(Type type) => string.Empty;\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/DefaultInstanceCreator/IDefaultInstanceCreator.cs",
    "content": "using System;\n\nnamespace Entitas.Unity.Editor\n{\n    public interface IDefaultInstanceCreator\n    {\n        bool HandlesType(Type type);\n\n        object CreateDefault(Type type);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/Entitas.Unity.Editor.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>$(DefaultTargetFramework)</TargetFramework>\n    <Version>2.0.0</Version>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"DesperateDevs.Reflection\" Version=\"1.*\" />\n    <PackageReference Include=\"DesperateDevs.Unity.Editor\" Version=\"2.*\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"../Entitas/Entitas.csproj\" />\n    <ProjectReference Include=\"../Entitas.Generators.Attributes/Entitas.Generators.Attributes.csproj\" />\n    <ProjectReference Include=\"../Entitas.Unity/Entitas.Unity.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Reference Include=\"$(UnityEditor)\" />\n    <Reference Include=\"$(UnityEngine)\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/Entitas.Unity.Editor.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=defaultinstancecreator/@EntryIndexedValue\">True</s:Boolean>\n\t<s:Boolean x:Key=\"/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=typedrawer/@EntryIndexedValue\">True</s:Boolean></wpf:ResourceDictionary>"
  },
  {
    "path": "src/Entitas.Unity.Editor/EntitasHierarchyIcon.cs",
    "content": "using DesperateDevs.Unity.Editor;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    [InitializeOnLoad]\n    public static class EntitasHierarchyIcon\n    {\n        static Texture2D ContextHierarchyIcon\n        {\n            get\n            {\n                if (_contextHierarchyIcon == null)\n                    _contextHierarchyIcon = EditorLayout.LoadTexture(\"l:EntitasContextHierarchyIcon\");\n\n                return _contextHierarchyIcon;\n            }\n        }\n\n        static Texture2D ContextErrorHierarchyIcon\n        {\n            get\n            {\n                if (_contextErrorHierarchyIcon == null)\n                    _contextErrorHierarchyIcon = EditorLayout.LoadTexture(\"l:EntitasContextErrorHierarchyIcon\");\n\n                return _contextErrorHierarchyIcon;\n            }\n        }\n\n        static Texture2D EntityHierarchyIcon\n        {\n            get\n            {\n                if (_entityHierarchyIcon == null)\n                    _entityHierarchyIcon = EditorLayout.LoadTexture(\"l:EntitasEntityHierarchyIcon\");\n\n                return _entityHierarchyIcon;\n            }\n        }\n\n        static Texture2D EntityErrorHierarchyIcon\n        {\n            get\n            {\n                if (_entityErrorHierarchyIcon == null)\n                    _entityErrorHierarchyIcon = EditorLayout.LoadTexture(\"l:EntitasEntityErrorHierarchyIcon\");\n\n                return _entityErrorHierarchyIcon;\n            }\n        }\n\n        static Texture2D EntityLinkHierarchyIcon\n        {\n            get\n            {\n                if (_entityLinkHierarchyIcon == null)\n                    _entityLinkHierarchyIcon = EditorLayout.LoadTexture(\"l:EntitasEntityLinkHierarchyIcon\");\n\n                return _entityLinkHierarchyIcon;\n            }\n        }\n\n        static Texture2D EntityLinkWarnHierarchyIcon\n        {\n            get\n            {\n                if (_entityLinkWarnHierarchyIcon == null)\n                    _entityLinkWarnHierarchyIcon = EditorLayout.LoadTexture(\"l:EntitasEntityLinkWarnHierarchyIcon\");\n\n                return _entityLinkWarnHierarchyIcon;\n            }\n        }\n\n        static Texture2D SystemsHierarchyIcon\n        {\n            get\n            {\n                if (_systemsHierarchyIcon == null)\n                    _systemsHierarchyIcon = EditorLayout.LoadTexture(\"l:EntitasSystemsHierarchyIcon\");\n\n                return _systemsHierarchyIcon;\n            }\n        }\n\n        static Texture2D SystemsWarnHierarchyIcon\n        {\n            get\n            {\n                if (_systemsWarnHierarchyIcon == null)\n                    _systemsWarnHierarchyIcon = EditorLayout.LoadTexture(\"l:EntitasSystemsWarnHierarchyIcon\");\n\n                return _systemsWarnHierarchyIcon;\n            }\n        }\n\n        static Texture2D _contextHierarchyIcon;\n        static Texture2D _contextErrorHierarchyIcon;\n        static Texture2D _entityHierarchyIcon;\n        static Texture2D _entityErrorHierarchyIcon;\n        static Texture2D _entityLinkHierarchyIcon;\n        static Texture2D _entityLinkWarnHierarchyIcon;\n        static Texture2D _systemsHierarchyIcon;\n        static Texture2D _systemsWarnHierarchyIcon;\n\n        static readonly int SystemWarningThreshold;\n\n        static EntitasHierarchyIcon()\n        {\n            SystemWarningThreshold = EntitasSettings.Instance.SystemWarningThreshold;\n            EditorApplication.hierarchyWindowItemOnGUI += OnHierarchyWindowItemOnGUI;\n        }\n\n        static void OnHierarchyWindowItemOnGUI(int instanceID, Rect selectionRect)\n        {\n            var gameObject = EditorUtility.InstanceIDToObject(instanceID) as GameObject;\n            if (gameObject == null)\n                return;\n\n            const float iconSize = 16f;\n            const float iconOffset = iconSize + 2f;\n            var rect = new Rect(selectionRect.x + selectionRect.width - iconOffset, selectionRect.y, iconSize, iconSize);\n\n            if (gameObject.TryGetComponent<ContextObserverBehaviour>(out var contextObserver))\n            {\n                GUI.DrawTexture(rect, contextObserver.Context.RetainedEntitiesCount != 0\n                    ? ContextErrorHierarchyIcon\n                    : ContextHierarchyIcon);\n\n                return;\n            }\n\n            if (gameObject.TryGetComponent<EntityBehaviour>(out var entityBehaviour))\n            {\n                GUI.DrawTexture(rect, entityBehaviour.Entity.IsEnabled\n                    ? EntityHierarchyIcon\n                    : EntityErrorHierarchyIcon);\n                return;\n            }\n\n            if (gameObject.TryGetComponent<EntityLink>(out var entityLink))\n            {\n                GUI.DrawTexture(rect, entityLink.Entity != null\n                    ? EntityLinkHierarchyIcon\n                    : EntityLinkWarnHierarchyIcon);\n\n                return;\n            }\n\n            if (gameObject.TryGetComponent<DebugSystemsBehaviour>(out var debugSystemsBehaviour))\n            {\n                GUI.DrawTexture(rect, debugSystemsBehaviour.Systems.ExecuteDuration < SystemWarningThreshold\n                    ? SystemsHierarchyIcon\n                    : SystemsWarnHierarchyIcon);\n\n                return;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/EntitasMenuItems.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing DesperateDevs.Extensions;\nusing DesperateDevs.Reflection;\nusing DesperateDevs.Unity.Editor;\nusing Entitas.Generators.Attributes;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    public static class EntitasMenuItems\n    {\n        const string EntitasDisableVisualDebugging = \"ENTITAS_DISABLE_VISUAL_DEBUGGING\";\n        const string EntitasDisableDeepProfiling = \"ENTITAS_DISABLE_DEEP_PROFILING\";\n        const string EntitasFastAndUnsafe = \"ENTITAS_FAST_AND_UNSAFE\";\n\n        [MenuItem(\"Tools/Entitas/Settings...\", false, 1)]\n        public static void EntitasSettings() => Selection.activeObject = Editor.EntitasSettings.Instance;\n\n        [MenuItem(\"Tools/Entitas/Enable VisualDebugging\", false, 2)]\n        public static void EnableVisualDebugging()\n        {\n            if (IsVisualDebuggingEnabled)\n                new ScriptingDefineSymbols().AddForAll(EntitasDisableVisualDebugging);\n            else\n                new ScriptingDefineSymbols().RemoveForAll(EntitasDisableVisualDebugging);\n        }\n\n        [MenuItem(\"Tools/Entitas/Enable VisualDebugging\", true)]\n        public static bool ValidateEnableVisualDebugging()\n        {\n            Menu.SetChecked(\"Tools/Entitas/Enable VisualDebugging\", IsVisualDebuggingEnabled);\n            return true;\n        }\n\n        static bool IsVisualDebuggingEnabled => !ScriptingDefineSymbols.BuildTargetGroups.All(buildTarget =>\n            PlayerSettings.GetScriptingDefineSymbolsForGroup(buildTarget).Contains(EntitasDisableVisualDebugging));\n\n        [MenuItem(\"Tools/Entitas/Enable Deep Profiling\", false, 3)]\n        public static void EnableDeepProfiling()\n        {\n            if (IsDeepProfilingEnabled)\n                new ScriptingDefineSymbols().AddForAll(EntitasDisableDeepProfiling);\n            else\n                new ScriptingDefineSymbols().RemoveForAll(EntitasDisableDeepProfiling);\n        }\n\n        [MenuItem(\"Tools/Entitas/Enable Deep Profiling\", true)]\n        public static bool ValidateEnableDeepProfiling()\n        {\n            Menu.SetChecked(\"Tools/Entitas/Enable Deep Profiling\", IsDeepProfilingEnabled);\n            return true;\n        }\n\n        static bool IsDeepProfilingEnabled => !ScriptingDefineSymbols.BuildTargetGroups\n            .All(buildTarget => PlayerSettings.GetScriptingDefineSymbolsForGroup(buildTarget).Contains(EntitasDisableDeepProfiling));\n\n        [MenuItem(\"Tools/Entitas/AERC - Safe\", false, 4)]\n        public static void SetSafeAerc()\n        {\n            new ScriptingDefineSymbols().RemoveForAll(EntitasFastAndUnsafe);\n        }\n\n        [MenuItem(\"Tools/Entitas/AERC - Safe\", true)]\n        public static bool ValidateSetSafeAerc()\n        {\n            var isChecked = GetAercMode == 0;\n            Menu.SetChecked(\"Tools/Entitas/AERC - Safe\", isChecked);\n            return !isChecked;\n        }\n\n        [MenuItem(\"Tools/Entitas/AERC - FastAndUnsafe\", false, 5)]\n        public static void SetUnsafeAerc()\n        {\n            new ScriptingDefineSymbols().AddForAll(EntitasFastAndUnsafe);\n        }\n\n        [MenuItem(\"Tools/Entitas/AERC - FastAndUnsafe\", true)]\n        public static bool ValidateSetUnsafeAerc()\n        {\n            var isChecked = GetAercMode == 1;\n            Menu.SetChecked(\"Tools/Entitas/AERC - FastAndUnsafe\", isChecked);\n            return !isChecked;\n        }\n\n        static int GetAercMode => ScriptingDefineSymbols.BuildTargetGroups\n            .All(buildTarget => PlayerSettings.GetScriptingDefineSymbolsForGroup(buildTarget).Contains(EntitasFastAndUnsafe))\n            ? 1\n            : 0;\n\n        [MenuItem(\"Tools/Entitas/Generate/DefaultInstanceCreator\", false, 6)]\n        public static void GenerateDefaultInstanceCreator() => EntityDrawer.GenerateIDefaultInstanceCreator(\"MyType\");\n\n        [MenuItem(\"Tools/Entitas/Generate/TypeDrawer\", false, 7)]\n        public static void GenerateTypeDrawer() => EntityDrawer.GenerateITypeDrawer(\"MyType\");\n\n        [MenuItem(\"Tools/Entitas/Show Statistics\", false, 8)]\n        public static void ShowStatistics()\n        {\n            var stats = string.Join(\"\\n\", GetStatistics().Select(kvp => $\"{kvp.Key}: {kvp.Value}\"));\n            Debug.Log(stats);\n            EditorUtility.DisplayDialog(\"Entitas Statistics\", stats, \"Close\");\n        }\n\n        [MenuItem(\"Tools/Entitas/Open Entitas Wiki...\", false, 50)]\n        public static void EntitasWiki() => Application.OpenURL(\"https://github.com/sschmid/Entitas/wiki\");\n\n        [MenuItem(\"Tools/Entitas/Join the Entitas Discord Server...\", false, 51)]\n        public static void EntitasChat() => Application.OpenURL(\"https://discord.gg/uHrVx5Z\");\n\n        [MenuItem(\"Tools/Entitas/Feedback\", false, 100)]\n        public static void Feedback() => Application.OpenURL(\"https://github.com/sschmid/Entitas/issues\");\n\n        [MenuItem(\"Tools/Entitas/Feedback\", true)]\n        public static bool ValidateFeedback() => false;\n\n        [MenuItem(\"Tools/Entitas/Report a bug...\", false, 101)]\n        public static void ReportBug() => Application.OpenURL(\"https://github.com/sschmid/Entitas/issues\");\n\n        [MenuItem(\"Tools/Entitas/Request a feature...\", false, 102)]\n        public static void RequestFeature() => Application.OpenURL(\"https://github.com/sschmid/Entitas/issues\");\n\n        public static Dictionary<string, int> GetStatistics()\n        {\n            var types = AppDomain.CurrentDomain.GetAllTypes();\n\n            var components = types\n                .Where(type => type.ImplementsInterface<IComponent>())\n                .ToArray();\n\n            var systems = types\n                .Where(IsSystem)\n                .ToArray();\n\n            var contexts = GetContexts(components);\n\n            var stats = new Dictionary<string, int>\n            {\n                { \"Total Components\", components.Length },\n                { \"Systems\", systems.Length }\n            };\n\n            foreach (var context in contexts)\n                stats.Add($\"Components in {context.Key}\", context.Value);\n\n            return stats;\n        }\n\n        static Dictionary<string, int> GetContexts(Type[] components) => components\n            .Aggregate(new Dictionary<string, int>(), (contexts, type) =>\n            {\n                var contextNames = GetContextNamesOrDefault(type);\n                foreach (var contextName in contextNames)\n                {\n                    contexts.TryAdd(contextName, 0);\n                    contexts[contextName] += 1;\n                }\n\n                return contexts;\n            });\n\n        static string[] GetContextNames(Type type) => Attribute\n            .GetCustomAttributes(type)\n            .OfType<ContextAttribute>()\n            .Select(attr => attr.Type.FullName)\n            .ToArray();\n\n        static string[] GetContextNamesOrDefault(Type type)\n        {\n            var contextNames = GetContextNames(type);\n            if (contextNames.Length == 0)\n                contextNames = new[] { \"Default\" };\n\n            return contextNames;\n        }\n\n        static bool IsSystem(Type type) =>\n            type.ImplementsInterface<ISystem>()\n            && type != typeof(ReactiveSystem<>)\n            && type != typeof(Systems)\n            && type != typeof(DebugSystems)\n            && type != typeof(ParallelSystem<>)\n            && type.FullName != \"Feature\";\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/EntitasSettings.cs",
    "content": "using System.Linq;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    public sealed class EntitasSettings : ScriptableObject\n    {\n        public static EntitasSettings Instance\n        {\n            get\n            {\n                if (_instance == null)\n                {\n                    var guid = AssetDatabase.FindAssets($\"l:{nameof(EntitasSettings)}\").FirstOrDefault();\n                    if (guid != null)\n                    {\n                        _instance = AssetDatabase.LoadAssetAtPath<EntitasSettings>(AssetDatabase.GUIDToAssetPath(guid));\n                    }\n                    else\n                    {\n                        var path = $\"Assets/Editor/{nameof(EntitasSettings)}.asset\";\n                        AssetDatabase.CreateAsset(CreateInstance<EntitasSettings>(), path);\n                        _instance = AssetDatabase.LoadAssetAtPath<EntitasSettings>(path);\n                        AssetDatabase.SetLabels(_instance, new[] { nameof(EntitasSettings) });\n                    }\n                }\n\n                return _instance;\n            }\n        }\n\n        static EntitasSettings _instance;\n\n        [Tooltip(\"Duration in milliseconds after which a system is considered to be slow. The system will be highlighted in the hierarchy view.\")]\n        public int SystemWarningThreshold = 5;\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/EntityDrawer.cs",
    "content": "using System;\nusing System.IO;\nusing System.Linq;\nusing DesperateDevs.Extensions;\nusing DesperateDevs.Reflection;\nusing DesperateDevs.Unity.Editor;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    public static partial class EntityDrawer\n    {\n        public static void DrawEntity(Entity entity)\n        {\n            var bgColor = GUI.backgroundColor;\n            GUI.backgroundColor = Color.red;\n            if (GUILayout.Button(\"Destroy Entity\"))\n                entity.Destroy();\n\n            GUI.backgroundColor = bgColor;\n\n            DrawComponents(entity);\n\n            EditorGUILayout.Space();\n\n            EditorGUILayout.LabelField($\"Retained by ({entity.RetainCount})\", EditorStyles.boldLabel);\n\n            if (entity.Aerc is SafeAERC safeAerc)\n            {\n                EditorLayout.BeginVerticalBox();\n                {\n                    foreach (var owner in safeAerc.Owners.OrderBy(o => o.GetType().Name))\n                    {\n                        EditorGUILayout.BeginHorizontal();\n                        {\n                            EditorGUILayout.LabelField(owner.ToString());\n                            if (EditorLayout.MiniButton(\"Release\"))\n                                entity.Release(owner);\n\n                            EditorGUILayout.EndHorizontal();\n                        }\n                    }\n                }\n                EditorLayout.EndVerticalBox();\n            }\n        }\n\n        public static void DrawMultipleEntities(Entity[] entities)\n        {\n            EditorGUILayout.Space();\n            EditorGUILayout.BeginHorizontal();\n            {\n                var entity = entities[0];\n                var index = DrawAddComponentMenu(entity);\n                if (index >= 0)\n                {\n                    var componentType = entity.ContextInfo.ComponentTypes[index];\n                    foreach (var e in entities)\n                    {\n                        var component = e.CreateComponent(index, componentType);\n                        e.AddComponent(index, component);\n                    }\n                }\n            }\n            EditorGUILayout.EndHorizontal();\n\n            EditorGUILayout.Space();\n\n            var bgColor = GUI.backgroundColor;\n            GUI.backgroundColor = Color.red;\n\n            if (GUILayout.Button(\"Destroy selected entities\"))\n                foreach (var entity in entities)\n                    entity.Destroy();\n\n            GUI.backgroundColor = bgColor;\n\n            EditorGUILayout.Space();\n\n            foreach (var entity in entities)\n            {\n                EditorGUILayout.BeginHorizontal();\n                {\n                    EditorGUILayout.LabelField(entity.ToString());\n\n                    bgColor = GUI.backgroundColor;\n                    GUI.backgroundColor = Color.red;\n\n                    if (EditorLayout.MiniButton(\"Destroy Entity\"))\n                        entity.Destroy();\n\n                    GUI.backgroundColor = bgColor;\n                }\n                EditorGUILayout.EndHorizontal();\n            }\n        }\n\n        public static void DrawComponents(Entity entity)\n        {\n            var unfoldedComponents = GetUnfoldedComponents(entity);\n            var componentMemberSearch = GetComponentMemberSearch(entity);\n\n            EditorLayout.BeginVerticalBox();\n            {\n                EditorGUILayout.BeginHorizontal();\n                {\n                    EditorGUILayout.LabelField($\"Components ({entity.GetComponents().Length})\", EditorStyles.boldLabel);\n                    if (EditorLayout.MiniButtonLeft(\"▸\"))\n                        for (var i = 0; i < unfoldedComponents.Length; i++)\n                            unfoldedComponents[i] = false;\n\n                    if (EditorLayout.MiniButtonRight(\"▾\"))\n                        for (var i = 0; i < unfoldedComponents.Length; i++)\n                            unfoldedComponents[i] = true;\n                }\n                EditorGUILayout.EndHorizontal();\n\n                EditorGUILayout.Space();\n\n                var index = DrawAddComponentMenu(entity);\n                if (index >= 0)\n                {\n                    var componentType = entity.ContextInfo.ComponentTypes[index];\n                    var component = entity.CreateComponent(index, componentType);\n                    entity.AddComponent(index, component);\n                }\n\n                EditorGUILayout.Space();\n\n                ComponentNameSearchString = EditorLayout.SearchTextField(ComponentNameSearchString);\n\n                EditorGUILayout.Space();\n\n                var indexes = entity.GetComponentIndexes();\n                var components = entity.GetComponents();\n                for (var i = 0; i < components.Length; i++)\n                    DrawComponent(unfoldedComponents, componentMemberSearch, entity, indexes[i], components[i]);\n            }\n            EditorLayout.EndVerticalBox();\n        }\n\n        public static void DrawComponent(bool[] unfoldedComponents, string[] componentMemberSearch, Entity entity, int index, IComponent component)\n        {\n            var componentType = component.GetType();\n            var componentName = componentType.Name.RemoveSuffix(\"Component\");\n            if (EditorLayout.MatchesSearchString(componentName.ToLower(), ComponentNameSearchString.ToLower()))\n            {\n                EditorGUILayout.BeginVertical();\n                {\n                    if (!Attribute.IsDefined(componentType, typeof(DontDrawComponentAttribute)))\n                    {\n                        var memberInfos = componentType.GetPublicMemberInfos();\n                        EditorGUILayout.BeginHorizontal();\n                        {\n                            if (memberInfos.Length == 0)\n                            {\n                                EditorGUILayout.LabelField(componentName, EditorStyles.boldLabel);\n                            }\n                            else\n                            {\n                                unfoldedComponents[index] = EditorLayout.Foldout(unfoldedComponents[index], componentName, FoldoutStyle);\n                                if (unfoldedComponents[index])\n                                {\n                                    componentMemberSearch[index] = memberInfos.Length > 5\n                                        ? EditorLayout.SearchTextField(componentMemberSearch[index])\n                                        : string.Empty;\n                                }\n                            }\n\n                            if (EditorLayout.MiniButton(\"-\"))\n                                entity.RemoveComponent(index);\n                        }\n                        EditorGUILayout.EndHorizontal();\n\n                        if (unfoldedComponents[index])\n                        {\n                            var newComponent = entity.CreateComponent(index, componentType);\n                            component.CopyPublicMemberValues(newComponent);\n\n                            var changed = false;\n                            var componentDrawer = GetComponentDrawer(componentType);\n                            if (componentDrawer != null)\n                            {\n                                EditorGUI.BeginChangeCheck();\n                                {\n                                    componentDrawer.DrawComponent(newComponent);\n                                }\n                                changed = EditorGUI.EndChangeCheck();\n                            }\n                            else\n                            {\n                                foreach (var info in memberInfos)\n                                {\n                                    if (EditorLayout.MatchesSearchString(info.Name.ToLower(), componentMemberSearch[index].ToLower()))\n                                    {\n                                        var memberValue = info.GetValue(newComponent);\n                                        var memberType = memberValue == null ? info.Type : memberValue.GetType();\n                                        if (DrawObjectMember(memberType, info.Name, memberValue, newComponent, info.SetValue))\n                                            changed = true;\n                                    }\n                                }\n                            }\n\n                            if (changed)\n                                entity.ReplaceComponent(index, newComponent);\n                            else\n                                entity.GetComponentPool(index).Push(newComponent);\n                        }\n                    }\n                    else\n                    {\n                        EditorGUILayout.LabelField(componentName, \"[DontDrawComponent]\", EditorStyles.boldLabel);\n                    }\n                }\n                EditorLayout.EndVerticalBox();\n            }\n        }\n\n        public static bool DrawObjectMember(Type memberType, string memberName, object value, object target, Action<object, object> setValue)\n        {\n            if (value == null)\n            {\n                EditorGUI.BeginChangeCheck();\n                {\n                    var isUnityObject = memberType == typeof(UnityEngine.Object) || memberType.IsSubclassOf(typeof(UnityEngine.Object));\n                    EditorGUILayout.BeginHorizontal();\n                    {\n                        if (isUnityObject)\n                            setValue(target, EditorGUILayout.ObjectField(memberName, (UnityEngine.Object)value, memberType, true));\n                        else\n                            EditorGUILayout.LabelField(memberName, \"null\");\n\n                        if (EditorLayout.MiniButton($\"new {memberType.ToCompilableString().TypeName()}\"))\n                        {\n                            if (CreateDefault(memberType, out var defaultValue))\n                                setValue(target, defaultValue);\n                        }\n                    }\n                    EditorGUILayout.EndHorizontal();\n                }\n\n                return EditorGUI.EndChangeCheck();\n            }\n\n            if (!memberType.IsValueType)\n            {\n                EditorGUILayout.BeginHorizontal();\n                EditorGUILayout.BeginVertical();\n            }\n\n            EditorGUI.BeginChangeCheck();\n            {\n                var typeDrawer = GetTypeDrawer(memberType);\n                if (typeDrawer != null)\n                {\n                    var newValue = typeDrawer.DrawAndGetNewValue(memberType, memberName, value, target);\n                    setValue(target, newValue);\n                }\n                else\n                {\n                    var targetType = target.GetType();\n                    var shouldDraw = !targetType.ImplementsInterface<IComponent>() || !Attribute.IsDefined(targetType, typeof(DontDrawComponentAttribute));\n                    if (shouldDraw)\n                    {\n                        EditorGUILayout.LabelField(memberName, value.ToString());\n\n                        var indent = EditorGUI.indentLevel;\n                        EditorGUI.indentLevel += 1;\n\n                        EditorGUILayout.BeginVertical();\n                        {\n                            foreach (var info in memberType.GetPublicMemberInfos())\n                            {\n                                var mValue = info.GetValue(value);\n                                var mType = mValue == null ? info.Type : mValue.GetType();\n                                DrawObjectMember(mType, info.Name, mValue, value, info.SetValue);\n                                if (memberType.IsValueType)\n                                    setValue(target, value);\n                            }\n                        }\n                        EditorGUILayout.EndVertical();\n\n                        EditorGUI.indentLevel = indent;\n                    }\n                    else\n                    {\n                        DrawUnsupportedType(memberType, memberName, value);\n                    }\n                }\n\n                if (!memberType.IsValueType)\n                {\n                    EditorGUILayout.EndVertical();\n                    if (EditorLayout.MiniButton(\"×\"))\n                        setValue(target, null);\n\n                    EditorGUILayout.EndHorizontal();\n                }\n            }\n\n            return EditorGUI.EndChangeCheck();\n        }\n\n        public static bool CreateDefault(Type type, out object defaultValue)\n        {\n            try\n            {\n                defaultValue = Activator.CreateInstance(type);\n                return true;\n            }\n            catch (Exception)\n            {\n                foreach (var creator in DefaultInstanceCreators)\n                {\n                    if (creator.HandlesType(type))\n                    {\n                        defaultValue = creator.CreateDefault(type);\n                        return true;\n                    }\n                }\n            }\n\n            var typeName = type.ToCompilableString();\n            if (EditorUtility.DisplayDialog(\n                    \"No IDefaultInstanceCreator found\",\n                    \"There's no IDefaultInstanceCreator implementation to handle the type '\" + typeName + \"'.\\n\" +\n                    \"Providing an IDefaultInstanceCreator enables you to create instances for that type.\\n\\n\" +\n                    \"Do you want to generate an IDefaultInstanceCreator implementation for '\" + typeName + \"'?\\n\",\n                    \"Generate\",\n                    \"Cancel\"\n                ))\n            {\n                GenerateIDefaultInstanceCreator(typeName);\n            }\n\n            defaultValue = null;\n            return false;\n        }\n\n        static int DrawAddComponentMenu(Entity entity)\n        {\n            var componentInfos = GetComponentInfos(entity)\n                .Where(info => !entity.HasComponent(info.Index))\n                .ToArray();\n            var componentNames = componentInfos\n                .Select(info => info.Name)\n                .ToArray();\n            var index = EditorGUILayout.Popup(\"Add Component\", -1, componentNames);\n            return index >= 0\n                ? componentInfos[index].Index\n                : -1;\n        }\n\n        static void DrawUnsupportedType(Type memberType, string memberName, object value)\n        {\n            EditorGUILayout.BeginHorizontal();\n            {\n                EditorGUILayout.LabelField(memberName, value.ToString());\n                if (EditorLayout.MiniButton(\"Missing ITypeDrawer\"))\n                {\n                    var typeName = memberType.ToCompilableString();\n                    if (EditorUtility.DisplayDialog(\n                            \"No ITypeDrawer found\",\n                            \"There's no ITypeDrawer implementation to handle the type '\" + typeName + \"'.\\n\" +\n                            \"Providing an ITypeDrawer enables you draw instances for that type.\\n\\n\" +\n                            \"Do you want to generate an ITypeDrawer implementation for '\" + typeName + \"'?\\n\",\n                            \"Generate\",\n                            \"Cancel\"\n                        ))\n                    {\n                        GenerateITypeDrawer(typeName);\n                    }\n                }\n            }\n            EditorGUILayout.EndHorizontal();\n        }\n\n        public static void GenerateIDefaultInstanceCreator(string typeName)\n        {\n            var folder = \"Assets/Editor/DefaultInstanceCreator\";\n            var filePath = Path.Combine(folder, \"Default\" + typeName.TypeName() + \"InstanceCreator.cs\");\n            var template = DefaultInstanceCreatorTemplateFormat\n                .Replace(\"${Type}\", typeName)\n                .Replace(\"${ShortType}\", typeName.TypeName());\n            GenerateTemplate(folder, filePath, template);\n        }\n\n        public static void GenerateITypeDrawer(string typeName)\n        {\n            var folder = \"Assets/Editor/TypeDrawer\";\n            var filePath = Path.Combine(folder, typeName.TypeName() + \"TypeDrawer.cs\");\n            var template = TypeDrawerTemplateFormat\n                .Replace(\"${Type}\", typeName)\n                .Replace(\"${ShortType}\", typeName.TypeName());\n            GenerateTemplate(folder, filePath, template);\n        }\n\n        static void GenerateTemplate(string folder, string filePath, string template)\n        {\n            if (!Directory.Exists(folder))\n                Directory.CreateDirectory(folder);\n\n            File.WriteAllText(filePath, template);\n            EditorApplication.isPlaying = false;\n            AssetDatabase.Refresh();\n            Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(filePath);\n        }\n\n        const string DefaultInstanceCreatorTemplateFormat =\n            @\"using System;\nusing Entitas.Unity.Editor;\n\npublic class Default${ShortType}InstanceCreator : IDefaultInstanceCreator\n{\n    public bool HandlesType(Type type)\n    {\n        return type == typeof(${Type});\n    }\n\n    public object CreateDefault(Type type)\n    {\n        // TODO return an instance of type ${Type}\n        throw new NotImplementedException();\n    }\n}\n\n\";\n\n        const string TypeDrawerTemplateFormat =\n            @\"using System;\nusing Entitas.Unity.Editor;\n\npublic class ${ShortType}TypeDrawer : ITypeDrawer\n{\n    public bool HandlesType(Type type)\n    {\n        return type == typeof(${Type});\n    }\n\n    public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target)\n    {\n        // TODO draw the type ${Type}\n        throw new NotImplementedException();\n    }\n}\n\";\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/EntityDrawerState.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing DesperateDevs.Reflection;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    public static partial class EntityDrawer\n    {\n        static Dictionary<string, bool[]> _contextToUnfoldedComponents;\n\n        public static Dictionary<string, bool[]> ContextToUnfoldedComponents =>\n            _contextToUnfoldedComponents ??= new Dictionary<string, bool[]>();\n\n        static Dictionary<string, string[]> _contextToComponentMemberSearch;\n\n        public static Dictionary<string, string[]> ContextToComponentMemberSearch =>\n            _contextToComponentMemberSearch ??= new Dictionary<string, string[]>();\n\n        public struct ComponentInfo\n        {\n            public int Index;\n            public string Name;\n            public Type Type;\n        }\n\n        static Dictionary<string, ComponentInfo[]> _contextToComponentInfos;\n\n        public static Dictionary<string, ComponentInfo[]> ContextToComponentInfos =>\n            _contextToComponentInfos ??= new Dictionary<string, ComponentInfo[]>();\n\n        static GUIStyle _foldoutStyle;\n\n        public static GUIStyle FoldoutStyle\n        {\n            get\n            {\n                if (_foldoutStyle == null)\n                {\n                    _foldoutStyle = new GUIStyle(EditorStyles.foldout);\n                    _foldoutStyle.fontStyle = FontStyle.Bold;\n                }\n\n                return _foldoutStyle;\n            }\n        }\n\n        static string _componentNameSearchString;\n\n        public static string ComponentNameSearchString\n        {\n            get => _componentNameSearchString ??= string.Empty;\n            set => _componentNameSearchString = value;\n        }\n\n        public static readonly IDefaultInstanceCreator[] DefaultInstanceCreators;\n        public static readonly ITypeDrawer[] TypeDrawers;\n        public static readonly IComponentDrawer[] ComponentDrawers;\n\n        static EntityDrawer()\n        {\n            DefaultInstanceCreators = AppDomain.CurrentDomain.GetInstancesOf<IDefaultInstanceCreator>().ToArray();\n            TypeDrawers = AppDomain.CurrentDomain.GetInstancesOf<ITypeDrawer>().ToArray();\n            ComponentDrawers = AppDomain.CurrentDomain.GetInstancesOf<IComponentDrawer>().ToArray();\n        }\n\n        static bool[] GetUnfoldedComponents(Entity entity)\n        {\n            if (!ContextToUnfoldedComponents.TryGetValue(entity.ContextInfo.Name, out var unfoldedComponents))\n            {\n                unfoldedComponents = new bool[entity.TotalComponents];\n                for (var i = 0; i < unfoldedComponents.Length; i++)\n                    unfoldedComponents[i] = true;\n\n                ContextToUnfoldedComponents.Add(entity.ContextInfo.Name, unfoldedComponents);\n            }\n\n            return unfoldedComponents;\n        }\n\n        static string[] GetComponentMemberSearch(Entity entity)\n        {\n            if (!ContextToComponentMemberSearch.TryGetValue(entity.ContextInfo.Name, out var componentMemberSearch))\n            {\n                componentMemberSearch = new string[entity.TotalComponents];\n                for (var i = 0; i < componentMemberSearch.Length; i++)\n                    componentMemberSearch[i] = string.Empty;\n\n                ContextToComponentMemberSearch.Add(entity.ContextInfo.Name, componentMemberSearch);\n            }\n\n            return componentMemberSearch;\n        }\n\n        static ComponentInfo[] GetComponentInfos(Entity entity)\n        {\n            if (!ContextToComponentInfos.TryGetValue(entity.ContextInfo.Name, out var infos))\n            {\n                var contextInfo = entity.ContextInfo;\n                var infosList = new List<ComponentInfo>(contextInfo.ComponentTypes.Length);\n                for (var i = 0; i < contextInfo.ComponentTypes.Length; i++)\n                {\n                    infosList.Add(new ComponentInfo\n                    {\n                        Index = i,\n                        Name = contextInfo.ComponentNames[i],\n                        Type = contextInfo.ComponentTypes[i]\n                    });\n                }\n\n                infos = infosList.ToArray();\n                ContextToComponentInfos.Add(entity.ContextInfo.Name, infos);\n            }\n\n            return infos;\n        }\n\n        static IComponentDrawer GetComponentDrawer(Type type)\n        {\n            foreach (var drawer in ComponentDrawers)\n                if (drawer.HandlesType(type))\n                    return drawer;\n\n            return null;\n        }\n\n        static ITypeDrawer GetTypeDrawer(Type type)\n        {\n            foreach (var drawer in TypeDrawers)\n                if (drawer.HandlesType(type))\n                    return drawer;\n\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/EntityEditor.cs",
    "content": "using System.Linq;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    [CustomEditor(typeof(EntityBehaviour)), CanEditMultipleObjects]\n    public class EntityEditor : UnityEditor.Editor\n    {\n        public override void OnInspectorGUI()\n        {\n            if (targets.Length == 1)\n            {\n                EntityDrawer.DrawEntity(((EntityBehaviour)target).Entity);\n            }\n            else\n            {\n                var entities = targets\n                    .Select(t => ((EntityBehaviour)t).Entity)\n                    .ToArray();\n\n                EntityDrawer.DrawMultipleEntities(entities);\n            }\n\n            if (target != null)\n                EditorUtility.SetDirty(target);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/EntityLinkEditor.cs",
    "content": "using System.Linq;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    [CustomEditor(typeof(EntityLink))]\n    public class EntityLinkEditor : UnityEditor.Editor\n    {\n        public override void OnInspectorGUI()\n        {\n            var link = (EntityLink)target;\n\n            if (link.Entity != null)\n                if (GUILayout.Button(\"Unlink\"))\n                    link.Unlink();\n\n            if (link.Entity != null)\n            {\n                EditorGUILayout.Space();\n\n                EditorGUILayout.LabelField(link.Entity.ToString());\n\n                if (GUILayout.Button(\"Show entity\"))\n                    Selection.activeGameObject = FindObjectsOfType<EntityBehaviour>()\n                        .Single(entity => entity.Entity == link.Entity).gameObject;\n\n                EditorGUILayout.Space();\n\n                EntityDrawer.DrawEntity(link.Entity);\n            }\n            else\n            {\n                EditorGUILayout.LabelField(\"Not linked to an entity\");\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/IComponentDrawer.cs",
    "content": "﻿using System;\n\nnamespace Entitas.Unity.Editor\n{\n    public interface IComponentDrawer\n    {\n        bool HandlesType(Type type);\n\n        IComponent DrawComponent(IComponent component);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/Images/EntitasContextErrorHierarchyIcon.png.meta",
    "content": "fileFormatVersion: 2\nguid: 35e2fad360fea426684933179da777df\nlabels:\n- EntitasContextErrorHierarchyIcon\nTextureImporter:\n  fileIDToRecycleName: {}\n  externalObjects: {}\n  serializedVersion: 7\n  mipmaps:\n    mipMapMode: 0\n    enableMipMap: 0\n    sRGBTexture: 0\n    linearTexture: 0\n    fadeOut: 0\n    borderMipMap: 0\n    mipMapsPreserveCoverage: 0\n    alphaTestReferenceValue: 0.5\n    mipMapFadeDistanceStart: 1\n    mipMapFadeDistanceEnd: 3\n  bumpmap:\n    convertToNormalMap: 0\n    externalNormalMap: 0\n    heightScale: 0.25\n    normalMapFilter: 0\n  isReadable: 0\n  streamingMipmaps: 0\n  streamingMipmapsPriority: 0\n  grayScaleToAlpha: 0\n  generateCubemap: 6\n  cubemapConvolution: 0\n  seamlessCubemap: 0\n  textureFormat: -3\n  maxTextureSize: 256\n  textureSettings:\n    serializedVersion: 2\n    filterMode: 0\n    aniso: -1\n    mipBias: -100\n    wrapU: 0\n    wrapV: 0\n    wrapW: 0\n  nPOTScale: 1\n  lightmap: 0\n  compressionQuality: 50\n  spriteMode: 0\n  spriteExtrude: 1\n  spriteMeshType: 1\n  alignment: 0\n  spritePivot: {x: 0.5, y: 0.5}\n  spritePixelsToUnits: 100\n  spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n  spriteGenerateFallbackPhysicsShape: 1\n  alphaUsage: 1\n  alphaIsTransparency: 1\n  spriteTessellationDetail: -1\n  textureType: 0\n  textureShape: 1\n  singleChannelComponent: 0\n  maxTextureSizeSet: 0\n  compressionQualitySet: 0\n  textureFormatSet: 0\n  platformSettings:\n  - serializedVersion: 2\n    buildTarget: DefaultTexturePlatform\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Standalone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: iPhone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Android\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: WebGL\n    maxTextureSize: 256\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  spriteSheet:\n    serializedVersion: 2\n    sprites: []\n    outline: []\n    physicsShape: []\n    bones: []\n    spriteID: \n    vertices: []\n    indices: \n    edges: []\n    weights: []\n  spritePackingTag: \n  pSDRemoveMatte: 0\n  pSDShowRemoveMatteOption: 0\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "src/Entitas.Unity.Editor/Images/EntitasContextHierarchyIcon.png.meta",
    "content": "fileFormatVersion: 2\nguid: e23ad41464ef945d784cdb90d844e6c4\nlabels:\n- EntitasContextHierarchyIcon\nTextureImporter:\n  fileIDToRecycleName: {}\n  externalObjects: {}\n  serializedVersion: 7\n  mipmaps:\n    mipMapMode: 0\n    enableMipMap: 0\n    sRGBTexture: 0\n    linearTexture: 0\n    fadeOut: 0\n    borderMipMap: 0\n    mipMapsPreserveCoverage: 0\n    alphaTestReferenceValue: 0.5\n    mipMapFadeDistanceStart: 1\n    mipMapFadeDistanceEnd: 3\n  bumpmap:\n    convertToNormalMap: 0\n    externalNormalMap: 0\n    heightScale: 0.25\n    normalMapFilter: 0\n  isReadable: 0\n  streamingMipmaps: 0\n  streamingMipmapsPriority: 0\n  grayScaleToAlpha: 0\n  generateCubemap: 6\n  cubemapConvolution: 0\n  seamlessCubemap: 0\n  textureFormat: -3\n  maxTextureSize: 256\n  textureSettings:\n    serializedVersion: 2\n    filterMode: 0\n    aniso: -1\n    mipBias: -100\n    wrapU: 0\n    wrapV: 0\n    wrapW: 0\n  nPOTScale: 1\n  lightmap: 0\n  compressionQuality: 50\n  spriteMode: 0\n  spriteExtrude: 1\n  spriteMeshType: 1\n  alignment: 0\n  spritePivot: {x: 0.5, y: 0.5}\n  spritePixelsToUnits: 100\n  spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n  spriteGenerateFallbackPhysicsShape: 1\n  alphaUsage: 1\n  alphaIsTransparency: 1\n  spriteTessellationDetail: -1\n  textureType: 0\n  textureShape: 1\n  singleChannelComponent: 0\n  maxTextureSizeSet: 0\n  compressionQualitySet: 0\n  textureFormatSet: 0\n  platformSettings:\n  - serializedVersion: 2\n    buildTarget: DefaultTexturePlatform\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Standalone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: iPhone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Android\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: WebGL\n    maxTextureSize: 256\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  spriteSheet:\n    serializedVersion: 2\n    sprites: []\n    outline: []\n    physicsShape: []\n    bones: []\n    spriteID: \n    vertices: []\n    indices: \n    edges: []\n    weights: []\n  spritePackingTag: \n  pSDRemoveMatte: 0\n  pSDShowRemoveMatteOption: 0\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "src/Entitas.Unity.Editor/Images/EntitasEntityErrorHierarchyIcon.png.meta",
    "content": "fileFormatVersion: 2\nguid: 06bc0e5b0b5124fca8f5d7dde1d012b0\nlabels:\n- EntitasEntityErrorHierarchyIcon\nTextureImporter:\n  fileIDToRecycleName: {}\n  externalObjects: {}\n  serializedVersion: 7\n  mipmaps:\n    mipMapMode: 0\n    enableMipMap: 0\n    sRGBTexture: 0\n    linearTexture: 0\n    fadeOut: 0\n    borderMipMap: 0\n    mipMapsPreserveCoverage: 0\n    alphaTestReferenceValue: 0.5\n    mipMapFadeDistanceStart: 1\n    mipMapFadeDistanceEnd: 3\n  bumpmap:\n    convertToNormalMap: 0\n    externalNormalMap: 0\n    heightScale: 0.25\n    normalMapFilter: 0\n  isReadable: 0\n  streamingMipmaps: 0\n  streamingMipmapsPriority: 0\n  grayScaleToAlpha: 0\n  generateCubemap: 6\n  cubemapConvolution: 0\n  seamlessCubemap: 0\n  textureFormat: -3\n  maxTextureSize: 256\n  textureSettings:\n    serializedVersion: 2\n    filterMode: 0\n    aniso: -1\n    mipBias: -100\n    wrapU: 0\n    wrapV: 0\n    wrapW: 0\n  nPOTScale: 1\n  lightmap: 0\n  compressionQuality: 50\n  spriteMode: 0\n  spriteExtrude: 1\n  spriteMeshType: 1\n  alignment: 0\n  spritePivot: {x: 0.5, y: 0.5}\n  spritePixelsToUnits: 100\n  spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n  spriteGenerateFallbackPhysicsShape: 1\n  alphaUsage: 1\n  alphaIsTransparency: 1\n  spriteTessellationDetail: -1\n  textureType: 0\n  textureShape: 1\n  singleChannelComponent: 0\n  maxTextureSizeSet: 0\n  compressionQualitySet: 0\n  textureFormatSet: 0\n  platformSettings:\n  - serializedVersion: 2\n    buildTarget: DefaultTexturePlatform\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Standalone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: iPhone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Android\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  spriteSheet:\n    serializedVersion: 2\n    sprites: []\n    outline: []\n    physicsShape: []\n    bones: []\n    spriteID: \n    vertices: []\n    indices: \n    edges: []\n    weights: []\n  spritePackingTag: \n  pSDRemoveMatte: 0\n  pSDShowRemoveMatteOption: 0\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "src/Entitas.Unity.Editor/Images/EntitasEntityHierarchyIcon.png.meta",
    "content": "fileFormatVersion: 2\nguid: 27b806265ee874b86aa2d28aba93ace2\nlabels:\n- EntitasEntityHierarchyIcon\nTextureImporter:\n  fileIDToRecycleName: {}\n  externalObjects: {}\n  serializedVersion: 7\n  mipmaps:\n    mipMapMode: 0\n    enableMipMap: 0\n    sRGBTexture: 0\n    linearTexture: 0\n    fadeOut: 0\n    borderMipMap: 0\n    mipMapsPreserveCoverage: 0\n    alphaTestReferenceValue: 0.5\n    mipMapFadeDistanceStart: 1\n    mipMapFadeDistanceEnd: 3\n  bumpmap:\n    convertToNormalMap: 0\n    externalNormalMap: 0\n    heightScale: 0.25\n    normalMapFilter: 0\n  isReadable: 0\n  streamingMipmaps: 0\n  streamingMipmapsPriority: 0\n  grayScaleToAlpha: 0\n  generateCubemap: 6\n  cubemapConvolution: 0\n  seamlessCubemap: 0\n  textureFormat: -3\n  maxTextureSize: 256\n  textureSettings:\n    serializedVersion: 2\n    filterMode: 0\n    aniso: -1\n    mipBias: -100\n    wrapU: 0\n    wrapV: 0\n    wrapW: 0\n  nPOTScale: 1\n  lightmap: 0\n  compressionQuality: 50\n  spriteMode: 0\n  spriteExtrude: 1\n  spriteMeshType: 1\n  alignment: 0\n  spritePivot: {x: 0.5, y: 0.5}\n  spritePixelsToUnits: 100\n  spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n  spriteGenerateFallbackPhysicsShape: 1\n  alphaUsage: 1\n  alphaIsTransparency: 1\n  spriteTessellationDetail: -1\n  textureType: 0\n  textureShape: 1\n  singleChannelComponent: 0\n  maxTextureSizeSet: 0\n  compressionQualitySet: 0\n  textureFormatSet: 0\n  platformSettings:\n  - serializedVersion: 2\n    buildTarget: DefaultTexturePlatform\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Standalone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: iPhone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Android\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  spriteSheet:\n    serializedVersion: 2\n    sprites: []\n    outline: []\n    physicsShape: []\n    bones: []\n    spriteID: \n    vertices: []\n    indices: \n    edges: []\n    weights: []\n  spritePackingTag: \n  pSDRemoveMatte: 0\n  pSDShowRemoveMatteOption: 0\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "src/Entitas.Unity.Editor/Images/EntitasEntityLinkHierarchyIcon.png.meta",
    "content": "fileFormatVersion: 2\nguid: 9647a20347ff0494682ccccc9f1bc18d\nlabels:\n- EntitasEntityLinkHierarchyIcon\nTextureImporter:\n  fileIDToRecycleName: {}\n  externalObjects: {}\n  serializedVersion: 7\n  mipmaps:\n    mipMapMode: 0\n    enableMipMap: 0\n    sRGBTexture: 0\n    linearTexture: 0\n    fadeOut: 0\n    borderMipMap: 0\n    mipMapsPreserveCoverage: 0\n    alphaTestReferenceValue: 0.5\n    mipMapFadeDistanceStart: 1\n    mipMapFadeDistanceEnd: 3\n  bumpmap:\n    convertToNormalMap: 0\n    externalNormalMap: 0\n    heightScale: 0.25\n    normalMapFilter: 0\n  isReadable: 0\n  streamingMipmaps: 0\n  streamingMipmapsPriority: 0\n  grayScaleToAlpha: 0\n  generateCubemap: 6\n  cubemapConvolution: 0\n  seamlessCubemap: 0\n  textureFormat: 1\n  maxTextureSize: 2048\n  textureSettings:\n    serializedVersion: 2\n    filterMode: 0\n    aniso: -1\n    mipBias: -100\n    wrapU: 0\n    wrapV: 0\n    wrapW: 0\n  nPOTScale: 1\n  lightmap: 0\n  compressionQuality: 50\n  spriteMode: 0\n  spriteExtrude: 1\n  spriteMeshType: 1\n  alignment: 0\n  spritePivot: {x: 0.5, y: 0.5}\n  spritePixelsToUnits: 100\n  spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n  spriteGenerateFallbackPhysicsShape: 1\n  alphaUsage: 1\n  alphaIsTransparency: 1\n  spriteTessellationDetail: -1\n  textureType: 0\n  textureShape: 1\n  singleChannelComponent: 0\n  maxTextureSizeSet: 0\n  compressionQualitySet: 0\n  textureFormatSet: 0\n  platformSettings:\n  - serializedVersion: 2\n    buildTarget: DefaultTexturePlatform\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Standalone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: iPhone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Android\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  spriteSheet:\n    serializedVersion: 2\n    sprites: []\n    outline: []\n    physicsShape: []\n    bones: []\n    spriteID: \n    vertices: []\n    indices: \n    edges: []\n    weights: []\n  spritePackingTag: \n  pSDRemoveMatte: 0\n  pSDShowRemoveMatteOption: 0\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "src/Entitas.Unity.Editor/Images/EntitasEntityLinkWarnHierarchyIcon.png.meta",
    "content": "fileFormatVersion: 2\nguid: 8efbceefe59cd4553baf36a0ef025dc1\nlabels:\n- EntitasEntityLinkWarnHierarchyIcon\nTextureImporter:\n  fileIDToRecycleName: {}\n  externalObjects: {}\n  serializedVersion: 7\n  mipmaps:\n    mipMapMode: 0\n    enableMipMap: 0\n    sRGBTexture: 0\n    linearTexture: 0\n    fadeOut: 0\n    borderMipMap: 0\n    mipMapsPreserveCoverage: 0\n    alphaTestReferenceValue: 0.5\n    mipMapFadeDistanceStart: 1\n    mipMapFadeDistanceEnd: 3\n  bumpmap:\n    convertToNormalMap: 0\n    externalNormalMap: 0\n    heightScale: 0.25\n    normalMapFilter: 0\n  isReadable: 0\n  streamingMipmaps: 0\n  streamingMipmapsPriority: 0\n  grayScaleToAlpha: 0\n  generateCubemap: 6\n  cubemapConvolution: 0\n  seamlessCubemap: 0\n  textureFormat: 1\n  maxTextureSize: 2048\n  textureSettings:\n    serializedVersion: 2\n    filterMode: 0\n    aniso: -1\n    mipBias: -100\n    wrapU: 0\n    wrapV: 0\n    wrapW: 0\n  nPOTScale: 1\n  lightmap: 0\n  compressionQuality: 50\n  spriteMode: 0\n  spriteExtrude: 1\n  spriteMeshType: 1\n  alignment: 0\n  spritePivot: {x: 0.5, y: 0.5}\n  spritePixelsToUnits: 100\n  spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n  spriteGenerateFallbackPhysicsShape: 1\n  alphaUsage: 1\n  alphaIsTransparency: 1\n  spriteTessellationDetail: -1\n  textureType: 0\n  textureShape: 1\n  singleChannelComponent: 0\n  maxTextureSizeSet: 0\n  compressionQualitySet: 0\n  textureFormatSet: 0\n  platformSettings:\n  - serializedVersion: 2\n    buildTarget: DefaultTexturePlatform\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Standalone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: iPhone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Android\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  spriteSheet:\n    serializedVersion: 2\n    sprites: []\n    outline: []\n    physicsShape: []\n    bones: []\n    spriteID: \n    vertices: []\n    indices: \n    edges: []\n    weights: []\n  spritePackingTag: \n  pSDRemoveMatte: 0\n  pSDShowRemoveMatteOption: 0\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "src/Entitas.Unity.Editor/Images/EntitasHeader.png.meta",
    "content": "fileFormatVersion: 2\nguid: 65fb57b88da1f40c59682763366ab260\nlabels:\n- EntitasHeader\nTextureImporter:\n  fileIDToRecycleName: {}\n  externalObjects: {}\n  serializedVersion: 7\n  mipmaps:\n    mipMapMode: 0\n    enableMipMap: 0\n    sRGBTexture: 0\n    linearTexture: 0\n    fadeOut: 0\n    borderMipMap: 0\n    mipMapsPreserveCoverage: 0\n    alphaTestReferenceValue: 0.5\n    mipMapFadeDistanceStart: 1\n    mipMapFadeDistanceEnd: 3\n  bumpmap:\n    convertToNormalMap: 0\n    externalNormalMap: 0\n    heightScale: 0.25\n    normalMapFilter: 0\n  isReadable: 0\n  streamingMipmaps: 0\n  streamingMipmapsPriority: 0\n  grayScaleToAlpha: 0\n  generateCubemap: 6\n  cubemapConvolution: 0\n  seamlessCubemap: 0\n  textureFormat: -3\n  maxTextureSize: 2048\n  textureSettings:\n    serializedVersion: 2\n    filterMode: 2\n    aniso: 1\n    mipBias: -100\n    wrapU: 0\n    wrapV: 0\n    wrapW: 0\n  nPOTScale: 0\n  lightmap: 0\n  compressionQuality: 50\n  spriteMode: 0\n  spriteExtrude: 1\n  spriteMeshType: 1\n  alignment: 0\n  spritePivot: {x: 0.5, y: 0.5}\n  spritePixelsToUnits: 100\n  spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n  spriteGenerateFallbackPhysicsShape: 1\n  alphaUsage: 1\n  alphaIsTransparency: 0\n  spriteTessellationDetail: -1\n  textureType: 0\n  textureShape: 1\n  singleChannelComponent: 0\n  maxTextureSizeSet: 0\n  compressionQualitySet: 0\n  textureFormatSet: 0\n  platformSettings:\n  - serializedVersion: 2\n    buildTarget: DefaultTexturePlatform\n    maxTextureSize: 2048\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Standalone\n    maxTextureSize: 2048\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: iPhone\n    maxTextureSize: 2048\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Android\n    maxTextureSize: 2048\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  spriteSheet:\n    serializedVersion: 2\n    sprites: []\n    outline: []\n    physicsShape: []\n    bones: []\n    spriteID: \n    vertices: []\n    indices: \n    edges: []\n    weights: []\n  spritePackingTag: \n  pSDRemoveMatte: 0\n  pSDShowRemoveMatteOption: 0\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "src/Entitas.Unity.Editor/Images/EntitasSystemsHierarchyIcon.png.meta",
    "content": "fileFormatVersion: 2\nguid: 0ee737a83aa9b4b56b2058b2b651ff0a\nlabels:\n- EntitasSystemsHierarchyIcon\nTextureImporter:\n  fileIDToRecycleName: {}\n  externalObjects: {}\n  serializedVersion: 7\n  mipmaps:\n    mipMapMode: 0\n    enableMipMap: 0\n    sRGBTexture: 0\n    linearTexture: 0\n    fadeOut: 0\n    borderMipMap: 0\n    mipMapsPreserveCoverage: 0\n    alphaTestReferenceValue: 0.5\n    mipMapFadeDistanceStart: 1\n    mipMapFadeDistanceEnd: 3\n  bumpmap:\n    convertToNormalMap: 0\n    externalNormalMap: 0\n    heightScale: 0.25\n    normalMapFilter: 0\n  isReadable: 0\n  streamingMipmaps: 0\n  streamingMipmapsPriority: 0\n  grayScaleToAlpha: 0\n  generateCubemap: 6\n  cubemapConvolution: 0\n  seamlessCubemap: 0\n  textureFormat: -3\n  maxTextureSize: 256\n  textureSettings:\n    serializedVersion: 2\n    filterMode: 0\n    aniso: -1\n    mipBias: -100\n    wrapU: 0\n    wrapV: 0\n    wrapW: 0\n  nPOTScale: 1\n  lightmap: 0\n  compressionQuality: 50\n  spriteMode: 0\n  spriteExtrude: 1\n  spriteMeshType: 1\n  alignment: 0\n  spritePivot: {x: 0.5, y: 0.5}\n  spritePixelsToUnits: 100\n  spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n  spriteGenerateFallbackPhysicsShape: 1\n  alphaUsage: 1\n  alphaIsTransparency: 1\n  spriteTessellationDetail: -1\n  textureType: 0\n  textureShape: 1\n  singleChannelComponent: 0\n  maxTextureSizeSet: 0\n  compressionQualitySet: 0\n  textureFormatSet: 0\n  platformSettings:\n  - serializedVersion: 2\n    buildTarget: DefaultTexturePlatform\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Standalone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: iPhone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Android\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  spriteSheet:\n    serializedVersion: 2\n    sprites: []\n    outline: []\n    physicsShape: []\n    bones: []\n    spriteID: \n    vertices: []\n    indices: \n    edges: []\n    weights: []\n  spritePackingTag: \n  pSDRemoveMatte: 0\n  pSDShowRemoveMatteOption: 0\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "src/Entitas.Unity.Editor/Images/EntitasSystemsWarnHierarchyIcon.png.meta",
    "content": "fileFormatVersion: 2\nguid: 8fecc08fe51ec4ba990bfd58e4ed14b5\nlabels:\n- EntitasSystemsWarnHierarchyIcon\nTextureImporter:\n  fileIDToRecycleName: {}\n  externalObjects: {}\n  serializedVersion: 7\n  mipmaps:\n    mipMapMode: 0\n    enableMipMap: 0\n    sRGBTexture: 0\n    linearTexture: 0\n    fadeOut: 0\n    borderMipMap: 0\n    mipMapsPreserveCoverage: 0\n    alphaTestReferenceValue: 0.5\n    mipMapFadeDistanceStart: 1\n    mipMapFadeDistanceEnd: 3\n  bumpmap:\n    convertToNormalMap: 0\n    externalNormalMap: 0\n    heightScale: 0.25\n    normalMapFilter: 0\n  isReadable: 0\n  streamingMipmaps: 0\n  streamingMipmapsPriority: 0\n  grayScaleToAlpha: 0\n  generateCubemap: 6\n  cubemapConvolution: 0\n  seamlessCubemap: 0\n  textureFormat: 1\n  maxTextureSize: 2048\n  textureSettings:\n    serializedVersion: 2\n    filterMode: 0\n    aniso: -1\n    mipBias: -100\n    wrapU: 0\n    wrapV: 0\n    wrapW: 0\n  nPOTScale: 1\n  lightmap: 0\n  compressionQuality: 50\n  spriteMode: 0\n  spriteExtrude: 1\n  spriteMeshType: 1\n  alignment: 0\n  spritePivot: {x: 0.5, y: 0.5}\n  spritePixelsToUnits: 100\n  spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n  spriteGenerateFallbackPhysicsShape: 1\n  alphaUsage: 1\n  alphaIsTransparency: 1\n  spriteTessellationDetail: -1\n  textureType: 0\n  textureShape: 1\n  singleChannelComponent: 0\n  maxTextureSizeSet: 0\n  compressionQualitySet: 0\n  textureFormatSet: 0\n  platformSettings:\n  - serializedVersion: 2\n    buildTarget: DefaultTexturePlatform\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Standalone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: iPhone\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  - serializedVersion: 2\n    buildTarget: Android\n    maxTextureSize: 32\n    resizeAlgorithm: 0\n    textureFormat: -1\n    textureCompression: 0\n    compressionQuality: 50\n    crunchedCompression: 0\n    allowsAlphaSplitting: 0\n    overridden: 0\n    androidETC2FallbackOverride: 0\n  spriteSheet:\n    serializedVersion: 2\n    sprites: []\n    outline: []\n    physicsShape: []\n    bones: []\n    spriteID: \n    vertices: []\n    indices: \n    edges: []\n    weights: []\n  spritePackingTag: \n  pSDRemoveMatte: 0\n  pSDShowRemoveMatteOption: 0\n  userData: \n  assetBundleName: \n  assetBundleVariant: \n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/AnimationCurveTypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    public class AnimationCurveTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(AnimationCurve);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            EditorGUILayout.CurveField(memberName, (AnimationCurve)value);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/ArrayTypeDrawer.cs",
    "content": "using System;\nusing System.Collections;\nusing DesperateDevs.Extensions;\nusing DesperateDevs.Unity.Editor;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    public class ArrayTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type.IsArray;\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target)\n        {\n            var array = (Array)value;\n            var elementType = memberType.GetElementType();\n            var indent = EditorGUI.indentLevel;\n\n            if (array.Rank == 1) array = DrawRank1(array, memberName, elementType, indent, target);\n            else if (array.Rank == 2) array = DrawRank2(array, memberName, elementType, target);\n            else if (array.Rank == 3) array = DrawRank3(array, memberName, elementType, target);\n\n            EditorGUI.indentLevel = indent;\n\n            return array;\n        }\n\n        /*\n         *\n         * Rank 1\n         *\n         */\n\n        Array DrawRank1(Array array, string memberName, Type elementType, int indent, object target)\n        {\n            var length = array.GetLength(0);\n            if (length == 0)\n                array = DrawAddElement(array, memberName, elementType);\n            else\n                EditorGUILayout.LabelField(memberName);\n\n            EditorGUI.indentLevel = indent + 1;\n\n            Func<Array> editAction = null;\n            for (var i = 0; i < length; i++)\n            {\n                var localIndex = i;\n                EditorGUILayout.BeginHorizontal();\n                {\n                    EntityDrawer.DrawObjectMember(elementType, $\"{memberName}[{localIndex}]\", array.GetValue(localIndex),\n                        target, (_, newValue) => array.SetValue(newValue, localIndex));\n\n                    var action = DrawEditActions(array, elementType, localIndex);\n                    if (action != null)\n                        editAction = action;\n                }\n                EditorGUILayout.EndHorizontal();\n            }\n\n            if (editAction != null)\n                array = editAction();\n\n            return array;\n        }\n\n        Array DrawAddElement(Array array, string memberName, Type elementType)\n        {\n            EditorGUILayout.BeginHorizontal();\n            {\n                EditorGUILayout.LabelField(memberName, \"empty\");\n                if (EditorLayout.MiniButton($\"add {elementType.ToCompilableString().TypeName()}\"))\n                {\n                    if (EntityDrawer.CreateDefault(elementType, out var defaultValue))\n                    {\n                        var newArray = Array.CreateInstance(elementType, 1);\n                        newArray.SetValue(defaultValue, 0);\n                        array = newArray;\n                    }\n                }\n            }\n            EditorGUILayout.EndHorizontal();\n\n            return array;\n        }\n\n        /*\n         *\n         * Rank 2\n         *\n         */\n\n        Array DrawRank2(Array array, string memberName, Type elementType, object target)\n        {\n            EditorGUILayout.LabelField(memberName);\n\n            for (var i = 0; i < array.GetLength(0); i++)\n            {\n                var localIndex1 = i;\n                for (var j = 0; j < array.GetLength(1); j++)\n                {\n                    var localIndex2 = j;\n                    EntityDrawer.DrawObjectMember(elementType, $\"{memberName}[{localIndex1}, {localIndex2}]\", array.GetValue(localIndex1, localIndex2),\n                        target, (_, newValue) => array.SetValue(newValue, localIndex1, localIndex2));\n                }\n\n                EditorGUILayout.Space();\n            }\n\n            return array;\n        }\n\n        /*\n         *\n         * Rank 3\n         *\n         */\n\n        Array DrawRank3(Array array, string memberName, Type elementType, object target)\n        {\n            EditorGUILayout.LabelField(memberName);\n\n            for (var i = 0; i < array.GetLength(0); i++)\n            {\n                var localIndex1 = i;\n                for (var j = 0; j < array.GetLength(1); j++)\n                {\n                    var localIndex2 = j;\n                    for (var k = 0; k < array.GetLength(2); k++)\n                    {\n                        var localIndex3 = k;\n                        EntityDrawer.DrawObjectMember(elementType, $\"{memberName}[{localIndex1}, {localIndex2}, {localIndex3}]\", array.GetValue(localIndex1, localIndex2, localIndex3),\n                            target, (_, newValue) => array.SetValue(newValue, localIndex1, localIndex2, localIndex3));\n                    }\n\n                    EditorGUILayout.Space();\n                }\n\n                EditorGUILayout.Space();\n            }\n\n            return array;\n        }\n\n        static Func<Array> DrawEditActions(Array array, Type elementType, int index)\n        {\n            if (EditorLayout.MiniButtonLeft(\"↑\"))\n            {\n                if (index > 0)\n                {\n                    return () =>\n                    {\n                        var otherIndex = index - 1;\n                        var other = array.GetValue(otherIndex);\n                        array.SetValue(array.GetValue(index), otherIndex);\n                        array.SetValue(other, index);\n                        return array;\n                    };\n                }\n            }\n\n            if (EditorLayout.MiniButtonMid(\"↓\"))\n            {\n                if (index < array.Length - 1)\n                {\n                    return () =>\n                    {\n                        var otherIndex = index + 1;\n                        var other = array.GetValue(otherIndex);\n                        array.SetValue(array.GetValue(index), otherIndex);\n                        array.SetValue(other, index);\n                        return array;\n                    };\n                }\n            }\n\n            if (EditorLayout.MiniButtonMid(\"+\"))\n                if (EntityDrawer.CreateDefault(elementType, out var defaultValue))\n                    return () => ArrayInsertAt(array, elementType, defaultValue, index + 1);\n\n            if (EditorLayout.MiniButtonRight(\"-\"))\n                return () => ArrayRemoveAt(array, elementType, index);\n\n            return null;\n        }\n\n        static Array ArrayRemoveAt(Array array, Type elementType, int removeAt)\n        {\n            var arrayList = new ArrayList(array);\n            arrayList.RemoveAt(removeAt);\n            return arrayList.ToArray(elementType);\n        }\n\n        static Array ArrayInsertAt(Array array, Type elementType, object value, int insertAt)\n        {\n            var arrayList = new ArrayList(array);\n            arrayList.Insert(insertAt, value);\n            return arrayList.ToArray(elementType);\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/BoolTypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    public class BoolTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(bool);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            EditorGUILayout.Toggle(memberName, (bool)value);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/BoundsTypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    public class BoundsTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(Bounds);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            EditorGUILayout.BoundsField(memberName, (Bounds)value);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/CharTypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    public class CharTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(char);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target)\n        {\n            var str = EditorGUILayout.TextField(memberName, ((char)value).ToString());\n            return str.Length > 0\n                ? str[0]\n                : default;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/ColorTypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    public class ColorTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(Color);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            EditorGUILayout.ColorField(memberName, (Color)value);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/DateTimeTypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    public class DateTimeTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(DateTime);\n\n        // Note: This is a very basic implementation. The ToString() method conversion will cut off milliseconds.\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target)\n        {\n            var dateString = value.ToString();\n            var newDateString = EditorGUILayout.TextField(memberName, dateString);\n            return newDateString != dateString\n                ? DateTime.Parse(newDateString)\n                : value;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/DictionaryTypeDrawer.cs",
    "content": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing DesperateDevs.Extensions;\nusing DesperateDevs.Unity.Editor;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    public class DictionaryTypeDrawer : ITypeDrawer\n    {\n        static readonly Dictionary<Type, string> KeySearchTexts = new Dictionary<Type, string>();\n\n        public bool HandlesType(Type type) => type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary<,>);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target)\n        {\n            var dictionary = (IDictionary)value;\n            var keyType = memberType.GetGenericArguments()[0];\n            var valueType = memberType.GetGenericArguments()[1];\n            var targetType = target.GetType();\n            KeySearchTexts.TryAdd(targetType, string.Empty);\n\n            EditorGUILayout.BeginHorizontal();\n            {\n                if (dictionary.Count == 0)\n                {\n                    EditorGUILayout.LabelField(memberName, \"empty\");\n                    KeySearchTexts[targetType] = string.Empty;\n                }\n                else\n                {\n                    EditorGUILayout.LabelField(memberName);\n                }\n\n                var keyTypeName = keyType.ToCompilableString().TypeName();\n                var valueTypeName = valueType.ToCompilableString().TypeName();\n                if (EditorLayout.MiniButton($\"new <{keyTypeName}, {valueTypeName}>\"))\n                    if (EntityDrawer.CreateDefault(keyType, out var defaultKey))\n                        if (EntityDrawer.CreateDefault(valueType, out var defaultValue))\n                            dictionary[defaultKey] = defaultValue;\n            }\n            EditorGUILayout.EndHorizontal();\n\n            if (dictionary.Count > 0)\n            {\n                var indent = EditorGUI.indentLevel;\n                EditorGUI.indentLevel = indent + 1;\n\n                if (dictionary.Count > 5)\n                {\n                    EditorGUILayout.Space();\n                    KeySearchTexts[targetType] = EditorLayout.SearchTextField(KeySearchTexts[targetType]);\n                }\n\n                EditorGUILayout.Space();\n\n                var keys = new ArrayList(dictionary.Keys);\n                for (var i = 0; i < keys.Count; i++)\n                {\n                    var key = keys[i];\n                    if (EditorLayout.MatchesSearchString(key.ToString().ToLower(), KeySearchTexts[targetType].ToLower()))\n                    {\n                        EntityDrawer.DrawObjectMember(keyType, \"key\", key,\n                            target, (_, newValue) =>\n                            {\n                                var tmpValue = dictionary[key];\n                                dictionary.Remove(key);\n                                if (newValue != null)\n                                {\n                                    dictionary[newValue] = tmpValue;\n                                }\n                            });\n\n                        EntityDrawer.DrawObjectMember(valueType, \"value\", dictionary[key],\n                            target, (_, newValue) => dictionary[key] = newValue);\n\n                        EditorGUILayout.Space();\n                    }\n                }\n\n                EditorGUI.indentLevel = indent;\n            }\n\n            return dictionary;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/DoubleTypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    public class DoubleTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(double);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            EditorGUILayout.DoubleField(memberName, (double)value);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/EnumTypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    public class EnumTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type.IsEnum;\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            memberType.IsDefined(typeof(FlagsAttribute), false)\n                ? EditorGUILayout.EnumFlagsField(memberName, (Enum)value)\n                : EditorGUILayout.EnumPopup(memberName, (Enum)value);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/FloatTypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    public class FloatTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(float);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            EditorGUILayout.FloatField(memberName, (float)value);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/HashSetTypeDrawer.cs",
    "content": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing DesperateDevs.Extensions;\nusing DesperateDevs.Unity.Editor;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    public class HashSetTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type.IsGenericType && type.GetGenericTypeDefinition() == typeof(HashSet<>);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target)\n        {\n            var elementType = memberType.GetGenericArguments()[0];\n            var itemsToRemove = new ArrayList();\n            var itemsToAdd = new ArrayList();\n            var isEmpty = !((IEnumerable)value).GetEnumerator().MoveNext();\n\n            EditorGUILayout.BeginHorizontal();\n            {\n                if (isEmpty)\n                    EditorGUILayout.LabelField(memberName, \"empty\");\n                else\n                    EditorGUILayout.LabelField(memberName);\n\n                if (EditorLayout.MiniButton($\"new {elementType.ToCompilableString().TypeName()}\"))\n                    if (EntityDrawer.CreateDefault(elementType, out var defaultValue))\n                        itemsToAdd.Add(defaultValue);\n            }\n            EditorGUILayout.EndHorizontal();\n\n            if (!isEmpty)\n            {\n                EditorGUILayout.Space();\n                var indent = EditorGUI.indentLevel;\n                EditorGUI.indentLevel = indent + 1;\n                foreach (var item in (IEnumerable)value)\n                {\n                    EditorGUILayout.BeginHorizontal();\n                    {\n                        EntityDrawer.DrawObjectMember(elementType, string.Empty, item,\n                            target, (_, newValue) =>\n                            {\n                                itemsToRemove.Add(item);\n                                itemsToAdd.Add(newValue);\n                            });\n\n                        if (EditorLayout.MiniButton(\"-\"))\n                            itemsToRemove.Add(item);\n                    }\n                    EditorGUILayout.EndHorizontal();\n                }\n\n                EditorGUI.indentLevel = indent;\n            }\n\n            var removeMethod = memberType.GetMethod(\"Remove\")!;\n            foreach (var item in itemsToRemove)\n                removeMethod.Invoke(value, new[] { item });\n\n            var addMethod = memberType.GetMethod(\"Add\")!;\n            foreach (var item in itemsToAdd)\n                addMethod.Invoke(value, new[] { item });\n\n            return value;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/ITypeDrawer.cs",
    "content": "﻿using System;\n\nnamespace Entitas.Unity.Editor\n{\n    public interface ITypeDrawer\n    {\n        bool HandlesType(Type type);\n\n        object DrawAndGetNewValue(Type memberType, string memberName, object value, object target);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/IntTypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    public class IntTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(int);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            EditorGUILayout.IntField(memberName, (int)value);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/ListTypeDrawer.cs",
    "content": "using System;\nusing System.Collections;\nusing System.Linq;\nusing DesperateDevs.Extensions;\nusing DesperateDevs.Unity.Editor;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    public class ListTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type.GetInterfaces().Contains(typeof(IList));\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target)\n        {\n            var list = (IList)value;\n            var elementType = memberType.GetGenericArguments()[0];\n            if (list.Count == 0)\n                list = DrawAddElement(list, memberName, elementType);\n            else\n                EditorGUILayout.LabelField(memberName);\n\n            var indent = EditorGUI.indentLevel;\n            EditorGUI.indentLevel = indent + 1;\n            Func<IList> editAction = null;\n            for (var i = 0; i < list.Count; i++)\n            {\n                var localIndex = i;\n                EditorGUILayout.BeginHorizontal();\n                {\n                    EntityDrawer.DrawObjectMember(elementType, $\"{memberName}[{localIndex}]\", list[localIndex],\n                        target, (_, newValue) => list[localIndex] = newValue);\n\n                    var action = DrawEditActions(list, elementType, localIndex);\n                    if (action != null)\n                        editAction = action;\n                }\n                EditorGUILayout.EndHorizontal();\n            }\n\n            if (editAction != null)\n                list = editAction();\n\n            EditorGUI.indentLevel = indent;\n\n            return list;\n        }\n\n        static Func<IList> DrawEditActions(IList list, Type elementType, int index)\n        {\n            if (EditorLayout.MiniButtonLeft(\"↑\"))\n                if (index > 0)\n                    return () =>\n                    {\n                        var otherIndex = index - 1;\n                        var other = list[otherIndex];\n                        list[otherIndex] = list[index];\n                        list[index] = other;\n                        return list;\n                    };\n\n            if (EditorLayout.MiniButtonMid(\"↓\"))\n                if (index < list.Count - 1)\n                    return () =>\n                    {\n                        var otherIndex = index + 1;\n                        var other = list[otherIndex];\n                        list[otherIndex] = list[index];\n                        list[index] = other;\n                        return list;\n                    };\n\n            if (EditorLayout.MiniButtonMid(\"+\"))\n            {\n                if (EntityDrawer.CreateDefault(elementType, out var defaultValue))\n                {\n                    var insertAt = index + 1;\n                    return () =>\n                    {\n                        list.Insert(insertAt, defaultValue);\n                        return list;\n                    };\n                }\n            }\n\n            if (EditorLayout.MiniButtonRight(\"-\"))\n            {\n                var removeAt = index;\n                return () =>\n                {\n                    list.RemoveAt(removeAt);\n                    return list;\n                };\n            }\n\n            return null;\n        }\n\n        IList DrawAddElement(IList list, string memberName, Type elementType)\n        {\n            EditorGUILayout.BeginHorizontal();\n            {\n                EditorGUILayout.LabelField(memberName, \"empty\");\n                if (EditorLayout.MiniButton($\"add {elementType.ToCompilableString().TypeName()}\"))\n                    if (EntityDrawer.CreateDefault(elementType, out var defaultValue))\n                        list.Add(defaultValue);\n            }\n            EditorGUILayout.EndHorizontal();\n\n            return list;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/RectTypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    public class RectTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(Rect);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            EditorGUILayout.RectField(memberName, (Rect)value);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/StringTypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    public class StringTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(string);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            EditorGUILayout.DelayedTextField(memberName, (string)value);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/UnityObjectTypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\n\nnamespace Entitas.Unity.Editor\n{\n    public class UnityObjectTypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) =>\n            type == typeof(UnityEngine.Object) ||\n            type.IsSubclassOf(typeof(UnityEngine.Object));\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            EditorGUILayout.ObjectField(memberName, (UnityEngine.Object)value, memberType, true);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/Vector2TypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    public class Vector2TypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(Vector2);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            EditorGUILayout.Vector2Field(memberName, (Vector2)value);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/Vector3TypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    public class Vector3TypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(Vector3);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            EditorGUILayout.Vector3Field(memberName, (Vector3)value);\n    }\n}\n"
  },
  {
    "path": "src/Entitas.Unity.Editor/TypeDrawer/Vector4TypeDrawer.cs",
    "content": "using System;\nusing UnityEditor;\nusing UnityEngine;\n\nnamespace Entitas.Unity.Editor\n{\n    public class Vector4TypeDrawer : ITypeDrawer\n    {\n        public bool HandlesType(Type type) => type == typeof(Vector4);\n\n        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target) =>\n            EditorGUILayout.Vector4Field(memberName, (Vector4)value);\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/AnyFlagComponentAddedTests.cs",
    "content": "using FluentAssertions;\nusing MyApp;\nusing MyFeature;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class AnyFlagComponentAddedTests\n    {\n        readonly MainContext _context;\n        readonly AnyLoadingAddedListener _listener;\n        readonly MyAppMainAnyLoadingAddedEventSystem _system;\n\n        public AnyFlagComponentAddedTests()\n        {\n            ContextInitialization.InitializeMain();\n            _context = new MainContext();\n            _listener = new AnyLoadingAddedListener(_context);\n            _system = new MyAppMainAnyLoadingAddedEventSystem(_context);\n        }\n\n        [Fact]\n        public void IsNullWhenNothingChanged()\n        {\n            _system.Execute();\n            _listener.Entity.Should().BeNull();\n        }\n\n        [Fact]\n        public void PassesEntityWhenAdded()\n        {\n            var entity = _context.CreateEntity().AddLoading();\n            _system.Execute();\n            _listener.Entity.Should().BeSameAs(entity);\n        }\n\n        [Fact]\n        public void SkipsWhenTriggeringComponentHasBeenRemoved()\n        {\n            _context\n                .CreateEntity()\n                .AddLoading()\n                .RemoveLoading();\n\n            _system.Execute();\n            _listener.Entity.Should().BeNull();\n        }\n\n        [Fact]\n        public void CanUnsubscribeInCallback()\n        {\n            _listener.Unsubscribe = true;\n            var entity = _context.CreateEntity().AddLoading();\n            _system.Execute();\n            _listener.Entity.Should().BeSameAs(entity);\n        }\n\n        [Fact]\n        public void CanDestroyListenerEntityInCallback()\n        {\n            _listener.DestroyListener = true;\n            var entity = _context.CreateEntity().AddLoading();\n            var dummy = new AnyLoadingAddedListener(_context)\n            {\n                DestroyListener = true\n            };\n            _system.Execute();\n            _listener.Entity.Should().BeSameAs(entity);\n        }\n    }\n\n#nullable disable\n\n    public class AnyLoadingAddedListener : IMyAppMainAnyLoadingAddedListener\n    {\n        readonly MyApp.Main.Entity _listener;\n\n        public AnyLoadingAddedListener(MainContext context)\n        {\n            _listener = context.CreateEntity().AddAnyLoadingAddedListener(this);\n        }\n\n        public Entity Entity { get; private set; }\n        public bool Unsubscribe { get; set; }\n        public bool DestroyListener { get; set; }\n\n        public void OnAnyLoadingAdded(MyApp.Main.Entity entity)\n        {\n            Entity = entity;\n            if (Unsubscribe)\n            {\n                _listener.RemoveAnyLoadingAddedListener(this);\n            }\n\n            if (DestroyListener)\n            {\n                _listener.Destroy();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/AnyFlagComponentRemovedTests.cs",
    "content": "using FluentAssertions;\nusing MyApp;\nusing MyFeature;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class AnyFlagComponentRemovedTests\n    {\n        readonly MainContext _context;\n        readonly AnyLoadingRemovedListener _listener;\n        readonly MyAppMainAnyLoadingRemovedEventSystem _system;\n\n        public AnyFlagComponentRemovedTests()\n        {\n            ContextInitialization.InitializeMain();\n            _context = new MainContext();\n            _listener = new AnyLoadingRemovedListener(_context);\n            _system = new MyAppMainAnyLoadingRemovedEventSystem(_context);\n        }\n\n        [Fact]\n        public void IsNullWhenNothingChanged()\n        {\n            _context.CreateEntity().AddLoading();\n            _system.Execute();\n            _listener.Entity.Should().BeNull();\n        }\n\n        [Fact]\n        public void PassesEntityWhenRemoved()\n        {\n            var entity = _context.CreateEntity().AddLoading();\n            _system.Execute();\n            _listener.Entity.Should().BeNull();\n\n            entity.RemoveLoading();\n            _system.Execute();\n            _listener.Entity.Should().BeSameAs(entity);\n        }\n\n        [Fact]\n        public void SkipsWhenTriggeringComponentHasBeenAdded()\n        {\n            _context\n                .CreateEntity()\n                .AddLoading()\n                .RemoveLoading()\n                .AddLoading();\n\n            _system.Execute();\n            _listener.Entity.Should().BeNull();\n        }\n\n        [Fact]\n        public void CanUnsubscribeInCallback()\n        {\n            _listener.Unsubscribe = true;\n            var entity = _context\n                .CreateEntity()\n                .AddLoading()\n                .RemoveLoading();\n\n            _system.Execute();\n            _listener.Entity.Should().BeSameAs(entity);\n        }\n\n        [Fact]\n        public void CanDestroyListenerEntityInCallback()\n        {\n            _listener.DestroyListener = true;\n            var entity = _context\n                .CreateEntity()\n                .AddLoading()\n                .RemoveLoading();\n\n            var dummy = new AnyLoadingRemovedListener(_context)\n            {\n                DestroyListener = true\n            };\n\n            _system.Execute();\n            _listener.Entity.Should().BeSameAs(entity);\n        }\n    }\n\n#nullable disable\n\n    public class AnyLoadingRemovedListener : IMyAppMainAnyLoadingRemovedListener\n    {\n        readonly MyApp.Main.Entity _listener;\n\n        public AnyLoadingRemovedListener(MainContext context)\n        {\n            _listener = context.CreateEntity().AddAnyLoadingRemovedListener(this);\n        }\n\n        public Entity Entity { get; private set; }\n        public bool Unsubscribe { get; set; }\n        public bool DestroyListener { get; set; }\n\n        public void OnAnyLoadingRemoved(MyApp.Main.Entity entity)\n        {\n            Entity = entity;\n            if (Unsubscribe)\n            {\n                _listener.RemoveAnyLoadingRemovedListener(this);\n            }\n\n            if (DestroyListener)\n            {\n                _listener.Destroy();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/CleanupSystemTests.cs",
    "content": "using FluentAssertions;\nusing MyApp;\nusing MyFeature;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class CleanupSystemTests\n    {\n        readonly MainContext _context;\n\n        public CleanupSystemTests()\n        {\n            ContextInitialization.InitializeMain();\n            _context = new MainContext();\n        }\n\n        [Fact]\n        public void RemovesComponent()\n        {\n            var system = new RemoveMyAppMainUserCleanupSystem(_context);\n            var entity = _context.CreateEntity().AddUser(\"Test\", 42);\n            system.Cleanup();\n            entity.HasUser().Should().BeFalse();\n            entity.IsEnabled.Should().BeTrue();\n        }\n\n        [Fact]\n        public void DestroysEntity()\n        {\n            var system = new DestroyMyAppMainLoadingCleanupSystem(_context);\n            var entity = _context.CreateEntity().AddLoading();\n            system.Cleanup();\n            entity.HasLoading().Should().BeFalse();\n            entity.IsEnabled.Should().BeFalse();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/CleanupSystemsTests.cs",
    "content": "using FluentAssertions;\nusing MyApp;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class CleanupSystemsTests\n    {\n        [Fact]\n        public void GeneratesCleanupSystems()\n        {\n            ContextInitialization.InitializeMain();\n            new MainContext().CreateCleanupSystems().Should().NotBeNull();\n        }\n\n        [Fact]\n        public void GeneratesEmptyCleanupSystems()\n        {\n            ContextInitialization.InitializeEmpty();\n            new EmptyContext().CreateCleanupSystems().Should().BeNull();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/ComponentIndexTests.cs",
    "content": "using FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class ComponentIndexTests\n    {\n        [Fact]\n        public void GeneratesComponentIndex()\n        {\n            new MyApp.Main.ComponentIndex(1).Value.Should().Be(1);\n        }\n\n        [Fact]\n        public void EqualsComponentIndexWithSameIndex()\n        {\n            new MyApp.Main.ComponentIndex(1).Equals(new MyApp.Main.ComponentIndex(1)).Should().BeTrue();\n        }\n\n        [Fact]\n        public void DoesNotEqualComponentIndexWithDifferentIndex()\n        {\n            new MyApp.Main.ComponentIndex(1).Equals(new MyApp.Main.ComponentIndex(2)).Should().BeFalse();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/ContextExtensionTests.cs",
    "content": "using System;\nusing FluentAssertions;\nusing MyApp;\nusing MyFeature;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class ContextExtensionTests\n    {\n        readonly MainContext _context;\n\n        public ContextExtensionTests()\n        {\n            ContextInitialization.InitializeMain();\n            _context = new MainContext();\n        }\n\n        /*\n         * Flag Component\n         */\n\n        [Fact]\n        public void DoesNotHaveFlagComponent()\n        {\n            _context.HasLoading().Should().BeFalse();\n        }\n\n        [Fact]\n        public void SetsFlagComponent()\n        {\n            _context\n                .SetLoading()\n                .HasLoading()\n                .Should().BeTrue();\n        }\n\n        [Fact]\n        public void HasFlagComponent()\n        {\n            _context.SetLoading();\n            _context\n                .HasLoading()\n                .Should().BeTrue();\n        }\n\n        [Fact]\n        public void CanSetFlagComponentTwice()\n        {\n            _context.SetLoading();\n            _context.SetLoading();\n            _context.HasLoading().Should().BeTrue();\n        }\n\n        [Fact]\n        public void SetFlagComponentReturnsSameEntity()\n        {\n            _context.SetLoading().Should().BeSameAs(_context.SetLoading());\n        }\n\n        [Fact]\n        public void UnsetsAndDestroysFlagComponent()\n        {\n            var entity = _context.SetLoading();\n            _context.UnsetLoading();\n            _context.HasLoading().Should().BeFalse();\n            entity.IsEnabled.Should().BeFalse();\n        }\n\n        [Fact]\n        public void CanUnsetFlagComponentTwice()\n        {\n            _context.SetLoading();\n            _context.UnsetLoading();\n            _context.UnsetLoading();\n            _context.HasLoading().Should().BeFalse();\n        }\n\n        [Fact]\n        public void GetsFlagComponent()\n        {\n            _context.SetLoading();\n            var entity = _context.GetLoadingEntity();\n            entity.Should().NotBeNull();\n            entity.HasLoading().Should().BeTrue();\n        }\n\n        [Fact]\n        public void GettingUnsetFlagEntityReturnsNull()\n        {\n            _context.GetLoadingEntity().Should().BeNull();\n        }\n\n        /*\n         * Normal Component\n         */\n\n        [Fact]\n        public void DoesNotHaveComponent()\n        {\n            _context.HasUser().Should().BeFalse();\n        }\n\n        [Fact]\n        public void SetsComponent()\n        {\n            var component = _context\n                .SetUser(\"Test\", 42)\n                .GetUser();\n\n            component.Name.Should().Be(\"Test\");\n            component.Age.Should().Be(42);\n        }\n\n        [Fact]\n        public void ThrowsWhenSettingComponentTwice()\n        {\n            _context.SetUser(\"Test\", 42);\n            FluentActions.Invoking(() => _context.SetUser(\"Test\", 42))\n                .Should().Throw<EntitasException>();\n        }\n\n        [Fact]\n        public void HasComponent()\n        {\n            _context.SetUser(\"Test\", 42);\n            _context\n                .HasUser()\n                .Should().BeTrue();\n        }\n\n        [Fact]\n        public void GetsComponent()\n        {\n            _context.SetUser(\"Test\", 42);\n            var component = _context.GetUser();\n            component.Name.Should().Be(\"Test\");\n            component.Age.Should().Be(42);\n        }\n\n        [Fact]\n        public void ThrowsWhenGettingComponentWhenNotSet()\n        {\n            FluentActions.Invoking(() => _context.GetUser())\n                .Should().Throw<NullReferenceException>();\n        }\n\n        [Fact]\n        public void ReplacesComponent()\n        {\n            _context.SetUser(\"Test\", 42);\n            var component = _context\n                .ReplaceUser(\"Replaced\", 24)\n                .GetUser();\n\n            component.Name.Should().Be(\"Replaced\");\n            component.Age.Should().Be(24);\n        }\n\n        [Fact]\n        public void ReplaceComponentAddsComponent()\n        {\n            _context.ReplaceUser(\"Test\", 42);\n            var component = _context.GetUser();\n            component.Name.Should().Be(\"Test\");\n            component.Age.Should().Be(42);\n        }\n\n        [Fact]\n        public void RemovesAndDestroysComponent()\n        {\n            var entity = _context.SetUser(\"Test\", 42);\n            _context.RemoveUser();\n            _context.HasUser().Should().BeFalse();\n            entity.IsEnabled.Should().BeFalse();\n        }\n\n        [Fact]\n        public void ThrowsWhenRemovingComponentTwice()\n        {\n            _context.SetUser(\"Test\", 42);\n            _context.RemoveUser();\n            FluentActions.Invoking(() => _context.RemoveUser())\n                .Should().Throw<NullReferenceException>();\n        }\n\n        [Fact]\n        public void GettingUnsetEntityReturnsNull()\n        {\n            _context.GetUserEntity().Should().BeNull();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/ContextInitialization.cs",
    "content": "using Entitas.Generators.Attributes;\n\nnamespace MyApp\n{\n    public static partial class ContextInitialization\n    {\n        [ContextInitialization(typeof(MainContext))]\n        public static partial void InitializeMain();\n\n        [ContextInitialization(typeof(EmptyContext))]\n        public static partial void InitializeEmpty();\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/ContextTests.cs",
    "content": "using FluentAssertions;\nusing MyApp;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class ContextTests\n    {\n        public ContextTests()\n        {\n            ContextInitialization.InitializeMain();\n        }\n\n        [Fact]\n        public void GeneratesContext()\n        {\n            var context = new MainContext();\n            context.Should().NotBeNull();\n            context.Should().BeAssignableTo<Context<MyApp.Main.Entity>>();\n        }\n\n        [Fact]\n        public void CreatesEntity()\n        {\n            var context = new MainContext();\n            var entity = context.CreateEntity();\n            entity.Should().NotBeNull();\n            entity.Should().BeAssignableTo<MyApp.Main.Entity>();\n            entity.TotalComponents.Should().Be(context.TotalComponents);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/Entitas.Generators.IntegrationTests.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>$(DefaultTestTargetFramework)</TargetFramework>\n    <Nullable>enable</Nullable>\n    <IsPackable>false</IsPackable>\n    <IsPublishable>false</IsPublishable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"FluentAssertions\" Version=\"6.11.0\" />\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.6.2\" />\n    <PackageReference Include=\"xunit\" Version=\"2.4.2\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.5\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"coverlet.collector\" Version=\"6.0.0\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"../../gen/Entitas.Generators/Entitas.Generators.csproj\" OutputItemType=\"Analyzer\" ReferenceOutputAssembly=\"false\" />\n    <ProjectReference Include=\"../../src/Entitas/Entitas.csproj\" />\n    <ProjectReference Include=\"../../src/Entitas.Generators.Attributes/Entitas.Generators.Attributes.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/EntityExtensionTests.cs",
    "content": "using FluentAssertions;\nusing MyApp;\nusing MyFeature;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class EntityExtensionTests\n    {\n        readonly MainContext _context;\n\n        public EntityExtensionTests()\n        {\n            ContextInitialization.InitializeMain();\n            _context = new MainContext();\n        }\n\n        /*\n         * Flag Component\n         */\n\n        [Fact]\n        public void DoesNotHaveFlagComponent()\n        {\n            _context.CreateEntity().HasLoading().Should().BeFalse();\n        }\n\n        [Fact]\n        public void AddsFlagComponent()\n        {\n            _context\n                .CreateEntity()\n                .AddLoading()\n                .HasComponent(MyAppMainLoadingComponentIndex.Index.Value)\n                .Should().BeTrue();\n        }\n\n        [Fact]\n        public void HasFlagComponent()\n        {\n            _context.CreateEntity()\n                .AddLoading()\n                .HasLoading()\n                .Should().BeTrue();\n        }\n\n        [Fact]\n        public void GetsFlagComponent()\n        {\n            _context\n                .CreateEntity()\n                .AddLoading()\n                .GetLoading()\n                .Should().BeAssignableTo<LoadingComponent>();\n        }\n\n        [Fact]\n        public void UsesSingleComponent()\n        {\n            var component1 = _context\n                .CreateEntity()\n                .AddLoading()\n                .GetLoading();\n\n            var component2 = _context\n                .CreateEntity()\n                .AddLoading()\n                .GetLoading();\n\n            component1.Should().BeSameAs(component2);\n        }\n\n        [Fact]\n        public void ReplacesFlagComponent()\n        {\n            var entity = _context.CreateEntity();\n            var didReplace = 0;\n            entity.OnComponentReplaced += (e, index, component, newComponent) =>\n            {\n                didReplace += 1;\n                e.Should().BeSameAs(entity);\n                index.Should().Be(MyAppMainLoadingComponentIndex.Index.Value);\n                component.Should().BeSameAs(newComponent);\n            };\n\n            entity\n                .AddLoading()\n                .ReplaceLoading()\n                .HasLoading()\n                .Should().BeTrue();\n\n            didReplace.Should().Be(1);\n        }\n\n        [Fact]\n        public void RemovesFlagComponent()\n        {\n            _context\n                .CreateEntity()\n                .AddLoading()\n                .RemoveLoading()\n                .HasLoading()\n                .Should().BeFalse();\n        }\n\n        /*\n         * Normal Component\n         */\n\n        [Fact]\n        public void DoesNotHaveComponent()\n        {\n            _context.CreateEntity().HasUser().Should().BeFalse();\n        }\n\n        [Fact]\n        public void AddsComponent()\n        {\n            _context\n                .CreateEntity()\n                .AddUser(\"Test\", 42)\n                .HasComponent(MyAppMainUserComponentIndex.Index.Value)\n                .Should().BeTrue();\n        }\n\n        [Fact]\n        public void HasComponent()\n        {\n            _context.CreateEntity()\n                .AddUser(\"Test\", 42)\n                .HasUser()\n                .Should().BeTrue();\n        }\n\n        [Fact]\n        public void GetsComponent()\n        {\n            var component = _context\n                .CreateEntity()\n                .AddUser(\"Test\", 42)\n                .GetUser();\n\n            component.Name.Should().Be(\"Test\");\n            component.Age.Should().Be(42);\n        }\n\n        [Fact]\n        public void ReplacesComponent()\n        {\n            var component = _context\n                .CreateEntity()\n                .AddUser(\"Test\", 42)\n                .ReplaceUser(\"Replaced\", 24)\n                .GetUser();\n\n            component.Name.Should().Be(\"Replaced\");\n            component.Age.Should().Be(24);\n        }\n\n        [Fact]\n        public void AddComponentUsesComponentPool()\n        {\n            var component = new UserComponent { Name = \"Pooled\", Age = 24 };\n            var entity = _context.CreateEntity();\n\n            entity\n                .GetComponentPool(MyAppMainUserComponentIndex.Index.Value)\n                .Push(component);\n\n            entity\n                .AddUser(\"Test\", 42)\n                .GetUser()\n                .Should().BeSameAs(component);\n        }\n\n        [Fact]\n        public void ReplaceComponentUsesComponentPool()\n        {\n            var component = new UserComponent { Name = \"Pooled\", Age = 24 };\n            var entity = _context.CreateEntity();\n\n            entity\n                .GetComponentPool(MyAppMainUserComponentIndex.Index.Value)\n                .Push(component);\n\n            entity\n                .ReplaceUser(\"Test\", 42)\n                .GetUser()\n                .Should().BeSameAs(component);\n        }\n\n        [Fact]\n        public void RemovesComponent()\n        {\n            _context\n                .CreateEntity()\n                .AddUser(\"Test\", 42)\n                .RemoveUser()\n                .HasUser()\n                .Should().BeFalse();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/EntityIndexExtensionTests.cs",
    "content": "using FluentAssertions;\nusing MyApp;\nusing MyFeature;\nusing Xunit;\nusing static MyApp.MainContextEntityIndexExtension;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class EntityIndexExtensionTests\n    {\n        readonly MainContext _context;\n\n        public EntityIndexExtensionTests()\n        {\n            ContextInitialization.InitializeMain();\n            _context = new MainContext();\n            _context.AddAllEntityIndexes();\n        }\n\n        [Fact]\n        public void AddsAllEntityIndexes()\n        {\n            _context.GetEntityIndex(MyFeatureUserName).Should().BeAssignableTo<PrimaryEntityIndex<MyApp.Main.Entity, string>>();\n            _context.GetEntityIndex(MyFeatureUserAge).Should().BeAssignableTo<EntityIndex<MyApp.Main.Entity, int>>();\n        }\n\n        [Fact]\n        public void GetsEntity()\n        {\n            var user = _context.CreateEntity().AddUser(\"Test\", 42);\n            var entity = _context.GetEntityWithUserName(\"Test\");\n\n            entity.Should().BeSameAs(user);\n        }\n\n        [Fact]\n        public void GetsEntities()\n        {\n            var user1 = _context.CreateEntity().AddUser(\"Test1\", 42);\n            var user2 = _context.CreateEntity().AddUser(\"Test2\", 42);\n            var entities = _context.GetEntitiesWithUserAge(42);\n\n            entities.Should().HaveCount(2);\n            entities.Should().Contain(user1);\n            entities.Should().Contain(user2);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/EntityIndexTests.cs",
    "content": "using MyApp;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class EntityIndexTests\n    {\n        [Fact]\n        public void GeneratesEventSystems()\n        {\n            ContextInitialization.InitializeMain();\n            new MainContext().AddAllEntityIndexes();\n        }\n\n        [Fact]\n        public void GeneratesEmptyEventSystems()\n        {\n            ContextInitialization.InitializeEmpty();\n            new EmptyContext().AddAllEntityIndexes();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/EntityTests.cs",
    "content": "using FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class EntityTests\n    {\n        [Fact]\n        public void GeneratesEntity()\n        {\n            var entity = new MyApp.Main.Entity();\n            entity.Should().NotBeNull();\n            entity.Should().BeAssignableTo<Entity>();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/EventSystemsTests.cs",
    "content": "using FluentAssertions;\nusing MyApp;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class EventSystemsTests\n    {\n        [Fact]\n        public void GeneratesEventSystems()\n        {\n            ContextInitialization.InitializeMain();\n            new MainContext().CreateEventSystems().Should().NotBeNull();\n        }\n\n        [Fact]\n        public void GeneratesEmptyEventSystems()\n        {\n            ContextInitialization.InitializeEmpty();\n            new EmptyContext().CreateEventSystems().Should().BeNull();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/FlagComponentAddedTests.cs",
    "content": "using FluentAssertions;\nusing MyApp;\nusing MyFeature;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class FlagComponentAddedTests\n    {\n        readonly MainContext _context;\n        readonly MyApp.Main.Entity _entity;\n        readonly LoadingAddedListener _listener;\n        readonly MyAppMainLoadingAddedEventSystem _system;\n\n        public FlagComponentAddedTests()\n        {\n            ContextInitialization.InitializeMain();\n            _context = new MainContext();\n            _entity = _context.CreateEntity();\n            _listener = new LoadingAddedListener(_entity);\n            _system = new MyAppMainLoadingAddedEventSystem(_context);\n        }\n\n        [Fact]\n        public void IsNullWhenNothingChanged()\n        {\n            _system.Execute();\n            _listener.Entity.Should().BeNull();\n        }\n\n        [Fact]\n        public void PassesEntityWhenAddedOnSameEntity()\n        {\n            _entity.AddLoading();\n            _system.Execute();\n            _listener.Entity.Should().BeSameAs(_entity);\n        }\n\n        [Fact]\n        public void DoesNotPassEntityWhenAddedOnDifferentEntity()\n        {\n            _context.CreateEntity().AddLoading();\n            _system.Execute();\n            _listener.Entity.Should().BeNull();\n        }\n\n        [Fact]\n        public void SkipsWhenTriggeringComponentHasBeenRemoved()\n        {\n            _entity\n                .AddLoading()\n                .RemoveLoading();\n\n            _system.Execute();\n            _listener.Entity.Should().BeNull();\n        }\n\n        [Fact]\n        public void CanUnsubscribeInCallback()\n        {\n            _listener.Unsubscribe = true;\n            _entity.AddLoading();\n            _system.Execute();\n            _listener.Entity.Should().BeSameAs(_entity);\n        }\n\n        [Fact]\n        public void CanDestroyListenerEntityInCallback()\n        {\n            _listener.DestroyListener = true;\n            _entity.AddLoading();\n            _system.Execute();\n            _listener.Entity.Should().BeSameAs(_entity);\n        }\n    }\n\n#nullable disable\n\n    public class LoadingAddedListener : IMyAppMainLoadingAddedListener\n    {\n        readonly MyApp.Main.Entity _listener;\n\n        public LoadingAddedListener(MyApp.Main.Entity entity)\n        {\n            _listener = entity.AddLoadingAddedListener(this);\n        }\n\n        public Entity Entity { get; private set; }\n        public bool Unsubscribe { get; set; }\n        public bool DestroyListener { get; set; }\n\n        public void OnLoadingAdded(MyApp.Main.Entity entity)\n        {\n            Entity = entity;\n            if (Unsubscribe)\n            {\n                _listener.RemoveLoadingAddedListener(this);\n            }\n\n            if (DestroyListener)\n            {\n                _listener.Destroy();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/FlagComponentRemovedTests.cs",
    "content": "using FluentAssertions;\nusing MyApp;\nusing MyFeature;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class FlagComponentRemovedTests\n    {\n        readonly MainContext _context;\n        readonly MyApp.Main.Entity _entity;\n        readonly LoadingRemovedListener _listener;\n        readonly MyAppMainLoadingRemovedEventSystem _system;\n\n        public FlagComponentRemovedTests()\n        {\n            ContextInitialization.InitializeMain();\n            _context = new MainContext();\n            _entity = _context.CreateEntity();\n            _listener = new LoadingRemovedListener(_entity);\n            _system = new MyAppMainLoadingRemovedEventSystem(_context);\n        }\n\n        [Fact]\n        public void IsNullWhenNothingChanged()\n        {\n            _entity.AddLoading();\n            _system.Execute();\n            _listener.Entity.Should().BeNull();\n        }\n\n        [Fact]\n        public void PassesEntityWhenRemovedOnSameEntity()\n        {\n            _entity.AddLoading();\n            _system.Execute();\n            _listener.Entity.Should().BeNull();\n\n            _entity.RemoveLoading();\n            _system.Execute();\n            _listener.Entity.Should().BeSameAs(_entity);\n        }\n\n        [Fact]\n        public void DoesNotPassEntityWhenRemovedOnDifferentEntity()\n        {\n            _context.CreateEntity()\n                .AddLoading()\n                .RemoveLoading();\n\n            _system.Execute();\n            _listener.Entity.Should().BeNull();\n        }\n\n        [Fact]\n        public void SkipsWhenTriggeringComponentHasBeenAdded()\n        {\n            _entity\n                .AddLoading()\n                .RemoveLoading()\n                .AddLoading();\n\n            _system.Execute();\n            _listener.Entity.Should().BeNull();\n        }\n\n        [Fact]\n        public void CanUnsubscribeInCallback()\n        {\n            _listener.Unsubscribe = true;\n            _entity\n                .AddLoading()\n                .RemoveLoading();\n\n            _system.Execute();\n            _listener.Entity.Should().BeSameAs(_entity);\n        }\n\n        [Fact]\n        public void CanDestroyListenerEntityInCallback()\n        {\n            _listener.DestroyListener = true;\n            _entity\n                .AddLoading()\n                .RemoveLoading();\n\n            _system.Execute();\n            _listener.Entity.Should().BeSameAs(_entity);\n        }\n    }\n\n#nullable disable\n\n    public class LoadingRemovedListener : IMyAppMainLoadingRemovedListener\n    {\n        readonly MyApp.Main.Entity _listener;\n\n        public LoadingRemovedListener(MyApp.Main.Entity entity)\n        {\n            _listener = entity.AddLoadingRemovedListener(this);\n        }\n\n        public Entity Entity { get; private set; }\n        public bool Unsubscribe { get; set; }\n        public bool DestroyListener { get; set; }\n\n        public void OnLoadingRemoved(MyApp.Main.Entity entity)\n        {\n            Entity = entity;\n            if (Unsubscribe)\n            {\n                _listener.RemoveLoadingRemovedListener(this);\n            }\n\n            if (DestroyListener)\n            {\n                _listener.Destroy();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/ListenerEventEntityExtensionTests.cs",
    "content": "using FluentAssertions;\nusing MyApp;\nusing MyFeature;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class ListenerEventEntityExtensionTests\n    {\n        readonly MainContext _context;\n        readonly ListenerEventEntityExtensionListener _listener;\n\n        public ListenerEventEntityExtensionTests()\n        {\n            ContextInitialization.InitializeMain();\n            _context = new MainContext();\n            _listener = new ListenerEventEntityExtensionListener(_context);\n        }\n\n        [Fact]\n        public void AddsListener()\n        {\n            var listener = _context.CreateEntity().AddAnyLoadingAddedListener(_listener);\n            listener.HasAnyLoadingAddedListener().Should().BeTrue();\n        }\n\n        [Fact]\n        public void RemovesListener()\n        {\n            var listener = _context.CreateEntity().AddAnyLoadingAddedListener(_listener);\n            listener.RemoveAnyLoadingAddedListener(_listener, false);\n            listener.GetAnyLoadingAddedListener().Value.Should().HaveCount(0);\n        }\n\n        [Fact]\n        public void RemovesListenerWhenEntityIsNotEmpty()\n        {\n            var listener = _context\n                .CreateEntity()\n                .AddLoading()\n                .AddAnyLoadingAddedListener(_listener);\n\n            listener.RemoveAnyLoadingAddedListener(_listener, true);\n            listener.HasAnyLoadingAddedListener().Should().BeFalse();\n            listener.HasLoading().Should().BeTrue();\n        }\n\n        [Fact]\n        public void DestroysListenerWhenEntityIsEmpty()\n        {\n            var listener = _context\n                .CreateEntity()\n                .AddAnyLoadingAddedListener(_listener);\n\n            listener.RemoveAnyLoadingAddedListener(_listener, true);\n            listener.HasAnyLoadingAddedListener().Should().BeFalse();\n            listener.IsEnabled.Should().BeFalse();\n        }\n    }\n\n#nullable disable\n\n    public class ListenerEventEntityExtensionListener : IMyAppMainAnyLoadingAddedListener\n    {\n        public ListenerEventEntityExtensionListener(MainContext context)\n        {\n            context.CreateEntity().AddAnyLoadingAddedListener(this);\n        }\n\n        public void OnAnyLoadingAdded(MyApp.Main.Entity entity) { }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/MatcherTests.cs",
    "content": "using FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Generators.IntegrationTests\n{\n    public class MatcherTests\n    {\n        [Fact]\n        public void GeneratesAllOfMatcher()\n        {\n            var matcher = MyApp.Main.Matcher.AllOf(1);\n            matcher.Should().BeAssignableTo<IAllOfMatcher<MyApp.Main.Entity>>();\n            matcher.Should().BeEquivalentTo(Entitas.Matcher<MyApp.Main.Entity>.AllOf(1));\n        }\n\n        [Fact]\n        public void GeneratesAnyOfMatcher()\n        {\n            var matcher = MyApp.Main.Matcher.AnyOf(1);\n            matcher.Should().BeAssignableTo<IAnyOfMatcher<MyApp.Main.Entity>>();\n            matcher.Should().BeEquivalentTo(Entitas.Matcher<MyApp.Main.Entity>.AnyOf(1));\n        }\n\n        [Fact]\n        public void GeneratesMatcherExtensions()\n        {\n            var matcher = MyApp.Main.Matcher\n                .AllOf(1)\n                .AnyOf(2)\n                .NoneOf(3);\n\n            matcher.Should().BeAssignableTo<INoneOfMatcher<MyApp.Main.Entity>>();\n\n            var entitasMatcher = Entitas.Matcher<MyApp.Main.Entity>\n                .AllOf(1)\n                .AnyOf(2)\n                .NoneOf(3);\n\n            matcher.Should().BeEquivalentTo(entitasMatcher);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/fixtures/EmptyContext.cs",
    "content": "using Entitas;\n\nnamespace MyApp\n{\n    partial class EmptyContext : IContext { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/fixtures/LoadingComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext)), Context(typeof(OtherContext))]\n    [Unique]\n    [Event(EventTarget.Any, EventType.Added, 1)]\n    [Event(EventTarget.Any, EventType.Removed, 2)]\n    [Event(EventTarget.Self, EventType.Added, 3)]\n    [Event(EventTarget.Self, EventType.Removed, 4)]\n    [Cleanup(CleanupMode.DestroyEntity)]\n    public sealed class LoadingComponent : IComponent { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/fixtures/MainContext.cs",
    "content": "using Entitas;\n\nnamespace MyApp\n{\n    partial class MainContext : IContext { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/fixtures/OtherContext.cs",
    "content": "partial class OtherContext : Entitas.IContext { }\n"
  },
  {
    "path": "tests/Entitas.Generators.IntegrationTests/fixtures/UserComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext)), Context(typeof(OtherContext))]\n    [Unique]\n    [Event(EventTarget.Any, EventType.Added, 1)]\n    [Event(EventTarget.Any, EventType.Removed, 2)]\n    [Event(EventTarget.Self, EventType.Added, 3)]\n    [Event(EventTarget.Self, EventType.Removed, 4)]\n    [Cleanup(CleanupMode.RemoveComponent)]\n    public sealed class UserComponent : IComponent\n    {\n        [EntityIndex(true)]\n        public string Name;\n\n        [EntityIndex(false)]\n        public int Age;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/ComponentGeneratorTests.cs",
    "content": "using System.Collections.Generic;\nusing System.IO;\nusing System.Threading.Tasks;\nusing VerifyXunit;\nusing Xunit;\nusing static Entitas.Generators.Tests.TestHelper;\n\nnamespace Entitas.Generators.Tests\n{\n    [UsesVerify]\n    public class ComponentGeneratorTests\n    {\n        static readonly string FixturesPath = Path.Combine(ProjectRoot, \"tests\", \"Entitas.Generators.Tests\", \"fixtures\");\n\n        static Task Verify(string fixture, Dictionary<string, string> options) =>\n            TestHelper.Verify(File.ReadAllText(Path.Combine(FixturesPath, $\"{fixture}.cs\")), new ComponentGenerator(), options);\n\n        static Task VerifyComponent(string fixture, Dictionary<string, string> options) =>\n            TestHelper.Verify(File.ReadAllText(Path.Combine(FixturesPath, \"Components\", $\"{fixture}.cs\")), new ComponentGenerator(), options);\n\n        static Task VerifyContext(string fixture, Dictionary<string, string> options) =>\n            TestHelper.Verify(File.ReadAllText(Path.Combine(FixturesPath, \"Contexts\", $\"{fixture}.txt\")), new ComponentGenerator(), options);\n\n        static readonly Dictionary<string, string> DefaultOptions = new Dictionary<string, string>\n        {\n            { EntitasAnalyzerConfigOptions.ComponentCleanupSystemsKey, \"true\" },\n            { EntitasAnalyzerConfigOptions.ComponentComponentIndexKey, \"true\" },\n            { EntitasAnalyzerConfigOptions.ComponentContextExtensionKey, \"true\" },\n            { EntitasAnalyzerConfigOptions.ComponentContextInitializationMethodKey, \"true\" },\n            { EntitasAnalyzerConfigOptions.ComponentEntityExtensionKey, \"true\" },\n            { EntitasAnalyzerConfigOptions.ComponentEntityIndexExtensionKey, \"true\" },\n            { EntitasAnalyzerConfigOptions.ComponentEventsKey, \"true\" },\n            { EntitasAnalyzerConfigOptions.ComponentEventSystemsExtensionKey, \"true\" },\n            { EntitasAnalyzerConfigOptions.ComponentMatcherKey, \"true\" }\n        };\n\n        static readonly Dictionary<string, string> EntityExtensionOptions = new Dictionary<string, string>\n        {\n            { EntitasAnalyzerConfigOptions.ComponentEntityExtensionKey, \"true\" }\n        };\n\n        static readonly Dictionary<string, string> ContextExtensionOptions = new Dictionary<string, string>\n        {\n            { EntitasAnalyzerConfigOptions.ComponentContextExtensionKey, \"true\" }\n        };\n\n        static readonly Dictionary<string, string> CleanupSystemsOptions = new Dictionary<string, string>\n        {\n            { EntitasAnalyzerConfigOptions.ComponentCleanupSystemsKey, \"true\" }\n        };\n\n        static readonly Dictionary<string, string> EventsOptions = new Dictionary<string, string>\n        {\n            { EntitasAnalyzerConfigOptions.ComponentEventsKey, \"true\" }\n        };\n\n        static readonly Dictionary<string, string> EventSystemsExtensionOptions = new Dictionary<string, string>\n        {\n            { EntitasAnalyzerConfigOptions.ComponentEventSystemsExtensionKey, \"true\" }\n        };\n\n        static readonly Dictionary<string, string> EntityIndexExtensionOptions = new Dictionary<string, string>\n        {\n            { EntitasAnalyzerConfigOptions.ComponentEntityIndexExtensionKey, \"true\" }\n        };\n\n        static readonly Dictionary<string, string> ContextInitializationMethodOptions = new Dictionary<string, string>\n        {\n            { EntitasAnalyzerConfigOptions.ComponentContextInitializationMethodKey, \"true\" }\n        };\n\n        [Theory]\n        [InlineData(\"ComponentGenerator\")]\n        [InlineData(\"ComponentGenerator.CleanupSystem\")]\n        [InlineData(\"ComponentGenerator.CleanupSystems\")]\n        [InlineData(\"ComponentGenerator.ComponentIndex\")]\n        [InlineData(\"ComponentGenerator.ContextExtension\")]\n        [InlineData(\"ComponentGenerator.ContextInitializationMethod\")]\n        [InlineData(\"ComponentGenerator.EntityExtension\")]\n        [InlineData(\"ComponentGenerator.EntityIndexExtension\")]\n        [InlineData(\"ComponentGenerator.Events\")]\n        [InlineData(\"ComponentGenerator.EventSystems\")]\n        [InlineData(\"ComponentGenerator.Matcher\")]\n        public void UsesGlobalNamespace(string path)\n        {\n            AssertUsesGlobalNamespaces(Path.Combine(\"gen\", \"Entitas.Generators\", \"Component\", path + \".cs\"));\n        }\n\n        /*\n         *\n         * Non components\n         *\n         */\n\n        [Fact]\n        public Task SomeNamespacedClass() => Verify(\"SomeNamespacedClass\", DefaultOptions);\n\n        [Fact]\n        public Task Class() => Verify(\"SomeClass\", DefaultOptions);\n\n        /*\n         *\n         * Invalid components\n         *\n         */\n\n        [Fact]\n        public Task NonPublicComponent() => VerifyComponent(\"NonPublicComponent\", DefaultOptions);\n\n        [Fact]\n        public Task NoContextComponent() => VerifyComponent(\"NoContextComponent\", DefaultOptions);\n\n        /*\n         *\n         * Valid components\n         *\n         */\n\n        [Fact]\n        public Task NamespacedComponent() => VerifyComponent(\"SomeNamespacedComponent\", DefaultOptions);\n\n        [Fact]\n        public Task Component() => VerifyComponent(\"SomeComponent\", DefaultOptions);\n\n        [Fact]\n        public Task OneFieldNamespacedComponent() => VerifyComponent(\"OneFieldNamespacedComponent\", EntityExtensionOptions);\n\n        [Fact]\n        public Task OneFieldComponent() => VerifyComponent(\"OneFieldComponent\", EntityExtensionOptions);\n\n        [Fact]\n        public Task MultipleFieldsNamespacedComponent() => VerifyComponent(\"MultipleFieldsNamespacedComponent\", EntityExtensionOptions);\n\n        [Fact]\n        public Task MultipleFieldsComponent() => VerifyComponent(\"MultipleFieldsComponent\", EntityExtensionOptions);\n\n        [Fact]\n        public Task ReservedKeywordFieldsNamespacedComponent() => VerifyComponent(\"ReservedKeywordFieldsNamespacedComponent\", EntityExtensionOptions);\n\n        [Fact]\n        public Task NoValidFieldsNamespacedComponent() => VerifyComponent(\"NoValidFieldsNamespacedComponent\", EntityExtensionOptions);\n\n        [Fact]\n        public Task MultiplePropertiesNamespacedComponent() => VerifyComponent(\"MultiplePropertiesNamespacedComponent\", EntityExtensionOptions);\n\n        [Fact]\n        public Task ContextFromDifferentAssemblyNamespacedComponent() => VerifyComponent(\"ContextFromDifferentAssemblyNamespacedComponent\", EntityExtensionOptions);\n\n        [Fact]\n        public Task UniqueNamespacedComponent() => VerifyComponent(\"UniqueNamespacedComponent\", ContextExtensionOptions);\n\n        [Fact]\n        public Task UniqueOneFieldNamespacedComponent() => VerifyComponent(\"UniqueOneFieldNamespacedComponent\", ContextExtensionOptions);\n\n        [Fact]\n        public Task CleanupRemoveNamespacedComponent() => VerifyComponent(\"CleanupRemoveNamespacedComponent\", CleanupSystemsOptions);\n\n        [Fact]\n        public Task CleanupRemoveComponent() => VerifyComponent(\"CleanupRemoveComponent\", CleanupSystemsOptions);\n\n        [Fact]\n        public Task CleanupDestroyEntityNamespacedComponent() => VerifyComponent(\"CleanupDestroyEntityNamespacedComponent\", CleanupSystemsOptions);\n\n        [Fact]\n        public Task CleanupDestroyEntityComponent() => VerifyComponent(\"CleanupDestroyEntityComponent\", CleanupSystemsOptions);\n\n        [Fact]\n        public Task CleanupSystems() => VerifyContext(\"ContextInitialization\", CleanupSystemsOptions);\n\n        [Fact]\n        public Task NoCleanupSystems() => VerifyContext(\"EmptyContextInitialization\", CleanupSystemsOptions);\n\n        [Fact]\n        public Task ComplexTypesComponent() => VerifyComponent(\"ComplexTypesComponent\", EntityExtensionOptions);\n\n        /*\n         *\n         * Events\n         *\n         */\n\n        [Fact]\n        public Task EventNamespacedComponent() => VerifyComponent(\"EventNamespacedComponent\", EventsOptions);\n\n        [Fact]\n        public Task EventComponent() => VerifyComponent(\"EventComponent\", EventsOptions);\n\n        [Fact]\n        public Task FlagEventNamespacedComponent() => VerifyComponent(\"FlagEventNamespacedComponent\", EventsOptions);\n\n        [Fact]\n        public Task FlagEventComponent() => VerifyComponent(\"FlagEventComponent\", EventsOptions);\n\n        [Fact]\n        public Task EventSystems() => VerifyContext(\"ContextInitialization\", EventSystemsExtensionOptions);\n\n        [Fact]\n        public Task NoEventSystems() => VerifyContext(\"EmptyContextInitialization\", EventSystemsExtensionOptions);\n\n        /*\n         *\n         * Entity Index\n         *\n         */\n\n        [Fact]\n        public Task EntityIndexes() => VerifyContext(\"ContextInitialization\", EntityIndexExtensionOptions);\n\n        [Fact]\n        public Task NoEntityIndexes() => VerifyContext(\"EmptyContextInitialization\", EntityIndexExtensionOptions);\n\n        /*\n         *\n         * Invalid usages (but works anyway)\n         *\n         */\n\n        [Fact]\n        public Task DuplicatedContextsNamespacedComponent() => VerifyComponent(\"DuplicatedContextsNamespacedComponent\", EntityExtensionOptions);\n\n        /*\n         *\n         * ContextInitialization\n         *\n         */\n\n        [Fact]\n        public Task EmptyContextInitialization() => VerifyContext(\"EmptyContextInitialization\", ContextInitializationMethodOptions);\n\n        [Fact]\n        public Task ContextInitialization() => VerifyContext(\"ContextInitialization\", ContextInitializationMethodOptions);\n\n        [Fact]\n        public Task ContextInitializationFromDifferentAssembly() => VerifyContext(\"ContextInitializationFromDifferentAssembly\", ContextInitializationMethodOptions);\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/ContextGeneratorTests.cs",
    "content": "using System.Collections.Generic;\nusing System.IO;\nusing System.Threading.Tasks;\nusing VerifyXunit;\nusing Xunit;\nusing static Entitas.Generators.Tests.TestHelper;\n\nnamespace Entitas.Generators.Tests\n{\n    [UsesVerify]\n    public class ContextGeneratorTests\n    {\n        static readonly string FixturesPath = Path.Combine(ProjectRoot, \"tests\", \"Entitas.Generators.Tests\", \"fixtures\");\n\n        static Task Verify(string fixture, Dictionary<string, string> options) =>\n            TestHelper.Verify(File.ReadAllText(Path.Combine(FixturesPath, $\"{fixture}.cs\")), new ContextGenerator(), options);\n\n        static Task VerifyContext(string fixture, Dictionary<string, string> options) =>\n            TestHelper.Verify(File.ReadAllText(Path.Combine(FixturesPath, \"Contexts\", $\"{fixture}.txt\")), new ContextGenerator(), options);\n\n        static readonly Dictionary<string, string> DefaultOptions = new Dictionary<string, string>();\n\n        [Theory]\n        [InlineData(\"ContextGenerator\")]\n        [InlineData(\"ContextGenerator.ComponentIndex\")]\n        [InlineData(\"ContextGenerator.Context\")]\n        [InlineData(\"ContextGenerator.Entity\")]\n        [InlineData(\"ContextGenerator.Matcher\")]\n        public void UsesGlobalNamespace(string path)\n        {\n            AssertUsesGlobalNamespaces(Path.Combine(\"gen\", \"Entitas.Generators\", \"Context\", path + \".cs\"));\n        }\n\n        [Fact]\n        public Task SomeClass() => Verify(\"SomeClass\", DefaultOptions);\n\n        [Fact]\n        public Task NamespacedContext() => VerifyContext(\"NamespacedContext\", DefaultOptions);\n\n        [Fact]\n        public Task SomeContext() => VerifyContext(\"SomeContext\", DefaultOptions);\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/Entitas.Generators.Tests.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>$(DefaultTestTargetFramework)</TargetFramework>\n    <Nullable>enable</Nullable>\n    <IsPackable>false</IsPackable>\n    <IsPublishable>false</IsPublishable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.Analyzers\" Version=\"3.3.4\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.CodeAnalysis.CSharp\" Version=\"4.1.0\" />\n    <PackageReference Include=\"Verify.SourceGenerators\" Version=\"2.1.0\" />\n    <PackageReference Include=\"Verify.Xunit\" Version=\"20.3.2\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"FluentAssertions\" Version=\"6.11.0\" />\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.6.2\" />\n    <PackageReference Include=\"xunit\" Version=\"2.4.2\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.5\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"coverlet.collector\" Version=\"6.0.0\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"../Entitas.Generators.Tests.Fixtures.Dependencies/Entitas.Generators.Tests.Fixtures.Dependencies.csproj\" />\n    <ProjectReference Include=\"../../gen/Entitas.Generators/Entitas.Generators.csproj\" />\n    <ProjectReference Include=\"../../src/Entitas/Entitas.csproj\" />\n    <ProjectReference Include=\"../../src/Entitas.Generators.Attributes/Entitas.Generators.Attributes.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Folder Include=\"snapshots/\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/ModuleInitializer.cs",
    "content": "using System.Runtime.CompilerServices;\nusing VerifyTests;\n\nnamespace Entitas.Generators.Tests\n{\n    public static class ModuleInitializer\n    {\n        [ModuleInitializer]\n        public static void Init()\n        {\n            VerifySourceGenerators.Initialize();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/TestHelper.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Diagnostics.CodeAnalysis;\nusing System.IO;\nusing System.Linq;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\nusing FluentAssertions;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.CSharp;\nusing Microsoft.CodeAnalysis.Diagnostics;\nusing VerifyXunit;\n\nnamespace Entitas.Generators.Tests\n{\n    public static class TestHelper\n    {\n        public static readonly string ProjectRoot = GetProjectRoot();\n\n        static string GetProjectRoot()\n        {\n            var current = new DirectoryInfo(Directory.GetCurrentDirectory());\n            while (current!.Name != \"Entitas\" && current.Name != \"Entitas-CSharp\") current = current.Parent;\n            return current.FullName;\n        }\n\n        // https://andrewlock.net/creating-a-source-generator-part-2-testing-an-incremental-generator-with-snapshot-testing/\n        public static Task Verify(string source, IIncrementalGenerator generator, Dictionary<string, string> options)\n        {\n            var references = AppDomain.CurrentDomain.GetAssemblies()\n                .Where(assembly => !assembly.IsDynamic && !string.IsNullOrWhiteSpace(assembly.Location))\n                .Select(assembly => MetadataReference.CreateFromFile(assembly.Location))\n                .Concat(new[]\n                {\n                    MetadataReference.CreateFromFile(typeof(MyApp.LibraryContext).Assembly.Location),\n                });\n\n            var allOptions = new Dictionary<string, string>\n            {\n                // Component\n                { EntitasAnalyzerConfigOptions.ComponentCleanupSystemsKey, \"false\" },\n                { EntitasAnalyzerConfigOptions.ComponentComponentIndexKey, \"false\" },\n                { EntitasAnalyzerConfigOptions.ComponentContextExtensionKey, \"false\" },\n                { EntitasAnalyzerConfigOptions.ComponentContextInitializationMethodKey, \"false\" },\n                { EntitasAnalyzerConfigOptions.ComponentEntityExtensionKey, \"false\" },\n                { EntitasAnalyzerConfigOptions.ComponentEntityIndexExtensionKey, \"false\" },\n                { EntitasAnalyzerConfigOptions.ComponentEventsKey, \"false\" },\n                { EntitasAnalyzerConfigOptions.ComponentEventSystemsExtensionKey, \"false\" },\n                { EntitasAnalyzerConfigOptions.ComponentMatcherKey, \"false\" },\n                // Context\n                { EntitasAnalyzerConfigOptions.ContextComponentIndexKey, \"true\" },\n                { EntitasAnalyzerConfigOptions.ContextContextKey, \"true\" },\n                { EntitasAnalyzerConfigOptions.ContextEntityKey, \"true\" },\n                { EntitasAnalyzerConfigOptions.ContextMatcherKey, \"true\" }\n            };\n\n            foreach (var kvp in options)\n            {\n                allOptions[kvp.Key] = kvp.Value;\n            }\n\n            var compilation = CSharpCompilation.Create(\n                \"Entitas.Generators.Tests\",\n                new[] { CSharpSyntaxTree.ParseText(source) },\n                references,\n                new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));\n\n            var driver = CSharpGeneratorDriver\n                .Create(generator)\n                .WithUpdatedAnalyzerConfigOptions(new TestAnalyzerConfigOptionsProvider(allOptions))\n                .RunGenerators(compilation);\n\n            return Verifier.Verify(driver).UseDirectory(\"snapshots\");\n        }\n\n        public static void AssertUsesGlobalNamespaces(string path)\n        {\n            var code = File.ReadAllText(Path.Combine(ProjectRoot, path));\n\n            var ignores = new[]\n            {\n                \"global::Entitas.EntitasException\",\n                \"global::Entitas.Systems\",\n                \"EntitasAnalyzerConfigOptions\"\n            };\n\n            foreach (var ignore in ignores)\n            {\n                code = code.Replace(ignore, string.Empty);\n            }\n\n            var patterns = new[]\n            {\n                \"System\",\n                \"Entitas\"\n            }.Select(word => $@\"(?<!\\busing )\" +\n                             $@\"(?<!\\bstatic )\" +\n                             $@\"(?<!\\bnamespace )\" +\n                             $@\"(?<!\\bglobal::)\" +\n                             $@\"(?<!\"\")\" +\n                             $@\"(?<!\\w)\" +\n                             $\"{word}\");\n\n            foreach (var pattern in patterns)\n            {\n                var matches = Regex.Matches(code, pattern);\n                matches.Should().HaveCount(0, $\"because {path} should not use {pattern}\\n{string.Join(\"\\n\", matches.Select(match => match.Value))}\");\n            }\n        }\n    }\n\n    sealed class TestAnalyzerConfigOptionsProvider : AnalyzerConfigOptionsProvider\n    {\n        public override AnalyzerConfigOptions GlobalOptions { get; }\n\n        public TestAnalyzerConfigOptionsProvider(Dictionary<string, string> options)\n        {\n            GlobalOptions = new DictionaryAnalyzerConfigOptions(options.ToImmutableDictionary());\n        }\n\n        public override AnalyzerConfigOptions GetOptions(SyntaxTree tree) => GlobalOptions;\n        public override AnalyzerConfigOptions GetOptions(AdditionalText textFile) => GlobalOptions;\n    }\n\n    sealed class DictionaryAnalyzerConfigOptions : AnalyzerConfigOptions\n    {\n        readonly ImmutableDictionary<string, string> _options;\n        public DictionaryAnalyzerConfigOptions(ImmutableDictionary<string, string> options) => _options = options;\n        public override bool TryGetValue(string key, [NotNullWhen(true)] out string? value) => _options.TryGetValue(key, out value);\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/CleanupDestroyEntityComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\n[Context(typeof(MainContext)), Cleanup(CleanupMode.DestroyEntity)]\npublic sealed class CleanupDestroyEntityComponent : IComponent { }\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/CleanupDestroyEntityNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext)), Cleanup(CleanupMode.DestroyEntity)]\n    public sealed class CleanupDestroyEntityNamespacedComponent : IComponent { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/CleanupRemoveComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\n[Context(typeof(MainContext)), Cleanup(CleanupMode.RemoveComponent)]\npublic sealed class CleanupRemoveComponent : IComponent { }\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/CleanupRemoveNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext)), Cleanup(CleanupMode.RemoveComponent)]\n    public sealed class CleanupRemoveNamespacedComponent : IComponent { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/ComplexTypesComponent.cs",
    "content": "#nullable disable\n\nusing System.Collections.Generic;\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    public sealed class ComplexTypesComponent : IComponent\n    {\n        public int[,,] Array3D;\n        public Dictionary<string, List<int>> DictList;\n        public NestedClass.InnerClass NestedClass;\n        public NestedClass.InnerEnum NestedEnum;\n    }\n\n    public class NestedClass\n    {\n        public class InnerClass { }\n\n        public enum InnerEnum\n        {\n            A,\n            B,\n            C\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/ContextFromDifferentAssemblyNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(LibraryContext))]\n    public sealed class ContextFromDifferentAssemblyNamespacedComponent : IComponent { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/DuplicatedContextsNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    [Context(typeof(MainContext))]\n    public sealed class DuplicatedContextsNamespacedComponent : IComponent { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/EntityIndexComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\n[Context(typeof(MainContext))]\npublic sealed class EntityIndexComponent : IComponent\n{\n    [EntityIndex(false)]\n    public string Value;\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/EntityIndexNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    public sealed class EntityIndexNamespacedComponent : IComponent\n    {\n        [EntityIndex(false)]\n        public string Value;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/EventComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\n[Context(typeof(MainContext))]\n[Event(EventTarget.Any, EventType.Added, 1)]\n[Event(EventTarget.Any, EventType.Removed, 2)]\n[Event(EventTarget.Self, EventType.Added, 3)]\n[Event(EventTarget.Self, EventType.Removed, 4)]\npublic sealed class EventComponent : IComponent\n{\n    public string Value;\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/EventNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    [Event(EventTarget.Any, EventType.Added, 1)]\n    [Event(EventTarget.Any, EventType.Removed, 2)]\n    [Event(EventTarget.Self, EventType.Added, 3)]\n    [Event(EventTarget.Self, EventType.Removed, 4)]\n    public sealed class EventNamespacedComponent : IComponent\n    {\n        public string Value;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/FlagEventComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\n[Context(typeof(MainContext))]\n[Event(EventTarget.Any, EventType.Added, 1)]\n[Event(EventTarget.Any, EventType.Removed, 2)]\n[Event(EventTarget.Self, EventType.Added, 3)]\n[Event(EventTarget.Self, EventType.Removed, 4)]\npublic sealed class FlagEventComponent : IComponent { }\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/FlagEventNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    [Event(EventTarget.Any, EventType.Added, 1)]\n    [Event(EventTarget.Any, EventType.Removed, 2)]\n    [Event(EventTarget.Self, EventType.Added, 3)]\n    [Event(EventTarget.Self, EventType.Removed, 4)]\n    public sealed class FlagEventNamespacedComponent : IComponent { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/MultipleFieldsComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\n[Context(typeof(MainContext))]\npublic sealed class MultipleFieldsComponent : IComponent\n{\n    public string Value1;\n    public string Value2;\n    public string Value3;\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/MultipleFieldsNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    public sealed class MultipleFieldsNamespacedComponent : IComponent\n    {\n        public string Value1;\n        public string Value2;\n        public string Value3;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/MultiplePropertiesNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    public sealed class MultiplePropertiesNamespacedComponent : IComponent\n    {\n        public string Value1 { get; set; }\n        public string Value2 { get; set; }\n\n        public string Value3\n        {\n            get => _value3;\n            set => _value3 = value;\n        }\n\n        string _value3;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/NoContextComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\n\nnamespace MyFeature\n{\n    public sealed class NoContextComponent : IComponent { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/NoValidFieldsNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\n#pragma warning disable CS0169\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    public sealed class NoValidFieldsNamespacedComponent : IComponent\n    {\n        public static string PublicStaticField;\n\n        string _privateField;\n        static string _privateStaticField;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/NonPublicComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\n#pragma warning disable CS0649\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    class NonPublicComponent : IComponent\n    {\n        public string Value;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/OneFieldComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\n[Context(typeof(MainContext))]\npublic sealed class OneFieldComponent : IComponent\n{\n    public string Value;\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/OneFieldNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    public sealed class OneFieldNamespacedComponent : IComponent\n    {\n        public string Value;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/PrimaryEntityIndexComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\n[Context(typeof(MainContext))]\npublic sealed class PrimaryEntityIndexComponent : IComponent\n{\n    [EntityIndex(true)]\n    public string Value;\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/PrimaryEntityIndexNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    public sealed class PrimaryEntityIndexNamespacedComponent : IComponent\n    {\n        [EntityIndex(true)]\n        public string Value;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/ReservedKeywordFieldsNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    public sealed class ReservedKeywordFieldsNamespacedComponent : IComponent\n    {\n        public string Namespace;\n        public string Class;\n        public string Public;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/SomeComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\n[Context(typeof(MainContext))]\npublic sealed class SomeComponent : IComponent { }\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/SomeNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    public sealed class SomeNamespacedComponent : IComponent { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/UniqueNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext)), Unique]\n    public sealed class UniqueNamespacedComponent : IComponent { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Components/UniqueOneFieldNamespacedComponent.cs",
    "content": "#nullable disable\n\nusing Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext)), Unique]\n    public sealed class UniqueOneFieldNamespacedComponent : IComponent\n    {\n        public string Value;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Contexts/ContextInitialization.txt",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    public sealed class AnotherNamespacedComponent : IComponent { }\n}\n\nnamespace MyApp\n{\n    public static partial class ContextInitialization\n    {\n        [ContextInitialization(typeof(MainContext))]\n        public static partial void Initialize();\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Contexts/ContextInitializationFromDifferentAssembly.txt",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyFeature\n{\n    [Context(typeof(MainContext))]\n    public sealed class SomeNamespacedComponent : IComponent { }\n}\n\nnamespace MyApp\n{\n    public static partial class ContextInitialization\n    {\n        [ContextInitialization(typeof(LibraryContext))]\n        public static partial void Initialize();\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Contexts/EmptyContextInitialization.txt",
    "content": "using Entitas.Generators.Attributes;\n\nnamespace MyApp\n{\n    public sealed class NoContextComponent : IComponent { }\n\n    public static partial class ContextInitialization\n    {\n        [ContextInitialization(typeof(EmptyContext))]\n        public static partial void Initialize();\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Contexts/NamespacedContext.txt",
    "content": "namespace MyApp\n{\n    partial class NamespacedContext : Entitas.IContext { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/Contexts/SomeContext.txt",
    "content": "partial class SomeContext : Entitas.IContext { }\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/FakeGenerated/ContextInitialization.cs",
    "content": "#nullable disable\n\nusing Entitas.Generators.Attributes;\n\nnamespace MyApp\n{\n    public static partial class ContextInitialization\n    {\n        [ContextInitialization(typeof(MainContext))]\n        public static partial void InitializeMain();\n    }\n}\n\nnamespace MyApp\n{\n    public static partial class ContextInitialization\n    {\n        public static partial void InitializeMain()\n        {\n            MyApp.MainContext.ComponentNames = new string[] { };\n\n            MyApp.MainContext.ComponentTypes = new global::System.Type[] { };\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/FakeGenerated/MainContext.cs",
    "content": "#nullable disable\n\nusing Entitas;\n\nnamespace MyApp\n{\n    partial class MainContext : IContext { }\n}\n\nnamespace MyApp\n{\n    public sealed partial class MainContext : global::Entitas.Context<Main.Entity>\n    {\n        public static string[] ComponentNames;\n        public static global::System.Type[] ComponentTypes;\n\n        public MainContext() :\n            base(\n                ComponentTypes.Length,\n                0,\n                new global::Entitas.ContextInfo(\n                    \"MyApp.MainContext\",\n                    ComponentNames,\n                    ComponentTypes\n                ),\n                entity =>\n#if (ENTITAS_FAST_AND_UNSAFE)\n                    new global::Entitas.UnsafeAERC(),\n#else\n                    new global::Entitas.SafeAERC(entity),\n#endif\n                () => new Main.Entity()\n            ) { }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/FakeGenerated/MyApp.Main.Entity.cs",
    "content": "#nullable disable\n\nnamespace MyApp.Main\n{\n    public sealed class Entity : global::Entitas.Entity { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/SomeClass.cs",
    "content": "#nullable disable\n\npublic class SomeClass { }\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/fixtures/SomeNamespacedClass.cs",
    "content": "#nullable disable\n\nnamespace MyApp\n{\n    public class SomeNamespacedClass { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/remove-snapshots.bash",
    "content": "#!/usr/bin/env bash\nset -uo pipefail\nIFS=$'\\n\\t'\n\ndir=snapshots\nfiles=\"$(cat snapshots-to-delete.txt)\"\n\nfor f in ${files}; do\n  rm -v \"${dir}/${f#*- }\"\ndone\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.CleanupDestroyEntityComponent#DestroyMyAppMainCleanupDestroyEntityCleanupSystem.g.verified.cs",
    "content": "﻿//HintName: DestroyMyAppMainCleanupDestroyEntityCleanupSystem.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.CleanupSystem\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic sealed class DestroyMyAppMainCleanupDestroyEntityCleanupSystem : global::Entitas.ICleanupSystem\n{\n    readonly global::Entitas.IGroup<global::MyApp.Main.Entity> _group;\n    readonly global::System.Collections.Generic.List<global::MyApp.Main.Entity> _buffer = new global::System.Collections.Generic.List<global::MyApp.Main.Entity>();\n\n    public DestroyMyAppMainCleanupDestroyEntityCleanupSystem(global::MyApp.MainContext context)\n    {\n        _group = context.GetGroup(MyAppMainCleanupDestroyEntityMatcher.CleanupDestroyEntity);\n    }\n\n    public void Cleanup()\n    {\n        foreach (var entity in _group.GetEntities(_buffer))\n        {\n            entity.Destroy();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.CleanupDestroyEntityNamespacedComponent#MyFeature.DestroyMyAppMainCleanupDestroyEntityNamespacedCleanupSystem.g.verified.cs",
    "content": "﻿//HintName: MyFeature.DestroyMyAppMainCleanupDestroyEntityNamespacedCleanupSystem.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.CleanupSystem\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic sealed class DestroyMyAppMainCleanupDestroyEntityNamespacedCleanupSystem : global::Entitas.ICleanupSystem\n{\n    readonly global::Entitas.IGroup<global::MyApp.Main.Entity> _group;\n    readonly global::System.Collections.Generic.List<global::MyApp.Main.Entity> _buffer = new global::System.Collections.Generic.List<global::MyApp.Main.Entity>();\n\n    public DestroyMyAppMainCleanupDestroyEntityNamespacedCleanupSystem(global::MyApp.MainContext context)\n    {\n        _group = context.GetGroup(MyAppMainCleanupDestroyEntityNamespacedMatcher.CleanupDestroyEntityNamespaced);\n    }\n\n    public void Cleanup()\n    {\n        foreach (var entity in _group.GetEntities(_buffer))\n        {\n            entity.Destroy();\n        }\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.CleanupRemoveComponent#RemoveMyAppMainCleanupRemoveCleanupSystem.g.verified.cs",
    "content": "﻿//HintName: RemoveMyAppMainCleanupRemoveCleanupSystem.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.CleanupSystem\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic sealed class RemoveMyAppMainCleanupRemoveCleanupSystem : global::Entitas.ICleanupSystem\n{\n    readonly global::Entitas.IGroup<global::MyApp.Main.Entity> _group;\n    readonly global::System.Collections.Generic.List<global::MyApp.Main.Entity> _buffer = new global::System.Collections.Generic.List<global::MyApp.Main.Entity>();\n\n    public RemoveMyAppMainCleanupRemoveCleanupSystem(global::MyApp.MainContext context)\n    {\n        _group = context.GetGroup(MyAppMainCleanupRemoveMatcher.CleanupRemove);\n    }\n\n    public void Cleanup()\n    {\n        foreach (var entity in _group.GetEntities(_buffer))\n        {\n            entity.RemoveCleanupRemove();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.CleanupRemoveNamespacedComponent#MyFeature.RemoveMyAppMainCleanupRemoveNamespacedCleanupSystem.g.verified.cs",
    "content": "﻿//HintName: MyFeature.RemoveMyAppMainCleanupRemoveNamespacedCleanupSystem.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.CleanupSystem\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic sealed class RemoveMyAppMainCleanupRemoveNamespacedCleanupSystem : global::Entitas.ICleanupSystem\n{\n    readonly global::Entitas.IGroup<global::MyApp.Main.Entity> _group;\n    readonly global::System.Collections.Generic.List<global::MyApp.Main.Entity> _buffer = new global::System.Collections.Generic.List<global::MyApp.Main.Entity>();\n\n    public RemoveMyAppMainCleanupRemoveNamespacedCleanupSystem(global::MyApp.MainContext context)\n    {\n        _group = context.GetGroup(MyAppMainCleanupRemoveNamespacedMatcher.CleanupRemoveNamespaced);\n    }\n\n    public void Cleanup()\n    {\n        foreach (var entity in _group.GetEntities(_buffer))\n        {\n            entity.RemoveCleanupRemoveNamespaced();\n        }\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.CleanupSystems#MyApp.MainContextCleanupSystemsExtension.g.verified.cs",
    "content": "﻿//HintName: MyApp.MainContextCleanupSystemsExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.CleanupSystems\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyApp\n{\npublic static class MainContextCleanupSystemsExtension\n{\n    public static global::Entitas.Systems CreateCleanupSystems(this MainContext context)\n    {\n        var systems = new global::Entitas.Systems();\n        systems.Add(new global::DestroyMyAppMainCleanupDestroyEntityCleanupSystem(context));\n        systems.Add(new global::RemoveMyAppMainCleanupRemoveCleanupSystem(context));\n        systems.Add(new global::MyFeature.DestroyMyAppMainCleanupDestroyEntityNamespacedCleanupSystem(context));\n        systems.Add(new global::MyFeature.RemoveMyAppMainCleanupRemoveNamespacedCleanupSystem(context));\n        return systems;\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.ComplexTypesComponent#MyFeature.MyAppMainComplexTypesEntityExtension.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainComplexTypesEntityExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic static class MyAppMainComplexTypesEntityExtension\n{\n    public static bool HasComplexTypes(this global::MyApp.Main.Entity entity)\n    {\n        return entity.HasComponent(MyAppMainComplexTypesComponentIndex.Index.Value);\n    }\n\n    public static global::MyApp.Main.Entity AddComplexTypes(this global::MyApp.Main.Entity entity, int[,,] array3D, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<int>> dictList, MyFeature.NestedClass.InnerClass nestedClass, MyFeature.NestedClass.InnerEnum nestedEnum)\n    {\n        var index = MyAppMainComplexTypesComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (ComplexTypesComponent)componentPool.Pop()\n            : new ComplexTypesComponent();\n        component.Array3D = array3D;\n        component.DictList = dictList;\n        component.NestedClass = nestedClass;\n        component.NestedEnum = nestedEnum;\n        entity.AddComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity ReplaceComplexTypes(this global::MyApp.Main.Entity entity, int[,,] array3D, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<int>> dictList, MyFeature.NestedClass.InnerClass nestedClass, MyFeature.NestedClass.InnerEnum nestedEnum)\n    {\n        var index = MyAppMainComplexTypesComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (ComplexTypesComponent)componentPool.Pop()\n            : new ComplexTypesComponent();\n        component.Array3D = array3D;\n        component.DictList = dictList;\n        component.NestedClass = nestedClass;\n        component.NestedEnum = nestedEnum;\n        entity.ReplaceComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity RemoveComplexTypes(this global::MyApp.Main.Entity entity)\n    {\n        entity.RemoveComponent(MyAppMainComplexTypesComponentIndex.Index.Value);\n        return entity;\n    }\n\n    public static ComplexTypesComponent GetComplexTypes(this global::MyApp.Main.Entity entity)\n    {\n        return (ComplexTypesComponent)entity.GetComponent(MyAppMainComplexTypesComponentIndex.Index.Value);\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.Component#MyAppMainSomeComponentIndex.g.verified.cs",
    "content": "﻿//HintName: MyAppMainSomeComponentIndex.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.ComponentIndex\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic static class MyAppMainSomeComponentIndex\n{\n    public static global::MyApp.Main.ComponentIndex Index;\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.Component#MyAppMainSomeEntityExtension.g.verified.cs",
    "content": "﻿//HintName: MyAppMainSomeEntityExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic static class MyAppMainSomeEntityExtension\n{\n    static readonly SomeComponent SingleSomeComponent = new SomeComponent();\n\n    public static bool HasSome(this global::MyApp.Main.Entity entity)\n    {\n        return entity.HasComponent(MyAppMainSomeComponentIndex.Index.Value);\n    }\n\n    public static global::MyApp.Main.Entity AddSome(this global::MyApp.Main.Entity entity)\n    {\n        entity.AddComponent(MyAppMainSomeComponentIndex.Index.Value, SingleSomeComponent);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity ReplaceSome(this global::MyApp.Main.Entity entity)\n    {\n        entity.ReplaceComponent(MyAppMainSomeComponentIndex.Index.Value, SingleSomeComponent);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity RemoveSome(this global::MyApp.Main.Entity entity)\n    {\n        entity.RemoveComponent(MyAppMainSomeComponentIndex.Index.Value);\n        return entity;\n    }\n\n    public static SomeComponent GetSome(this global::MyApp.Main.Entity entity)\n    {\n        return (SomeComponent)entity.GetComponent(MyAppMainSomeComponentIndex.Index.Value);\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.Component#MyAppMainSomeMatcher.g.verified.cs",
    "content": "﻿//HintName: MyAppMainSomeMatcher.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Matcher\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic static class MyAppMainSomeMatcher\n{\n    static global::Entitas.IMatcher<global::MyApp.Main.Entity> _matcher;\n\n    public static global::Entitas.IMatcher<global::MyApp.Main.Entity> Some\n    {\n        get\n        {\n            if (_matcher == null)\n            {\n                var matcher = (global::Entitas.Matcher<global::MyApp.Main.Entity>)global::Entitas.Matcher<global::MyApp.Main.Entity>.AllOf(MyAppMainSomeComponentIndex.Index.Value);\n                matcher.ComponentNames = MyApp.MainContext.ComponentNames;\n                _matcher = matcher;\n            }\n\n            return _matcher;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.ContextFromDifferentAssemblyNamespacedComponent#MyFeature.MyAppLibraryContextFromDifferentAssemblyNamespacedEntityExtension.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppLibraryContextFromDifferentAssemblyNamespacedEntityExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic static class MyAppLibraryContextFromDifferentAssemblyNamespacedEntityExtension\n{\n    static readonly ContextFromDifferentAssemblyNamespacedComponent SingleContextFromDifferentAssemblyNamespacedComponent = new ContextFromDifferentAssemblyNamespacedComponent();\n\n    public static bool HasContextFromDifferentAssemblyNamespaced(this global::MyApp.Library.Entity entity)\n    {\n        return entity.HasComponent(MyAppLibraryContextFromDifferentAssemblyNamespacedComponentIndex.Index.Value);\n    }\n\n    public static global::MyApp.Library.Entity AddContextFromDifferentAssemblyNamespaced(this global::MyApp.Library.Entity entity)\n    {\n        entity.AddComponent(MyAppLibraryContextFromDifferentAssemblyNamespacedComponentIndex.Index.Value, SingleContextFromDifferentAssemblyNamespacedComponent);\n        return entity;\n    }\n\n    public static global::MyApp.Library.Entity ReplaceContextFromDifferentAssemblyNamespaced(this global::MyApp.Library.Entity entity)\n    {\n        entity.ReplaceComponent(MyAppLibraryContextFromDifferentAssemblyNamespacedComponentIndex.Index.Value, SingleContextFromDifferentAssemblyNamespacedComponent);\n        return entity;\n    }\n\n    public static global::MyApp.Library.Entity RemoveContextFromDifferentAssemblyNamespaced(this global::MyApp.Library.Entity entity)\n    {\n        entity.RemoveComponent(MyAppLibraryContextFromDifferentAssemblyNamespacedComponentIndex.Index.Value);\n        return entity;\n    }\n\n    public static ContextFromDifferentAssemblyNamespacedComponent GetContextFromDifferentAssemblyNamespaced(this global::MyApp.Library.Entity entity)\n    {\n        return (ContextFromDifferentAssemblyNamespacedComponent)entity.GetComponent(MyAppLibraryContextFromDifferentAssemblyNamespacedComponentIndex.Index.Value);\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.ContextInitialization#MyApp.ContextInitialization.Initialize.ContextInitialization.g.verified.cs",
    "content": "﻿//HintName: MyApp.ContextInitialization.Initialize.ContextInitialization.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.ContextInitializationMethod\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyApp\n{\npublic static partial class ContextInitialization\n{\n    public static partial void Initialize()\n    {\n        global::MyAppMainCleanupDestroyEntityComponentIndex.Index = new global::MyApp.Main.ComponentIndex(0);\n        global::MyAppMainCleanupRemoveComponentIndex.Index = new global::MyApp.Main.ComponentIndex(1);\n        global::MyAppMainEntityIndexComponentIndex.Index = new global::MyApp.Main.ComponentIndex(2);\n        global::MyAppMainEventComponentIndex.Index = new global::MyApp.Main.ComponentIndex(3);\n        global::MyAppMainFlagEventComponentIndex.Index = new global::MyApp.Main.ComponentIndex(4);\n        global::MyAppMainMultipleFieldsComponentIndex.Index = new global::MyApp.Main.ComponentIndex(5);\n        global::MyAppMainAnyEventAddedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(6);\n        global::MyAppMainAnyEventRemovedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(7);\n        global::MyAppMainAnyFlagEventAddedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(8);\n        global::MyAppMainAnyFlagEventRemovedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(9);\n        global::MyAppMainEventAddedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(10);\n        global::MyAppMainEventRemovedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(11);\n        global::MyAppMainFlagEventAddedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(12);\n        global::MyAppMainFlagEventRemovedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(13);\n        global::MyFeature.MyAppMainAnotherNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(14);\n        global::MyFeature.MyAppMainCleanupDestroyEntityNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(15);\n        global::MyFeature.MyAppMainCleanupRemoveNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(16);\n        global::MyFeature.MyAppMainComplexTypesComponentIndex.Index = new global::MyApp.Main.ComponentIndex(17);\n        global::MyFeature.MyAppMainDuplicatedContextsNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(18);\n        global::MyFeature.MyAppMainEntityIndexNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(19);\n        global::MyFeature.MyAppMainEventNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(20);\n        global::MyFeature.MyAppMainFlagEventNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(21);\n        global::MyFeature.MyAppMainMultipleFieldsNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(22);\n        global::MyFeature.MyAppMainMultiplePropertiesNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(23);\n        global::MyFeature.MyAppMainAnyEventNamespacedAddedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(24);\n        global::MyFeature.MyAppMainAnyEventNamespacedRemovedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(25);\n        global::MyFeature.MyAppMainAnyFlagEventNamespacedAddedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(26);\n        global::MyFeature.MyAppMainAnyFlagEventNamespacedRemovedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(27);\n        global::MyFeature.MyAppMainEventNamespacedAddedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(28);\n        global::MyFeature.MyAppMainEventNamespacedRemovedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(29);\n        global::MyFeature.MyAppMainFlagEventNamespacedAddedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(30);\n        global::MyFeature.MyAppMainFlagEventNamespacedRemovedListenerComponentIndex.Index = new global::MyApp.Main.ComponentIndex(31);\n        global::MyFeature.MyAppMainNonPublicComponentIndex.Index = new global::MyApp.Main.ComponentIndex(32);\n        global::MyFeature.MyAppMainNoValidFieldsNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(33);\n        global::MyFeature.MyAppMainOneFieldNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(34);\n        global::MyFeature.MyAppMainPrimaryEntityIndexNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(35);\n        global::MyFeature.MyAppMainReservedKeywordFieldsNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(36);\n        global::MyFeature.MyAppMainSomeNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(37);\n        global::MyFeature.MyAppMainUniqueNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(38);\n        global::MyFeature.MyAppMainUniqueOneFieldNamespacedComponentIndex.Index = new global::MyApp.Main.ComponentIndex(39);\n        global::MyAppMainOneFieldComponentIndex.Index = new global::MyApp.Main.ComponentIndex(40);\n        global::MyAppMainPrimaryEntityIndexComponentIndex.Index = new global::MyApp.Main.ComponentIndex(41);\n        global::MyAppMainSomeComponentIndex.Index = new global::MyApp.Main.ComponentIndex(42);\n\n        global::MyApp.MainContext.ComponentNames = new string[]\n        {\n            \"CleanupDestroyEntity\",\n            \"CleanupRemove\",\n            \"EntityIndex\",\n            \"Event\",\n            \"FlagEvent\",\n            \"MultipleFields\",\n            \"MyAppMainAnyEventAddedListener\",\n            \"MyAppMainAnyEventRemovedListener\",\n            \"MyAppMainAnyFlagEventAddedListener\",\n            \"MyAppMainAnyFlagEventRemovedListener\",\n            \"MyAppMainEventAddedListener\",\n            \"MyAppMainEventRemovedListener\",\n            \"MyAppMainFlagEventAddedListener\",\n            \"MyAppMainFlagEventRemovedListener\",\n            \"MyFeature.AnotherNamespaced\",\n            \"MyFeature.CleanupDestroyEntityNamespaced\",\n            \"MyFeature.CleanupRemoveNamespaced\",\n            \"MyFeature.ComplexTypes\",\n            \"MyFeature.DuplicatedContextsNamespaced\",\n            \"MyFeature.EntityIndexNamespaced\",\n            \"MyFeature.EventNamespaced\",\n            \"MyFeature.FlagEventNamespaced\",\n            \"MyFeature.MultipleFieldsNamespaced\",\n            \"MyFeature.MultiplePropertiesNamespaced\",\n            \"MyFeature.MyAppMainAnyEventNamespacedAddedListener\",\n            \"MyFeature.MyAppMainAnyEventNamespacedRemovedListener\",\n            \"MyFeature.MyAppMainAnyFlagEventNamespacedAddedListener\",\n            \"MyFeature.MyAppMainAnyFlagEventNamespacedRemovedListener\",\n            \"MyFeature.MyAppMainEventNamespacedAddedListener\",\n            \"MyFeature.MyAppMainEventNamespacedRemovedListener\",\n            \"MyFeature.MyAppMainFlagEventNamespacedAddedListener\",\n            \"MyFeature.MyAppMainFlagEventNamespacedRemovedListener\",\n            \"MyFeature.NonPublic\",\n            \"MyFeature.NoValidFieldsNamespaced\",\n            \"MyFeature.OneFieldNamespaced\",\n            \"MyFeature.PrimaryEntityIndexNamespaced\",\n            \"MyFeature.ReservedKeywordFieldsNamespaced\",\n            \"MyFeature.SomeNamespaced\",\n            \"MyFeature.UniqueNamespaced\",\n            \"MyFeature.UniqueOneFieldNamespaced\",\n            \"OneField\",\n            \"PrimaryEntityIndex\",\n            \"Some\"\n        };\n\n        global::MyApp.MainContext.ComponentTypes = new global::System.Type[]\n        {\n            typeof(global::CleanupDestroyEntityComponent),\n            typeof(global::CleanupRemoveComponent),\n            typeof(global::EntityIndexComponent),\n            typeof(global::EventComponent),\n            typeof(global::FlagEventComponent),\n            typeof(global::MultipleFieldsComponent),\n            typeof(global::MyAppMainAnyEventAddedListenerComponent),\n            typeof(global::MyAppMainAnyEventRemovedListenerComponent),\n            typeof(global::MyAppMainAnyFlagEventAddedListenerComponent),\n            typeof(global::MyAppMainAnyFlagEventRemovedListenerComponent),\n            typeof(global::MyAppMainEventAddedListenerComponent),\n            typeof(global::MyAppMainEventRemovedListenerComponent),\n            typeof(global::MyAppMainFlagEventAddedListenerComponent),\n            typeof(global::MyAppMainFlagEventRemovedListenerComponent),\n            typeof(global::MyFeature.AnotherNamespacedComponent),\n            typeof(global::MyFeature.CleanupDestroyEntityNamespacedComponent),\n            typeof(global::MyFeature.CleanupRemoveNamespacedComponent),\n            typeof(global::MyFeature.ComplexTypesComponent),\n            typeof(global::MyFeature.DuplicatedContextsNamespacedComponent),\n            typeof(global::MyFeature.EntityIndexNamespacedComponent),\n            typeof(global::MyFeature.EventNamespacedComponent),\n            typeof(global::MyFeature.FlagEventNamespacedComponent),\n            typeof(global::MyFeature.MultipleFieldsNamespacedComponent),\n            typeof(global::MyFeature.MultiplePropertiesNamespacedComponent),\n            typeof(global::MyFeature.MyAppMainAnyEventNamespacedAddedListenerComponent),\n            typeof(global::MyFeature.MyAppMainAnyEventNamespacedRemovedListenerComponent),\n            typeof(global::MyFeature.MyAppMainAnyFlagEventNamespacedAddedListenerComponent),\n            typeof(global::MyFeature.MyAppMainAnyFlagEventNamespacedRemovedListenerComponent),\n            typeof(global::MyFeature.MyAppMainEventNamespacedAddedListenerComponent),\n            typeof(global::MyFeature.MyAppMainEventNamespacedRemovedListenerComponent),\n            typeof(global::MyFeature.MyAppMainFlagEventNamespacedAddedListenerComponent),\n            typeof(global::MyFeature.MyAppMainFlagEventNamespacedRemovedListenerComponent),\n            typeof(global::MyFeature.NonPublicComponent),\n            typeof(global::MyFeature.NoValidFieldsNamespacedComponent),\n            typeof(global::MyFeature.OneFieldNamespacedComponent),\n            typeof(global::MyFeature.PrimaryEntityIndexNamespacedComponent),\n            typeof(global::MyFeature.ReservedKeywordFieldsNamespacedComponent),\n            typeof(global::MyFeature.SomeNamespacedComponent),\n            typeof(global::MyFeature.UniqueNamespacedComponent),\n            typeof(global::MyFeature.UniqueOneFieldNamespacedComponent),\n            typeof(global::OneFieldComponent),\n            typeof(global::PrimaryEntityIndexComponent),\n            typeof(global::SomeComponent)\n        };\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.ContextInitializationFromDifferentAssembly#MyApp.ContextInitialization.Initialize.ContextInitialization.g.verified.cs",
    "content": "﻿//HintName: MyApp.ContextInitialization.Initialize.ContextInitialization.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.ContextInitializationMethod\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyApp\n{\npublic static partial class ContextInitialization\n{\n    public static partial void Initialize()\n    {\n        global::MyFeature.MyAppLibraryContextFromDifferentAssemblyNamespacedComponentIndex.Index = new global::MyApp.Library.ComponentIndex(0);\n        global::MyOtherFeature.MyAppLibraryCollisionComponentIndex.Index = new global::MyApp.Library.ComponentIndex(1);\n        global::MyOtherFeature.MyAppLibraryHealthComponentIndex.Index = new global::MyApp.Library.ComponentIndex(2);\n        global::MyOtherFeature.MyAppLibraryCollisionAddedListenerComponentIndex.Index = new global::MyApp.Library.ComponentIndex(3);\n\n        global::MyApp.LibraryContext.ComponentNames = new string[]\n        {\n            \"MyFeature.ContextFromDifferentAssemblyNamespaced\",\n            \"MyOtherFeature.Collision\",\n            \"MyOtherFeature.Health\",\n            \"MyOtherFeature.MyAppLibraryCollisionAddedListener\"\n        };\n\n        global::MyApp.LibraryContext.ComponentTypes = new global::System.Type[]\n        {\n            typeof(global::MyFeature.ContextFromDifferentAssemblyNamespacedComponent),\n            typeof(global::MyOtherFeature.CollisionComponent),\n            typeof(global::MyOtherFeature.HealthComponent),\n            typeof(global::MyOtherFeature.MyAppLibraryCollisionAddedListenerComponent)\n        };\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.DuplicatedContextsNamespacedComponent#MyFeature.MyAppMainDuplicatedContextsNamespacedEntityExtension.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainDuplicatedContextsNamespacedEntityExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic static class MyAppMainDuplicatedContextsNamespacedEntityExtension\n{\n    static readonly DuplicatedContextsNamespacedComponent SingleDuplicatedContextsNamespacedComponent = new DuplicatedContextsNamespacedComponent();\n\n    public static bool HasDuplicatedContextsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return entity.HasComponent(MyAppMainDuplicatedContextsNamespacedComponentIndex.Index.Value);\n    }\n\n    public static global::MyApp.Main.Entity AddDuplicatedContextsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        entity.AddComponent(MyAppMainDuplicatedContextsNamespacedComponentIndex.Index.Value, SingleDuplicatedContextsNamespacedComponent);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity ReplaceDuplicatedContextsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        entity.ReplaceComponent(MyAppMainDuplicatedContextsNamespacedComponentIndex.Index.Value, SingleDuplicatedContextsNamespacedComponent);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity RemoveDuplicatedContextsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        entity.RemoveComponent(MyAppMainDuplicatedContextsNamespacedComponentIndex.Index.Value);\n        return entity;\n    }\n\n    public static DuplicatedContextsNamespacedComponent GetDuplicatedContextsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return (DuplicatedContextsNamespacedComponent)entity.GetComponent(MyAppMainDuplicatedContextsNamespacedComponentIndex.Index.Value);\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.EmptyContextInitialization#MyApp.ContextInitialization.Initialize.ContextInitialization.g.verified.cs",
    "content": "﻿//HintName: MyApp.ContextInitialization.Initialize.ContextInitialization.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.ContextInitializationMethod\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyApp\n{\npublic static partial class ContextInitialization\n{\n    public static partial void Initialize()\n    {\n\n\n        global::EmptyContext.ComponentNames = new string[]\n        {\n\n        };\n\n        global::EmptyContext.ComponentTypes = new global::System.Type[]\n        {\n\n        };\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.EntityIndexes#MyApp.MainContextEntityIndexExtension.g.verified.cs",
    "content": "﻿//HintName: MyApp.MainContextEntityIndexExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityIndexExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyApp\n{\npublic static class MainContextEntityIndexExtension\n{\n    public const string EntityIndexValue = \"EntityIndexValue\";\n    public const string MyFeatureEntityIndexNamespacedValue = \"MyFeatureEntityIndexNamespacedValue\";\n    public const string MyFeaturePrimaryEntityIndexNamespacedValue = \"MyFeaturePrimaryEntityIndexNamespacedValue\";\n    public const string PrimaryEntityIndexValue = \"PrimaryEntityIndexValue\";\n\n    public static MainContext AddAllEntityIndexes(this MainContext context)\n    {\n        context.AddEntityIndex(new global::Entitas.EntityIndex<global::MyApp.Main.Entity, string>(\n            EntityIndexValue,\n            context.GetGroup(global::MyAppMainEntityIndexMatcher.EntityIndex),\n            (entity, component) => ((global::EntityIndexComponent)component).Value));\n\n        context.AddEntityIndex(new global::Entitas.EntityIndex<global::MyApp.Main.Entity, string>(\n            MyFeatureEntityIndexNamespacedValue,\n            context.GetGroup(global::MyFeature.MyAppMainEntityIndexNamespacedMatcher.EntityIndexNamespaced),\n            (entity, component) => ((global::MyFeature.EntityIndexNamespacedComponent)component).Value));\n\n        context.AddEntityIndex(new global::Entitas.PrimaryEntityIndex<global::MyApp.Main.Entity, string>(\n            MyFeaturePrimaryEntityIndexNamespacedValue,\n            context.GetGroup(global::MyFeature.MyAppMainPrimaryEntityIndexNamespacedMatcher.PrimaryEntityIndexNamespaced),\n            (entity, component) => ((global::MyFeature.PrimaryEntityIndexNamespacedComponent)component).Value));\n\n        context.AddEntityIndex(new global::Entitas.PrimaryEntityIndex<global::MyApp.Main.Entity, string>(\n            PrimaryEntityIndexValue,\n            context.GetGroup(global::MyAppMainPrimaryEntityIndexMatcher.PrimaryEntityIndex),\n            (entity, component) => ((global::PrimaryEntityIndexComponent)component).Value));\n\n        return context;\n    }\n}\n}\n\npublic static class EntityIndexExtension\n{\n    public static global::System.Collections.Generic.HashSet<global::MyApp.Main.Entity> GetEntitiesWithEntityIndexValue(this global::MyApp.MainContext context, string value)\n    {\n        return ((global::Entitas.EntityIndex<global::MyApp.Main.Entity, string>)context.GetEntityIndex(global::MyApp.MainContextEntityIndexExtension.EntityIndexValue)).GetEntities(value);\n    }\n\n    public static global::MyApp.Main.Entity GetEntityWithPrimaryEntityIndexValue(this global::MyApp.MainContext context, string value)\n    {\n        return ((global::Entitas.PrimaryEntityIndex<global::MyApp.Main.Entity, string>)context.GetEntityIndex(global::MyApp.MainContextEntityIndexExtension.PrimaryEntityIndexValue)).GetEntity(value);\n    }\n}\n\nnamespace MyFeature\n{\npublic static class EntityIndexExtension\n{\n    public static global::System.Collections.Generic.HashSet<global::MyApp.Main.Entity> GetEntitiesWithEntityIndexNamespacedValue(this global::MyApp.MainContext context, string value)\n    {\n        return ((global::Entitas.EntityIndex<global::MyApp.Main.Entity, string>)context.GetEntityIndex(global::MyApp.MainContextEntityIndexExtension.MyFeatureEntityIndexNamespacedValue)).GetEntities(value);\n    }\n\n    public static global::MyApp.Main.Entity GetEntityWithPrimaryEntityIndexNamespacedValue(this global::MyApp.MainContext context, string value)\n    {\n        return ((global::Entitas.PrimaryEntityIndex<global::MyApp.Main.Entity, string>)context.GetEntityIndex(global::MyApp.MainContextEntityIndexExtension.MyFeaturePrimaryEntityIndexNamespacedValue)).GetEntity(value);\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.EventComponent#MyAppMainAnyEventAddedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyAppMainAnyEventAddedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic interface IMyAppMainAnyEventAddedListener\n{\n    void OnAnyEventAdded(global::MyApp.Main.Entity entity, string value);\n}\n\npublic sealed class MyAppMainAnyEventAddedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainAnyEventAddedListener> Value;\n}\n\npublic static class MyAppMainAnyEventAddedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddAnyEventAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyEventAddedListener value)\n    {\n        var listeners = entity.HasAnyEventAddedListener()\n            ? entity.GetAnyEventAddedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainAnyEventAddedListener>();\n        listeners.Add(value);\n        return entity.ReplaceAnyEventAddedListener(listeners);\n    }\n\n    public static void RemoveAnyEventAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyEventAddedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetAnyEventAddedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveAnyEventAddedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceAnyEventAddedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainAnyEventAddedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::Entitas.IGroup<global::MyApp.Main.Entity> _listeners;\n    readonly global::System.Collections.Generic.List<global::MyApp.Main.Entity> _entityBuffer;\n    readonly global::System.Collections.Generic.List<IMyAppMainAnyEventAddedListener> _listenerBuffer;\n\n    public MyAppMainAnyEventAddedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listeners = context.GetGroup(MyAppMainAnyEventAddedListenerMatcher.AnyEventAddedListener);\n        _entityBuffer = new global::System.Collections.Generic.List<global::MyApp.Main.Entity>();\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainAnyEventAddedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Added(MyAppMainEventMatcher.Event)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return entity.HasEvent();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            var component = entity.GetEvent();\n            foreach (var listenerEntity in _listeners.GetEntities(_entityBuffer))\n            {\n                _listenerBuffer.Clear();\n                _listenerBuffer.AddRange(listenerEntity.GetAnyEventAddedListener().Value);\n                foreach (var listener in _listenerBuffer)\n                {\n                    listener.OnAnyEventAdded(entity, component.Value);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.EventComponent#MyAppMainAnyEventRemovedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyAppMainAnyEventRemovedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic interface IMyAppMainAnyEventRemovedListener\n{\n    void OnAnyEventRemoved(global::MyApp.Main.Entity entity);\n}\n\npublic sealed class MyAppMainAnyEventRemovedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainAnyEventRemovedListener> Value;\n}\n\npublic static class MyAppMainAnyEventRemovedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddAnyEventRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyEventRemovedListener value)\n    {\n        var listeners = entity.HasAnyEventRemovedListener()\n            ? entity.GetAnyEventRemovedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainAnyEventRemovedListener>();\n        listeners.Add(value);\n        return entity.ReplaceAnyEventRemovedListener(listeners);\n    }\n\n    public static void RemoveAnyEventRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyEventRemovedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetAnyEventRemovedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveAnyEventRemovedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceAnyEventRemovedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainAnyEventRemovedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::Entitas.IGroup<global::MyApp.Main.Entity> _listeners;\n    readonly global::System.Collections.Generic.List<global::MyApp.Main.Entity> _entityBuffer;\n    readonly global::System.Collections.Generic.List<IMyAppMainAnyEventRemovedListener> _listenerBuffer;\n\n    public MyAppMainAnyEventRemovedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listeners = context.GetGroup(MyAppMainAnyEventRemovedListenerMatcher.AnyEventRemovedListener);\n        _entityBuffer = new global::System.Collections.Generic.List<global::MyApp.Main.Entity>();\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainAnyEventRemovedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Removed(MyAppMainEventMatcher.Event)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return !entity.HasEvent();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            foreach (var listenerEntity in _listeners.GetEntities(_entityBuffer))\n            {\n                _listenerBuffer.Clear();\n                _listenerBuffer.AddRange(listenerEntity.GetAnyEventRemovedListener().Value);\n                foreach (var listener in _listenerBuffer)\n                {\n                    listener.OnAnyEventRemoved(entity);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.EventComponent#MyAppMainEventAddedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyAppMainEventAddedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic interface IMyAppMainEventAddedListener\n{\n    void OnEventAdded(global::MyApp.Main.Entity entity, string value);\n}\n\npublic sealed class MyAppMainEventAddedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainEventAddedListener> Value;\n}\n\npublic static class MyAppMainEventAddedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddEventAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainEventAddedListener value)\n    {\n        var listeners = entity.HasEventAddedListener()\n            ? entity.GetEventAddedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainEventAddedListener>();\n        listeners.Add(value);\n        return entity.ReplaceEventAddedListener(listeners);\n    }\n\n    public static void RemoveEventAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainEventAddedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetEventAddedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveEventAddedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceEventAddedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainEventAddedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::System.Collections.Generic.List<IMyAppMainEventAddedListener> _listenerBuffer;\n\n    public MyAppMainEventAddedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainEventAddedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Added(MyAppMainEventMatcher.Event)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return entity.HasEvent() && entity.HasEventAddedListener();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            var component = entity.GetEvent();\n            _listenerBuffer.Clear();\n            _listenerBuffer.AddRange(entity.GetEventAddedListener().Value);\n            foreach (var listener in _listenerBuffer)\n            {\n                listener.OnEventAdded(entity, component.Value);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.EventComponent#MyAppMainEventRemovedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyAppMainEventRemovedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic interface IMyAppMainEventRemovedListener\n{\n    void OnEventRemoved(global::MyApp.Main.Entity entity);\n}\n\npublic sealed class MyAppMainEventRemovedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainEventRemovedListener> Value;\n}\n\npublic static class MyAppMainEventRemovedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddEventRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainEventRemovedListener value)\n    {\n        var listeners = entity.HasEventRemovedListener()\n            ? entity.GetEventRemovedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainEventRemovedListener>();\n        listeners.Add(value);\n        return entity.ReplaceEventRemovedListener(listeners);\n    }\n\n    public static void RemoveEventRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainEventRemovedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetEventRemovedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveEventRemovedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceEventRemovedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainEventRemovedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::System.Collections.Generic.List<IMyAppMainEventRemovedListener> _listenerBuffer;\n\n    public MyAppMainEventRemovedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainEventRemovedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Removed(MyAppMainEventMatcher.Event)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return !entity.HasEvent() && entity.HasEventRemovedListener();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            _listenerBuffer.Clear();\n            _listenerBuffer.AddRange(entity.GetEventRemovedListener().Value);\n            foreach (var listener in _listenerBuffer)\n            {\n                listener.OnEventRemoved(entity);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.EventNamespacedComponent#MyFeature.MyAppMainAnyEventNamespacedAddedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainAnyEventNamespacedAddedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic interface IMyAppMainAnyEventNamespacedAddedListener\n{\n    void OnAnyEventNamespacedAdded(global::MyApp.Main.Entity entity, string value);\n}\n\npublic sealed class MyAppMainAnyEventNamespacedAddedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainAnyEventNamespacedAddedListener> Value;\n}\n\npublic static class MyAppMainAnyEventNamespacedAddedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddAnyEventNamespacedAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyEventNamespacedAddedListener value)\n    {\n        var listeners = entity.HasAnyEventNamespacedAddedListener()\n            ? entity.GetAnyEventNamespacedAddedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainAnyEventNamespacedAddedListener>();\n        listeners.Add(value);\n        return entity.ReplaceAnyEventNamespacedAddedListener(listeners);\n    }\n\n    public static void RemoveAnyEventNamespacedAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyEventNamespacedAddedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetAnyEventNamespacedAddedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveAnyEventNamespacedAddedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceAnyEventNamespacedAddedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainAnyEventNamespacedAddedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::Entitas.IGroup<global::MyApp.Main.Entity> _listeners;\n    readonly global::System.Collections.Generic.List<global::MyApp.Main.Entity> _entityBuffer;\n    readonly global::System.Collections.Generic.List<IMyAppMainAnyEventNamespacedAddedListener> _listenerBuffer;\n\n    public MyAppMainAnyEventNamespacedAddedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listeners = context.GetGroup(MyAppMainAnyEventNamespacedAddedListenerMatcher.AnyEventNamespacedAddedListener);\n        _entityBuffer = new global::System.Collections.Generic.List<global::MyApp.Main.Entity>();\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainAnyEventNamespacedAddedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Added(MyAppMainEventNamespacedMatcher.EventNamespaced)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return entity.HasEventNamespaced();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            var component = entity.GetEventNamespaced();\n            foreach (var listenerEntity in _listeners.GetEntities(_entityBuffer))\n            {\n                _listenerBuffer.Clear();\n                _listenerBuffer.AddRange(listenerEntity.GetAnyEventNamespacedAddedListener().Value);\n                foreach (var listener in _listenerBuffer)\n                {\n                    listener.OnAnyEventNamespacedAdded(entity, component.Value);\n                }\n            }\n        }\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.EventNamespacedComponent#MyFeature.MyAppMainAnyEventNamespacedRemovedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainAnyEventNamespacedRemovedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic interface IMyAppMainAnyEventNamespacedRemovedListener\n{\n    void OnAnyEventNamespacedRemoved(global::MyApp.Main.Entity entity);\n}\n\npublic sealed class MyAppMainAnyEventNamespacedRemovedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainAnyEventNamespacedRemovedListener> Value;\n}\n\npublic static class MyAppMainAnyEventNamespacedRemovedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddAnyEventNamespacedRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyEventNamespacedRemovedListener value)\n    {\n        var listeners = entity.HasAnyEventNamespacedRemovedListener()\n            ? entity.GetAnyEventNamespacedRemovedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainAnyEventNamespacedRemovedListener>();\n        listeners.Add(value);\n        return entity.ReplaceAnyEventNamespacedRemovedListener(listeners);\n    }\n\n    public static void RemoveAnyEventNamespacedRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyEventNamespacedRemovedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetAnyEventNamespacedRemovedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveAnyEventNamespacedRemovedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceAnyEventNamespacedRemovedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainAnyEventNamespacedRemovedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::Entitas.IGroup<global::MyApp.Main.Entity> _listeners;\n    readonly global::System.Collections.Generic.List<global::MyApp.Main.Entity> _entityBuffer;\n    readonly global::System.Collections.Generic.List<IMyAppMainAnyEventNamespacedRemovedListener> _listenerBuffer;\n\n    public MyAppMainAnyEventNamespacedRemovedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listeners = context.GetGroup(MyAppMainAnyEventNamespacedRemovedListenerMatcher.AnyEventNamespacedRemovedListener);\n        _entityBuffer = new global::System.Collections.Generic.List<global::MyApp.Main.Entity>();\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainAnyEventNamespacedRemovedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Removed(MyAppMainEventNamespacedMatcher.EventNamespaced)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return !entity.HasEventNamespaced();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            foreach (var listenerEntity in _listeners.GetEntities(_entityBuffer))\n            {\n                _listenerBuffer.Clear();\n                _listenerBuffer.AddRange(listenerEntity.GetAnyEventNamespacedRemovedListener().Value);\n                foreach (var listener in _listenerBuffer)\n                {\n                    listener.OnAnyEventNamespacedRemoved(entity);\n                }\n            }\n        }\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.EventNamespacedComponent#MyFeature.MyAppMainEventNamespacedAddedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainEventNamespacedAddedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic interface IMyAppMainEventNamespacedAddedListener\n{\n    void OnEventNamespacedAdded(global::MyApp.Main.Entity entity, string value);\n}\n\npublic sealed class MyAppMainEventNamespacedAddedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainEventNamespacedAddedListener> Value;\n}\n\npublic static class MyAppMainEventNamespacedAddedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddEventNamespacedAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainEventNamespacedAddedListener value)\n    {\n        var listeners = entity.HasEventNamespacedAddedListener()\n            ? entity.GetEventNamespacedAddedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainEventNamespacedAddedListener>();\n        listeners.Add(value);\n        return entity.ReplaceEventNamespacedAddedListener(listeners);\n    }\n\n    public static void RemoveEventNamespacedAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainEventNamespacedAddedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetEventNamespacedAddedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveEventNamespacedAddedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceEventNamespacedAddedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainEventNamespacedAddedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::System.Collections.Generic.List<IMyAppMainEventNamespacedAddedListener> _listenerBuffer;\n\n    public MyAppMainEventNamespacedAddedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainEventNamespacedAddedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Added(MyAppMainEventNamespacedMatcher.EventNamespaced)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return entity.HasEventNamespaced() && entity.HasEventNamespacedAddedListener();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            var component = entity.GetEventNamespaced();\n            _listenerBuffer.Clear();\n            _listenerBuffer.AddRange(entity.GetEventNamespacedAddedListener().Value);\n            foreach (var listener in _listenerBuffer)\n            {\n                listener.OnEventNamespacedAdded(entity, component.Value);\n            }\n        }\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.EventNamespacedComponent#MyFeature.MyAppMainEventNamespacedRemovedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainEventNamespacedRemovedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic interface IMyAppMainEventNamespacedRemovedListener\n{\n    void OnEventNamespacedRemoved(global::MyApp.Main.Entity entity);\n}\n\npublic sealed class MyAppMainEventNamespacedRemovedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainEventNamespacedRemovedListener> Value;\n}\n\npublic static class MyAppMainEventNamespacedRemovedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddEventNamespacedRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainEventNamespacedRemovedListener value)\n    {\n        var listeners = entity.HasEventNamespacedRemovedListener()\n            ? entity.GetEventNamespacedRemovedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainEventNamespacedRemovedListener>();\n        listeners.Add(value);\n        return entity.ReplaceEventNamespacedRemovedListener(listeners);\n    }\n\n    public static void RemoveEventNamespacedRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainEventNamespacedRemovedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetEventNamespacedRemovedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveEventNamespacedRemovedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceEventNamespacedRemovedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainEventNamespacedRemovedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::System.Collections.Generic.List<IMyAppMainEventNamespacedRemovedListener> _listenerBuffer;\n\n    public MyAppMainEventNamespacedRemovedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainEventNamespacedRemovedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Removed(MyAppMainEventNamespacedMatcher.EventNamespaced)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return !entity.HasEventNamespaced() && entity.HasEventNamespacedRemovedListener();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            _listenerBuffer.Clear();\n            _listenerBuffer.AddRange(entity.GetEventNamespacedRemovedListener().Value);\n            foreach (var listener in _listenerBuffer)\n            {\n                listener.OnEventNamespacedRemoved(entity);\n            }\n        }\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.EventSystems#MyApp.MainContextEventSystemsExtension.g.verified.cs",
    "content": "﻿//HintName: MyApp.MainContextEventSystemsExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EventSystemsContextExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyApp\n{\npublic static class MainContextEventSystemsExtension\n{\n    public static global::Entitas.Systems CreateEventSystems(this MainContext context)\n    {\n        var systems = new global::Entitas.Systems();\n        systems.Add(new global::MyAppMainAnyEventAddedEventSystem(context)); // Order: 1\n        systems.Add(new global::MyAppMainAnyFlagEventAddedEventSystem(context)); // Order: 1\n        systems.Add(new global::MyFeature.MyAppMainAnyEventNamespacedAddedEventSystem(context)); // Order: 1\n        systems.Add(new global::MyFeature.MyAppMainAnyFlagEventNamespacedAddedEventSystem(context)); // Order: 1\n        systems.Add(new global::MyAppMainAnyEventRemovedEventSystem(context)); // Order: 2\n        systems.Add(new global::MyAppMainAnyFlagEventRemovedEventSystem(context)); // Order: 2\n        systems.Add(new global::MyFeature.MyAppMainAnyEventNamespacedRemovedEventSystem(context)); // Order: 2\n        systems.Add(new global::MyFeature.MyAppMainAnyFlagEventNamespacedRemovedEventSystem(context)); // Order: 2\n        systems.Add(new global::MyAppMainEventAddedEventSystem(context)); // Order: 3\n        systems.Add(new global::MyAppMainFlagEventAddedEventSystem(context)); // Order: 3\n        systems.Add(new global::MyFeature.MyAppMainEventNamespacedAddedEventSystem(context)); // Order: 3\n        systems.Add(new global::MyFeature.MyAppMainFlagEventNamespacedAddedEventSystem(context)); // Order: 3\n        systems.Add(new global::MyAppMainEventRemovedEventSystem(context)); // Order: 4\n        systems.Add(new global::MyAppMainFlagEventRemovedEventSystem(context)); // Order: 4\n        systems.Add(new global::MyFeature.MyAppMainEventNamespacedRemovedEventSystem(context)); // Order: 4\n        systems.Add(new global::MyFeature.MyAppMainFlagEventNamespacedRemovedEventSystem(context)); // Order: 4\n        return systems;\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.FlagEventComponent#MyAppMainAnyFlagEventAddedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyAppMainAnyFlagEventAddedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic interface IMyAppMainAnyFlagEventAddedListener\n{\n    void OnAnyFlagEventAdded(global::MyApp.Main.Entity entity);\n}\n\npublic sealed class MyAppMainAnyFlagEventAddedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainAnyFlagEventAddedListener> Value;\n}\n\npublic static class MyAppMainAnyFlagEventAddedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddAnyFlagEventAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyFlagEventAddedListener value)\n    {\n        var listeners = entity.HasAnyFlagEventAddedListener()\n            ? entity.GetAnyFlagEventAddedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainAnyFlagEventAddedListener>();\n        listeners.Add(value);\n        return entity.ReplaceAnyFlagEventAddedListener(listeners);\n    }\n\n    public static void RemoveAnyFlagEventAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyFlagEventAddedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetAnyFlagEventAddedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveAnyFlagEventAddedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceAnyFlagEventAddedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainAnyFlagEventAddedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::Entitas.IGroup<global::MyApp.Main.Entity> _listeners;\n    readonly global::System.Collections.Generic.List<global::MyApp.Main.Entity> _entityBuffer;\n    readonly global::System.Collections.Generic.List<IMyAppMainAnyFlagEventAddedListener> _listenerBuffer;\n\n    public MyAppMainAnyFlagEventAddedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listeners = context.GetGroup(MyAppMainAnyFlagEventAddedListenerMatcher.AnyFlagEventAddedListener);\n        _entityBuffer = new global::System.Collections.Generic.List<global::MyApp.Main.Entity>();\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainAnyFlagEventAddedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Added(MyAppMainFlagEventMatcher.FlagEvent)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return entity.HasFlagEvent();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            foreach (var listenerEntity in _listeners.GetEntities(_entityBuffer))\n            {\n                _listenerBuffer.Clear();\n                _listenerBuffer.AddRange(listenerEntity.GetAnyFlagEventAddedListener().Value);\n                foreach (var listener in _listenerBuffer)\n                {\n                    listener.OnAnyFlagEventAdded(entity);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.FlagEventComponent#MyAppMainAnyFlagEventRemovedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyAppMainAnyFlagEventRemovedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic interface IMyAppMainAnyFlagEventRemovedListener\n{\n    void OnAnyFlagEventRemoved(global::MyApp.Main.Entity entity);\n}\n\npublic sealed class MyAppMainAnyFlagEventRemovedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainAnyFlagEventRemovedListener> Value;\n}\n\npublic static class MyAppMainAnyFlagEventRemovedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddAnyFlagEventRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyFlagEventRemovedListener value)\n    {\n        var listeners = entity.HasAnyFlagEventRemovedListener()\n            ? entity.GetAnyFlagEventRemovedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainAnyFlagEventRemovedListener>();\n        listeners.Add(value);\n        return entity.ReplaceAnyFlagEventRemovedListener(listeners);\n    }\n\n    public static void RemoveAnyFlagEventRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyFlagEventRemovedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetAnyFlagEventRemovedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveAnyFlagEventRemovedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceAnyFlagEventRemovedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainAnyFlagEventRemovedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::Entitas.IGroup<global::MyApp.Main.Entity> _listeners;\n    readonly global::System.Collections.Generic.List<global::MyApp.Main.Entity> _entityBuffer;\n    readonly global::System.Collections.Generic.List<IMyAppMainAnyFlagEventRemovedListener> _listenerBuffer;\n\n    public MyAppMainAnyFlagEventRemovedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listeners = context.GetGroup(MyAppMainAnyFlagEventRemovedListenerMatcher.AnyFlagEventRemovedListener);\n        _entityBuffer = new global::System.Collections.Generic.List<global::MyApp.Main.Entity>();\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainAnyFlagEventRemovedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Removed(MyAppMainFlagEventMatcher.FlagEvent)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return !entity.HasFlagEvent();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            foreach (var listenerEntity in _listeners.GetEntities(_entityBuffer))\n            {\n                _listenerBuffer.Clear();\n                _listenerBuffer.AddRange(listenerEntity.GetAnyFlagEventRemovedListener().Value);\n                foreach (var listener in _listenerBuffer)\n                {\n                    listener.OnAnyFlagEventRemoved(entity);\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.FlagEventComponent#MyAppMainFlagEventAddedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyAppMainFlagEventAddedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic interface IMyAppMainFlagEventAddedListener\n{\n    void OnFlagEventAdded(global::MyApp.Main.Entity entity);\n}\n\npublic sealed class MyAppMainFlagEventAddedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainFlagEventAddedListener> Value;\n}\n\npublic static class MyAppMainFlagEventAddedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddFlagEventAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainFlagEventAddedListener value)\n    {\n        var listeners = entity.HasFlagEventAddedListener()\n            ? entity.GetFlagEventAddedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainFlagEventAddedListener>();\n        listeners.Add(value);\n        return entity.ReplaceFlagEventAddedListener(listeners);\n    }\n\n    public static void RemoveFlagEventAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainFlagEventAddedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetFlagEventAddedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveFlagEventAddedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceFlagEventAddedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainFlagEventAddedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::System.Collections.Generic.List<IMyAppMainFlagEventAddedListener> _listenerBuffer;\n\n    public MyAppMainFlagEventAddedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainFlagEventAddedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Added(MyAppMainFlagEventMatcher.FlagEvent)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return entity.HasFlagEvent() && entity.HasFlagEventAddedListener();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            _listenerBuffer.Clear();\n            _listenerBuffer.AddRange(entity.GetFlagEventAddedListener().Value);\n            foreach (var listener in _listenerBuffer)\n            {\n                listener.OnFlagEventAdded(entity);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.FlagEventComponent#MyAppMainFlagEventRemovedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyAppMainFlagEventRemovedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic interface IMyAppMainFlagEventRemovedListener\n{\n    void OnFlagEventRemoved(global::MyApp.Main.Entity entity);\n}\n\npublic sealed class MyAppMainFlagEventRemovedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainFlagEventRemovedListener> Value;\n}\n\npublic static class MyAppMainFlagEventRemovedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddFlagEventRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainFlagEventRemovedListener value)\n    {\n        var listeners = entity.HasFlagEventRemovedListener()\n            ? entity.GetFlagEventRemovedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainFlagEventRemovedListener>();\n        listeners.Add(value);\n        return entity.ReplaceFlagEventRemovedListener(listeners);\n    }\n\n    public static void RemoveFlagEventRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainFlagEventRemovedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetFlagEventRemovedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveFlagEventRemovedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceFlagEventRemovedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainFlagEventRemovedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::System.Collections.Generic.List<IMyAppMainFlagEventRemovedListener> _listenerBuffer;\n\n    public MyAppMainFlagEventRemovedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainFlagEventRemovedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Removed(MyAppMainFlagEventMatcher.FlagEvent)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return !entity.HasFlagEvent() && entity.HasFlagEventRemovedListener();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            _listenerBuffer.Clear();\n            _listenerBuffer.AddRange(entity.GetFlagEventRemovedListener().Value);\n            foreach (var listener in _listenerBuffer)\n            {\n                listener.OnFlagEventRemoved(entity);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.FlagEventNamespacedComponent#MyFeature.MyAppMainAnyFlagEventNamespacedAddedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainAnyFlagEventNamespacedAddedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic interface IMyAppMainAnyFlagEventNamespacedAddedListener\n{\n    void OnAnyFlagEventNamespacedAdded(global::MyApp.Main.Entity entity);\n}\n\npublic sealed class MyAppMainAnyFlagEventNamespacedAddedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainAnyFlagEventNamespacedAddedListener> Value;\n}\n\npublic static class MyAppMainAnyFlagEventNamespacedAddedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddAnyFlagEventNamespacedAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyFlagEventNamespacedAddedListener value)\n    {\n        var listeners = entity.HasAnyFlagEventNamespacedAddedListener()\n            ? entity.GetAnyFlagEventNamespacedAddedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainAnyFlagEventNamespacedAddedListener>();\n        listeners.Add(value);\n        return entity.ReplaceAnyFlagEventNamespacedAddedListener(listeners);\n    }\n\n    public static void RemoveAnyFlagEventNamespacedAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyFlagEventNamespacedAddedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetAnyFlagEventNamespacedAddedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveAnyFlagEventNamespacedAddedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceAnyFlagEventNamespacedAddedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainAnyFlagEventNamespacedAddedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::Entitas.IGroup<global::MyApp.Main.Entity> _listeners;\n    readonly global::System.Collections.Generic.List<global::MyApp.Main.Entity> _entityBuffer;\n    readonly global::System.Collections.Generic.List<IMyAppMainAnyFlagEventNamespacedAddedListener> _listenerBuffer;\n\n    public MyAppMainAnyFlagEventNamespacedAddedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listeners = context.GetGroup(MyAppMainAnyFlagEventNamespacedAddedListenerMatcher.AnyFlagEventNamespacedAddedListener);\n        _entityBuffer = new global::System.Collections.Generic.List<global::MyApp.Main.Entity>();\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainAnyFlagEventNamespacedAddedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Added(MyAppMainFlagEventNamespacedMatcher.FlagEventNamespaced)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return entity.HasFlagEventNamespaced();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            foreach (var listenerEntity in _listeners.GetEntities(_entityBuffer))\n            {\n                _listenerBuffer.Clear();\n                _listenerBuffer.AddRange(listenerEntity.GetAnyFlagEventNamespacedAddedListener().Value);\n                foreach (var listener in _listenerBuffer)\n                {\n                    listener.OnAnyFlagEventNamespacedAdded(entity);\n                }\n            }\n        }\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.FlagEventNamespacedComponent#MyFeature.MyAppMainAnyFlagEventNamespacedRemovedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainAnyFlagEventNamespacedRemovedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic interface IMyAppMainAnyFlagEventNamespacedRemovedListener\n{\n    void OnAnyFlagEventNamespacedRemoved(global::MyApp.Main.Entity entity);\n}\n\npublic sealed class MyAppMainAnyFlagEventNamespacedRemovedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainAnyFlagEventNamespacedRemovedListener> Value;\n}\n\npublic static class MyAppMainAnyFlagEventNamespacedRemovedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddAnyFlagEventNamespacedRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyFlagEventNamespacedRemovedListener value)\n    {\n        var listeners = entity.HasAnyFlagEventNamespacedRemovedListener()\n            ? entity.GetAnyFlagEventNamespacedRemovedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainAnyFlagEventNamespacedRemovedListener>();\n        listeners.Add(value);\n        return entity.ReplaceAnyFlagEventNamespacedRemovedListener(listeners);\n    }\n\n    public static void RemoveAnyFlagEventNamespacedRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainAnyFlagEventNamespacedRemovedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetAnyFlagEventNamespacedRemovedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveAnyFlagEventNamespacedRemovedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceAnyFlagEventNamespacedRemovedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainAnyFlagEventNamespacedRemovedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::Entitas.IGroup<global::MyApp.Main.Entity> _listeners;\n    readonly global::System.Collections.Generic.List<global::MyApp.Main.Entity> _entityBuffer;\n    readonly global::System.Collections.Generic.List<IMyAppMainAnyFlagEventNamespacedRemovedListener> _listenerBuffer;\n\n    public MyAppMainAnyFlagEventNamespacedRemovedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listeners = context.GetGroup(MyAppMainAnyFlagEventNamespacedRemovedListenerMatcher.AnyFlagEventNamespacedRemovedListener);\n        _entityBuffer = new global::System.Collections.Generic.List<global::MyApp.Main.Entity>();\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainAnyFlagEventNamespacedRemovedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Removed(MyAppMainFlagEventNamespacedMatcher.FlagEventNamespaced)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return !entity.HasFlagEventNamespaced();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            foreach (var listenerEntity in _listeners.GetEntities(_entityBuffer))\n            {\n                _listenerBuffer.Clear();\n                _listenerBuffer.AddRange(listenerEntity.GetAnyFlagEventNamespacedRemovedListener().Value);\n                foreach (var listener in _listenerBuffer)\n                {\n                    listener.OnAnyFlagEventNamespacedRemoved(entity);\n                }\n            }\n        }\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.FlagEventNamespacedComponent#MyFeature.MyAppMainFlagEventNamespacedAddedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainFlagEventNamespacedAddedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic interface IMyAppMainFlagEventNamespacedAddedListener\n{\n    void OnFlagEventNamespacedAdded(global::MyApp.Main.Entity entity);\n}\n\npublic sealed class MyAppMainFlagEventNamespacedAddedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainFlagEventNamespacedAddedListener> Value;\n}\n\npublic static class MyAppMainFlagEventNamespacedAddedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddFlagEventNamespacedAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainFlagEventNamespacedAddedListener value)\n    {\n        var listeners = entity.HasFlagEventNamespacedAddedListener()\n            ? entity.GetFlagEventNamespacedAddedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainFlagEventNamespacedAddedListener>();\n        listeners.Add(value);\n        return entity.ReplaceFlagEventNamespacedAddedListener(listeners);\n    }\n\n    public static void RemoveFlagEventNamespacedAddedListener(this global::MyApp.Main.Entity entity, IMyAppMainFlagEventNamespacedAddedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetFlagEventNamespacedAddedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveFlagEventNamespacedAddedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceFlagEventNamespacedAddedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainFlagEventNamespacedAddedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::System.Collections.Generic.List<IMyAppMainFlagEventNamespacedAddedListener> _listenerBuffer;\n\n    public MyAppMainFlagEventNamespacedAddedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainFlagEventNamespacedAddedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Added(MyAppMainFlagEventNamespacedMatcher.FlagEventNamespaced)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return entity.HasFlagEventNamespaced() && entity.HasFlagEventNamespacedAddedListener();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            _listenerBuffer.Clear();\n            _listenerBuffer.AddRange(entity.GetFlagEventNamespacedAddedListener().Value);\n            foreach (var listener in _listenerBuffer)\n            {\n                listener.OnFlagEventNamespacedAdded(entity);\n            }\n        }\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.FlagEventNamespacedComponent#MyFeature.MyAppMainFlagEventNamespacedRemovedListenerComponent.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainFlagEventNamespacedRemovedListenerComponent.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Events\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic interface IMyAppMainFlagEventNamespacedRemovedListener\n{\n    void OnFlagEventNamespacedRemoved(global::MyApp.Main.Entity entity);\n}\n\npublic sealed class MyAppMainFlagEventNamespacedRemovedListenerComponent : global::Entitas.IComponent\n{\n    public global::System.Collections.Generic.List<IMyAppMainFlagEventNamespacedRemovedListener> Value;\n}\n\npublic static class MyAppMainFlagEventNamespacedRemovedListenerEventEntityExtension\n{\n    public static global::MyApp.Main.Entity AddFlagEventNamespacedRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainFlagEventNamespacedRemovedListener value)\n    {\n        var listeners = entity.HasFlagEventNamespacedRemovedListener()\n            ? entity.GetFlagEventNamespacedRemovedListener().Value\n            : new global::System.Collections.Generic.List<IMyAppMainFlagEventNamespacedRemovedListener>();\n        listeners.Add(value);\n        return entity.ReplaceFlagEventNamespacedRemovedListener(listeners);\n    }\n\n    public static void RemoveFlagEventNamespacedRemovedListener(this global::MyApp.Main.Entity entity, IMyAppMainFlagEventNamespacedRemovedListener value, bool removeListenerWhenEmpty = true)\n    {\n        var listeners = entity.GetFlagEventNamespacedRemovedListener().Value;\n        listeners.Remove(value);\n        if (removeListenerWhenEmpty && listeners.Count == 0)\n        {\n            entity.RemoveFlagEventNamespacedRemovedListener();\n            if (entity.IsEmpty())\n                entity.Destroy();\n        }\n        else\n        {\n            entity.ReplaceFlagEventNamespacedRemovedListener(listeners);\n        }\n    }\n}\n\npublic sealed class MyAppMainFlagEventNamespacedRemovedEventSystem : global::Entitas.ReactiveSystem<global::MyApp.Main.Entity>\n{\n    readonly global::System.Collections.Generic.List<IMyAppMainFlagEventNamespacedRemovedListener> _listenerBuffer;\n\n    public MyAppMainFlagEventNamespacedRemovedEventSystem(MyApp.MainContext context) : base(context)\n    {\n        _listenerBuffer = new global::System.Collections.Generic.List<IMyAppMainFlagEventNamespacedRemovedListener>();\n    }\n\n    protected override global::Entitas.ICollector<global::MyApp.Main.Entity> GetTrigger(global::Entitas.IContext<global::MyApp.Main.Entity> context)\n    {\n        return global::Entitas.CollectorContextExtension.CreateCollector(\n            context, global::Entitas.TriggerOnEventMatcherExtension.Removed(MyAppMainFlagEventNamespacedMatcher.FlagEventNamespaced)\n        );\n    }\n\n    protected override bool Filter(global::MyApp.Main.Entity entity)\n    {\n        return !entity.HasFlagEventNamespaced() && entity.HasFlagEventNamespacedRemovedListener();\n    }\n\n    protected override void Execute(global::System.Collections.Generic.List<global::MyApp.Main.Entity> entities)\n    {\n        foreach (var entity in entities)\n        {\n            _listenerBuffer.Clear();\n            _listenerBuffer.AddRange(entity.GetFlagEventNamespacedRemovedListener().Value);\n            foreach (var listener in _listenerBuffer)\n            {\n                listener.OnFlagEventNamespacedRemoved(entity);\n            }\n        }\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.MultipleFieldsComponent#MyAppMainMultipleFieldsEntityExtension.g.verified.cs",
    "content": "﻿//HintName: MyAppMainMultipleFieldsEntityExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic static class MyAppMainMultipleFieldsEntityExtension\n{\n    public static bool HasMultipleFields(this global::MyApp.Main.Entity entity)\n    {\n        return entity.HasComponent(MyAppMainMultipleFieldsComponentIndex.Index.Value);\n    }\n\n    public static global::MyApp.Main.Entity AddMultipleFields(this global::MyApp.Main.Entity entity, string value1, string value2, string value3)\n    {\n        var index = MyAppMainMultipleFieldsComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (MultipleFieldsComponent)componentPool.Pop()\n            : new MultipleFieldsComponent();\n        component.Value1 = value1;\n        component.Value2 = value2;\n        component.Value3 = value3;\n        entity.AddComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity ReplaceMultipleFields(this global::MyApp.Main.Entity entity, string value1, string value2, string value3)\n    {\n        var index = MyAppMainMultipleFieldsComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (MultipleFieldsComponent)componentPool.Pop()\n            : new MultipleFieldsComponent();\n        component.Value1 = value1;\n        component.Value2 = value2;\n        component.Value3 = value3;\n        entity.ReplaceComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity RemoveMultipleFields(this global::MyApp.Main.Entity entity)\n    {\n        entity.RemoveComponent(MyAppMainMultipleFieldsComponentIndex.Index.Value);\n        return entity;\n    }\n\n    public static MultipleFieldsComponent GetMultipleFields(this global::MyApp.Main.Entity entity)\n    {\n        return (MultipleFieldsComponent)entity.GetComponent(MyAppMainMultipleFieldsComponentIndex.Index.Value);\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.MultipleFieldsNamespacedComponent#MyFeature.MyAppMainMultipleFieldsNamespacedEntityExtension.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainMultipleFieldsNamespacedEntityExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic static class MyAppMainMultipleFieldsNamespacedEntityExtension\n{\n    public static bool HasMultipleFieldsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return entity.HasComponent(MyAppMainMultipleFieldsNamespacedComponentIndex.Index.Value);\n    }\n\n    public static global::MyApp.Main.Entity AddMultipleFieldsNamespaced(this global::MyApp.Main.Entity entity, string value1, string value2, string value3)\n    {\n        var index = MyAppMainMultipleFieldsNamespacedComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (MultipleFieldsNamespacedComponent)componentPool.Pop()\n            : new MultipleFieldsNamespacedComponent();\n        component.Value1 = value1;\n        component.Value2 = value2;\n        component.Value3 = value3;\n        entity.AddComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity ReplaceMultipleFieldsNamespaced(this global::MyApp.Main.Entity entity, string value1, string value2, string value3)\n    {\n        var index = MyAppMainMultipleFieldsNamespacedComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (MultipleFieldsNamespacedComponent)componentPool.Pop()\n            : new MultipleFieldsNamespacedComponent();\n        component.Value1 = value1;\n        component.Value2 = value2;\n        component.Value3 = value3;\n        entity.ReplaceComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity RemoveMultipleFieldsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        entity.RemoveComponent(MyAppMainMultipleFieldsNamespacedComponentIndex.Index.Value);\n        return entity;\n    }\n\n    public static MultipleFieldsNamespacedComponent GetMultipleFieldsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return (MultipleFieldsNamespacedComponent)entity.GetComponent(MyAppMainMultipleFieldsNamespacedComponentIndex.Index.Value);\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.MultiplePropertiesNamespacedComponent#MyFeature.MyAppMainMultiplePropertiesNamespacedEntityExtension.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainMultiplePropertiesNamespacedEntityExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic static class MyAppMainMultiplePropertiesNamespacedEntityExtension\n{\n    public static bool HasMultiplePropertiesNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return entity.HasComponent(MyAppMainMultiplePropertiesNamespacedComponentIndex.Index.Value);\n    }\n\n    public static global::MyApp.Main.Entity AddMultiplePropertiesNamespaced(this global::MyApp.Main.Entity entity, string value1, string value2, string value3)\n    {\n        var index = MyAppMainMultiplePropertiesNamespacedComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (MultiplePropertiesNamespacedComponent)componentPool.Pop()\n            : new MultiplePropertiesNamespacedComponent();\n        component.Value1 = value1;\n        component.Value2 = value2;\n        component.Value3 = value3;\n        entity.AddComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity ReplaceMultiplePropertiesNamespaced(this global::MyApp.Main.Entity entity, string value1, string value2, string value3)\n    {\n        var index = MyAppMainMultiplePropertiesNamespacedComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (MultiplePropertiesNamespacedComponent)componentPool.Pop()\n            : new MultiplePropertiesNamespacedComponent();\n        component.Value1 = value1;\n        component.Value2 = value2;\n        component.Value3 = value3;\n        entity.ReplaceComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity RemoveMultiplePropertiesNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        entity.RemoveComponent(MyAppMainMultiplePropertiesNamespacedComponentIndex.Index.Value);\n        return entity;\n    }\n\n    public static MultiplePropertiesNamespacedComponent GetMultiplePropertiesNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return (MultiplePropertiesNamespacedComponent)entity.GetComponent(MyAppMainMultiplePropertiesNamespacedComponentIndex.Index.Value);\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.NamespacedComponent#MyFeature.MyAppMainSomeNamespacedComponentIndex.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainSomeNamespacedComponentIndex.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.ComponentIndex\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic static class MyAppMainSomeNamespacedComponentIndex\n{\n    public static global::MyApp.Main.ComponentIndex Index;\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.NamespacedComponent#MyFeature.MyAppMainSomeNamespacedEntityExtension.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainSomeNamespacedEntityExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic static class MyAppMainSomeNamespacedEntityExtension\n{\n    static readonly SomeNamespacedComponent SingleSomeNamespacedComponent = new SomeNamespacedComponent();\n\n    public static bool HasSomeNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return entity.HasComponent(MyAppMainSomeNamespacedComponentIndex.Index.Value);\n    }\n\n    public static global::MyApp.Main.Entity AddSomeNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        entity.AddComponent(MyAppMainSomeNamespacedComponentIndex.Index.Value, SingleSomeNamespacedComponent);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity ReplaceSomeNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        entity.ReplaceComponent(MyAppMainSomeNamespacedComponentIndex.Index.Value, SingleSomeNamespacedComponent);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity RemoveSomeNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        entity.RemoveComponent(MyAppMainSomeNamespacedComponentIndex.Index.Value);\n        return entity;\n    }\n\n    public static SomeNamespacedComponent GetSomeNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return (SomeNamespacedComponent)entity.GetComponent(MyAppMainSomeNamespacedComponentIndex.Index.Value);\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.NamespacedComponent#MyFeature.MyAppMainSomeNamespacedMatcher.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainSomeNamespacedMatcher.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.Matcher\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic static class MyAppMainSomeNamespacedMatcher\n{\n    static global::Entitas.IMatcher<global::MyApp.Main.Entity> _matcher;\n\n    public static global::Entitas.IMatcher<global::MyApp.Main.Entity> SomeNamespaced\n    {\n        get\n        {\n            if (_matcher == null)\n            {\n                var matcher = (global::Entitas.Matcher<global::MyApp.Main.Entity>)global::Entitas.Matcher<global::MyApp.Main.Entity>.AllOf(MyAppMainSomeNamespacedComponentIndex.Index.Value);\n                matcher.ComponentNames = MyApp.MainContext.ComponentNames;\n                _matcher = matcher;\n            }\n\n            return _matcher;\n        }\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.NoCleanupSystems#EmptyContextCleanupSystemsExtension.g.verified.cs",
    "content": "﻿//HintName: EmptyContextCleanupSystemsExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.CleanupSystems\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic static class EmptyContextCleanupSystemsExtension\n{\n    public static global::Entitas.Systems CreateCleanupSystems(this EmptyContext context)\n    {\n        return null;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.NoEntityIndexes#EmptyContextEntityIndexExtension.g.verified.cs",
    "content": "﻿//HintName: EmptyContextEntityIndexExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityIndexExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic static class EmptyContextEntityIndexExtension\n{\n    public static EmptyContext AddAllEntityIndexes(this EmptyContext context)\n    {\n        return context;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.NoEventSystems#EmptyContextEventSystemsExtension.g.verified.cs",
    "content": "﻿//HintName: EmptyContextEventSystemsExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EventSystemsContextExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic static class EmptyContextEventSystemsExtension\n{\n    public static global::Entitas.Systems CreateEventSystems(this EmptyContext context)\n    {\n        return null;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.NoValidFieldsNamespacedComponent#MyFeature.MyAppMainNoValidFieldsNamespacedEntityExtension.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainNoValidFieldsNamespacedEntityExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic static class MyAppMainNoValidFieldsNamespacedEntityExtension\n{\n    static readonly NoValidFieldsNamespacedComponent SingleNoValidFieldsNamespacedComponent = new NoValidFieldsNamespacedComponent();\n\n    public static bool HasNoValidFieldsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return entity.HasComponent(MyAppMainNoValidFieldsNamespacedComponentIndex.Index.Value);\n    }\n\n    public static global::MyApp.Main.Entity AddNoValidFieldsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        entity.AddComponent(MyAppMainNoValidFieldsNamespacedComponentIndex.Index.Value, SingleNoValidFieldsNamespacedComponent);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity ReplaceNoValidFieldsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        entity.ReplaceComponent(MyAppMainNoValidFieldsNamespacedComponentIndex.Index.Value, SingleNoValidFieldsNamespacedComponent);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity RemoveNoValidFieldsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        entity.RemoveComponent(MyAppMainNoValidFieldsNamespacedComponentIndex.Index.Value);\n        return entity;\n    }\n\n    public static NoValidFieldsNamespacedComponent GetNoValidFieldsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return (NoValidFieldsNamespacedComponent)entity.GetComponent(MyAppMainNoValidFieldsNamespacedComponentIndex.Index.Value);\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.OneFieldComponent#MyAppMainOneFieldEntityExtension.g.verified.cs",
    "content": "﻿//HintName: MyAppMainOneFieldEntityExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic static class MyAppMainOneFieldEntityExtension\n{\n    public static bool HasOneField(this global::MyApp.Main.Entity entity)\n    {\n        return entity.HasComponent(MyAppMainOneFieldComponentIndex.Index.Value);\n    }\n\n    public static global::MyApp.Main.Entity AddOneField(this global::MyApp.Main.Entity entity, string value)\n    {\n        var index = MyAppMainOneFieldComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (OneFieldComponent)componentPool.Pop()\n            : new OneFieldComponent();\n        component.Value = value;\n        entity.AddComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity ReplaceOneField(this global::MyApp.Main.Entity entity, string value)\n    {\n        var index = MyAppMainOneFieldComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (OneFieldComponent)componentPool.Pop()\n            : new OneFieldComponent();\n        component.Value = value;\n        entity.ReplaceComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity RemoveOneField(this global::MyApp.Main.Entity entity)\n    {\n        entity.RemoveComponent(MyAppMainOneFieldComponentIndex.Index.Value);\n        return entity;\n    }\n\n    public static OneFieldComponent GetOneField(this global::MyApp.Main.Entity entity)\n    {\n        return (OneFieldComponent)entity.GetComponent(MyAppMainOneFieldComponentIndex.Index.Value);\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.OneFieldNamespacedComponent#MyFeature.MyAppMainOneFieldNamespacedEntityExtension.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainOneFieldNamespacedEntityExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic static class MyAppMainOneFieldNamespacedEntityExtension\n{\n    public static bool HasOneFieldNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return entity.HasComponent(MyAppMainOneFieldNamespacedComponentIndex.Index.Value);\n    }\n\n    public static global::MyApp.Main.Entity AddOneFieldNamespaced(this global::MyApp.Main.Entity entity, string value)\n    {\n        var index = MyAppMainOneFieldNamespacedComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (OneFieldNamespacedComponent)componentPool.Pop()\n            : new OneFieldNamespacedComponent();\n        component.Value = value;\n        entity.AddComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity ReplaceOneFieldNamespaced(this global::MyApp.Main.Entity entity, string value)\n    {\n        var index = MyAppMainOneFieldNamespacedComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (OneFieldNamespacedComponent)componentPool.Pop()\n            : new OneFieldNamespacedComponent();\n        component.Value = value;\n        entity.ReplaceComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity RemoveOneFieldNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        entity.RemoveComponent(MyAppMainOneFieldNamespacedComponentIndex.Index.Value);\n        return entity;\n    }\n\n    public static OneFieldNamespacedComponent GetOneFieldNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return (OneFieldNamespacedComponent)entity.GetComponent(MyAppMainOneFieldNamespacedComponentIndex.Index.Value);\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.ReservedKeywordFieldsNamespacedComponent#MyFeature.MyAppMainReservedKeywordFieldsNamespacedEntityExtension.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainReservedKeywordFieldsNamespacedEntityExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.EntityExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic static class MyAppMainReservedKeywordFieldsNamespacedEntityExtension\n{\n    public static bool HasReservedKeywordFieldsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return entity.HasComponent(MyAppMainReservedKeywordFieldsNamespacedComponentIndex.Index.Value);\n    }\n\n    public static global::MyApp.Main.Entity AddReservedKeywordFieldsNamespaced(this global::MyApp.Main.Entity entity, string @namespace, string @class, string @public)\n    {\n        var index = MyAppMainReservedKeywordFieldsNamespacedComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (ReservedKeywordFieldsNamespacedComponent)componentPool.Pop()\n            : new ReservedKeywordFieldsNamespacedComponent();\n        component.Namespace = @namespace;\n        component.Class = @class;\n        component.Public = @public;\n        entity.AddComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity ReplaceReservedKeywordFieldsNamespaced(this global::MyApp.Main.Entity entity, string @namespace, string @class, string @public)\n    {\n        var index = MyAppMainReservedKeywordFieldsNamespacedComponentIndex.Index.Value;\n        var componentPool = entity.GetComponentPool(index);\n        var component = componentPool.Count > 0\n            ? (ReservedKeywordFieldsNamespacedComponent)componentPool.Pop()\n            : new ReservedKeywordFieldsNamespacedComponent();\n        component.Namespace = @namespace;\n        component.Class = @class;\n        component.Public = @public;\n        entity.ReplaceComponent(index, component);\n        return entity;\n    }\n\n    public static global::MyApp.Main.Entity RemoveReservedKeywordFieldsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        entity.RemoveComponent(MyAppMainReservedKeywordFieldsNamespacedComponentIndex.Index.Value);\n        return entity;\n    }\n\n    public static ReservedKeywordFieldsNamespacedComponent GetReservedKeywordFieldsNamespaced(this global::MyApp.Main.Entity entity)\n    {\n        return (ReservedKeywordFieldsNamespacedComponent)entity.GetComponent(MyAppMainReservedKeywordFieldsNamespacedComponentIndex.Index.Value);\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.UniqueNamespacedComponent#MyFeature.MyAppMainUniqueNamespacedContextExtension.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainUniqueNamespacedContextExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.ContextExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic static class MyAppMainUniqueNamespacedContextExtension\n{\n    public static bool HasUniqueNamespaced(this global::MyApp.MainContext context)\n    {\n        return context.GetUniqueNamespacedEntity() != null;\n    }\n\n    public static global::MyApp.Main.Entity SetUniqueNamespaced(this global::MyApp.MainContext context)\n    {\n        return context.GetUniqueNamespacedEntity() ?? context.CreateEntity().AddUniqueNamespaced();\n    }\n\n    public static void UnsetUniqueNamespaced(this global::MyApp.MainContext context)\n    {\n        context.GetUniqueNamespacedEntity()?.Destroy();\n    }\n\n    public static global::MyApp.Main.Entity GetUniqueNamespacedEntity(this global::MyApp.MainContext context)\n    {\n        return context.GetGroup(MyAppMainUniqueNamespacedMatcher.UniqueNamespaced).GetSingleEntity();\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ComponentGeneratorTests.UniqueOneFieldNamespacedComponent#MyFeature.MyAppMainUniqueOneFieldNamespacedContextExtension.g.verified.cs",
    "content": "﻿//HintName: MyFeature.MyAppMainUniqueOneFieldNamespacedContextExtension.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ComponentGenerator.ContextExtension\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyFeature\n{\npublic static class MyAppMainUniqueOneFieldNamespacedContextExtension\n{\n    public static bool HasUniqueOneFieldNamespaced(this global::MyApp.MainContext context)\n    {\n        return context.GetUniqueOneFieldNamespacedEntity() != null;\n    }\n\n    public static global::MyApp.Main.Entity SetUniqueOneFieldNamespaced(this global::MyApp.MainContext context, string value)\n    {\n        if (context.HasUniqueOneFieldNamespaced())\n        {\n            throw new global::Entitas.EntitasException(\n                $\"Could not set UniqueOneFieldNamespaced!\\n{context} already has an entity with MyFeature.UniqueOneFieldNamespacedComponent!\",\n                \"You should check if the context already has a UniqueOneFieldNamespacedEntity before setting it or use context.ReplaceUniqueOneFieldNamespaced().\"\n            );\n        }\n\n        return context.CreateEntity().AddUniqueOneFieldNamespaced(value);\n    }\n\n    public static global::MyApp.Main.Entity ReplaceUniqueOneFieldNamespaced(this global::MyApp.MainContext context, string value)\n    {\n        var entity = context.GetUniqueOneFieldNamespacedEntity();\n        if (entity == null)\n            entity = context.CreateEntity().AddUniqueOneFieldNamespaced(value);\n        else\n            entity.ReplaceUniqueOneFieldNamespaced(value);\n\n        return entity;\n    }\n\n    public static void RemoveUniqueOneFieldNamespaced(this global::MyApp.MainContext context)\n    {\n        context.GetUniqueOneFieldNamespacedEntity().Destroy();\n    }\n\n    public static global::MyApp.Main.Entity GetUniqueOneFieldNamespacedEntity(this global::MyApp.MainContext context)\n    {\n        return context.GetGroup(MyAppMainUniqueOneFieldNamespacedMatcher.UniqueOneFieldNamespaced).GetSingleEntity();\n    }\n\n    public static UniqueOneFieldNamespacedComponent GetUniqueOneFieldNamespaced(this global::MyApp.MainContext context)\n    {\n        return context.GetUniqueOneFieldNamespacedEntity().GetUniqueOneFieldNamespaced();\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ContextGeneratorTests.NamespacedContext#MyApp.Namespaced.ComponentIndex.g.verified.cs",
    "content": "﻿//HintName: MyApp.Namespaced.ComponentIndex.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ContextGenerator.ComponentIndex\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyApp.Namespaced\n{\npublic readonly struct ComponentIndex : global::System.IEquatable<ComponentIndex>\n{\n    public readonly int Value;\n\n    public ComponentIndex(int value)\n    {\n        Value = value;\n    }\n\n    public bool Equals(ComponentIndex other) => Value == other.Value;\n#nullable enable\n    public override bool Equals(object? obj) => obj is ComponentIndex other && Equals(other);\n#nullable disable\n    public override int GetHashCode() => Value;\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ContextGeneratorTests.NamespacedContext#MyApp.Namespaced.Entity.g.verified.cs",
    "content": "﻿//HintName: MyApp.Namespaced.Entity.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ContextGenerator.Entity\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyApp.Namespaced\n{\npublic sealed class Entity : global::Entitas.Entity { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ContextGeneratorTests.NamespacedContext#MyApp.Namespaced.Matcher.g.verified.cs",
    "content": "﻿//HintName: MyApp.Namespaced.Matcher.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ContextGenerator.Matcher\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyApp.Namespaced\n{\npublic static class Matcher\n{\n    public static global::Entitas.IAllOfMatcher<Entity> AllOf(params int[] indexes)\n    {\n        return global::Entitas.Matcher<Entity>.AllOf(indexes);\n    }\n\n    public static global::Entitas.IAllOfMatcher<Entity> AllOf(params global::Entitas.IMatcher<Entity>[] matchers)\n    {\n        return global::Entitas.Matcher<Entity>.AllOf(matchers);\n    }\n\n    public static global::Entitas.IAnyOfMatcher<Entity> AnyOf(params int[] indexes)\n    {\n        return global::Entitas.Matcher<Entity>.AnyOf(indexes);\n    }\n\n    public static global::Entitas.IAnyOfMatcher<Entity> AnyOf(params global::Entitas.IMatcher<Entity>[] matchers)\n    {\n        return global::Entitas.Matcher<Entity>.AnyOf(matchers);\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ContextGeneratorTests.NamespacedContext#MyApp.NamespacedContext.g.verified.cs",
    "content": "﻿//HintName: MyApp.NamespacedContext.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ContextGenerator.Context\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace MyApp\n{\npublic sealed partial class NamespacedContext : global::Entitas.Context<Namespaced.Entity>\n{\n    public static string[] ComponentNames;\n    public static global::System.Type[] ComponentTypes;\n\n    public NamespacedContext() :\n        base(\n            ComponentTypes.Length,\n            0,\n            new global::Entitas.ContextInfo(\n                \"MyApp.NamespacedContext\",\n                ComponentNames,\n                ComponentTypes\n            ),\n#if (ENTITAS_FAST_AND_UNSAFE)\n            global::Entitas.UnsafeAERC.Delegate,\n#else\n            global::Entitas.SafeAERC.Delegate,\n#endif\n            () => new Namespaced.Entity()\n        ) { }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ContextGeneratorTests.SomeContext#Some.ComponentIndex.g.verified.cs",
    "content": "﻿//HintName: Some.ComponentIndex.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ContextGenerator.ComponentIndex\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace Some\n{\npublic readonly struct ComponentIndex : global::System.IEquatable<ComponentIndex>\n{\n    public readonly int Value;\n\n    public ComponentIndex(int value)\n    {\n        Value = value;\n    }\n\n    public bool Equals(ComponentIndex other) => Value == other.Value;\n#nullable enable\n    public override bool Equals(object? obj) => obj is ComponentIndex other && Equals(other);\n#nullable disable\n    public override int GetHashCode() => Value;\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ContextGeneratorTests.SomeContext#Some.Entity.g.verified.cs",
    "content": "﻿//HintName: Some.Entity.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ContextGenerator.Entity\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace Some\n{\npublic sealed class Entity : global::Entitas.Entity { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ContextGeneratorTests.SomeContext#Some.Matcher.g.verified.cs",
    "content": "﻿//HintName: Some.Matcher.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ContextGenerator.Matcher\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\nnamespace Some\n{\npublic static class Matcher\n{\n    public static global::Entitas.IAllOfMatcher<Entity> AllOf(params int[] indexes)\n    {\n        return global::Entitas.Matcher<Entity>.AllOf(indexes);\n    }\n\n    public static global::Entitas.IAllOfMatcher<Entity> AllOf(params global::Entitas.IMatcher<Entity>[] matchers)\n    {\n        return global::Entitas.Matcher<Entity>.AllOf(matchers);\n    }\n\n    public static global::Entitas.IAnyOfMatcher<Entity> AnyOf(params int[] indexes)\n    {\n        return global::Entitas.Matcher<Entity>.AnyOf(indexes);\n    }\n\n    public static global::Entitas.IAnyOfMatcher<Entity> AnyOf(params global::Entitas.IMatcher<Entity>[] matchers)\n    {\n        return global::Entitas.Matcher<Entity>.AnyOf(matchers);\n    }\n}\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots/ContextGeneratorTests.SomeContext#SomeContext.g.verified.cs",
    "content": "﻿//HintName: SomeContext.g.cs\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by\n//     Entitas.Generators.ContextGenerator.Context\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\npublic sealed partial class SomeContext : global::Entitas.Context<Some.Entity>\n{\n    public static string[] ComponentNames;\n    public static global::System.Type[] ComponentTypes;\n\n    public SomeContext() :\n        base(\n            ComponentTypes.Length,\n            0,\n            new global::Entitas.ContextInfo(\n                \"SomeContext\",\n                ComponentNames,\n                ComponentTypes\n            ),\n#if (ENTITAS_FAST_AND_UNSAFE)\n            global::Entitas.UnsafeAERC.Delegate,\n#else\n            global::Entitas.SafeAERC.Delegate,\n#endif\n            () => new Some.Entity()\n        ) { }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests/snapshots-to-delete.txt",
    "content": ""
  },
  {
    "path": "tests/Entitas.Generators.Tests.Fixtures.Dependencies/CollisionComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyOtherFeature\n{\n    [Context(typeof(LibraryContext))]\n    [Event(EventTarget.Self, EventType.Added, 1)]\n    public class CollisionComponent : IComponent\n    {\n        public int Value;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests.Fixtures.Dependencies/ContextInitialization.cs",
    "content": "using Entitas.Generators.Attributes;\n\nnamespace MyApp.Library\n{\n    public static partial class ContextInitialization\n    {\n        [ContextInitialization(typeof(LibraryContext))]\n        public static partial void InitializeMain();\n    }\n}\n\nnamespace MyApp.Library\n{\n    public static partial class ContextInitialization\n    {\n        public static partial void InitializeMain()\n        {\n            MyApp.LibraryContext.ComponentNames = new string[] { };\n\n            MyApp.LibraryContext.ComponentTypes = new global::System.Type[] { };\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests.Fixtures.Dependencies/Entitas.Generators.Tests.Fixtures.Dependencies.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>$(DefaultTargetFramework)</TargetFramework>\n    <IsPackable>false</IsPackable>\n    <IsPublishable>false</IsPublishable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"../../src/Entitas/Entitas.csproj\" />\n    <ProjectReference Include=\"../../src/Entitas.Generators.Attributes/Entitas.Generators.Attributes.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests.Fixtures.Dependencies/HealthComponent.cs",
    "content": "using Entitas;\nusing Entitas.Generators.Attributes;\nusing MyApp;\n\nnamespace MyOtherFeature\n{\n    [Context(typeof(LibraryContext))]\n    public class HealthComponent : IComponent\n    {\n        public int Value;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests.Fixtures.Dependencies/LibraryContext.cs",
    "content": "using Entitas;\n\nnamespace MyApp\n{\n    partial class LibraryContext : IContext { }\n}\n\nnamespace MyApp\n{\n    public sealed partial class LibraryContext : global::Entitas.Context<Library.Entity>\n    {\n        public static string[] ComponentNames;\n        public static global::System.Type[] ComponentTypes;\n\n        public LibraryContext() :\n            base(\n                ComponentTypes.Length,\n                0,\n                new global::Entitas.ContextInfo(\n                    \"MyApp.LibraryContext\",\n                    ComponentNames,\n                    ComponentTypes\n                ),\n                entity =>\n#if (ENTITAS_FAST_AND_UNSAFE)\n                    new global::Entitas.UnsafeAERC(),\n#else\n                    new global::Entitas.SafeAERC(entity),\n#endif\n                () => new Library.Entity()\n            ) { }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Generators.Tests.Fixtures.Dependencies/MyApp.Library.Entity.cs",
    "content": "namespace MyApp.Library\n{\n    public sealed class Entity : global::Entitas.Entity { }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/CollectorTests.cs",
    "content": "﻿using FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Tests\n{\n    public class CollectorTests\n    {\n        readonly TestContext _context;\n        readonly IGroup<TestEntity> _groupA;\n        readonly IGroup<TestEntity> _groupB;\n\n        public CollectorTests()\n        {\n            _context = new TestContext(CID.TotalComponents);\n            _groupA = _context.GetGroup(Matcher<TestEntity>.AllOf(CID.ComponentA));\n            _groupB = _context.GetGroup(Matcher<TestEntity>.AllOf(CID.ComponentB));\n        }\n\n        [Fact]\n        public void IsEmpty()\n        {\n            var collector = new Collector<TestEntity>(_groupA, GroupEvent.Added);\n            collector.CollectedEntities.Should().BeEmpty();\n        }\n\n        [Fact]\n        public void ReturnsCollectedEntitiesOnAdded()\n        {\n            var collector = new Collector<TestEntity>(_groupA, GroupEvent.Added);\n            var entity = _context.CreateEntity().AddComponentA();\n            var entities = collector.CollectedEntities;\n            entities.Should().HaveCount(1);\n            entities.Should().Contain(entity);\n        }\n\n        [Fact]\n        public void OnlyCollectsMatchingEntities()\n        {\n            var collector = new Collector<TestEntity>(_groupA, GroupEvent.Added);\n            var entity = _context.CreateEntity().AddComponentA();\n            var unused = _context.CreateEntity().AddComponentB();\n            var entities = collector.CollectedEntities;\n            entities.Should().HaveCount(1);\n            entities.Should().Contain(entity);\n        }\n\n        [Fact]\n        public void CollectsEntitiesOnlyOnce()\n        {\n            var collector = new Collector<TestEntity>(_groupA, GroupEvent.Added);\n            var entity = _context.CreateEntity()\n                .AddComponentA()\n                .RemoveComponentA()\n                .AddComponentA();\n            var entities = collector.CollectedEntities;\n            entities.Should().HaveCount(1);\n            entities.Should().Contain(entity);\n        }\n\n        [Fact]\n        public void ClearsCollectedEntities()\n        {\n            var collector = new Collector<TestEntity>(_groupA, GroupEvent.Added);\n            _context.CreateEntity().AddComponentA();\n            collector.ClearCollectedEntities();\n            collector.CollectedEntities.Should().BeEmpty();\n        }\n\n        [Fact]\n        public void ClearsCollectedEntitiesWhenDeactivating()\n        {\n            var collector = new Collector<TestEntity>(_groupA, GroupEvent.Added);\n            _context.CreateEntity().AddComponentA();\n            collector.Deactivate();\n            collector.CollectedEntities.Should().BeEmpty();\n        }\n\n        [Fact]\n        public void DoesNotCollectEntitiesWhenDeactivated()\n        {\n            var collector = new Collector<TestEntity>(_groupA, GroupEvent.Added);\n            _context.CreateEntity().AddComponentA();\n            collector.Deactivate();\n            _context.CreateEntity().AddComponentA();\n            collector.CollectedEntities.Should().BeEmpty();\n        }\n\n        [Fact]\n        public void ContinuesCollectingWhenActivated()\n        {\n            var collector = new Collector<TestEntity>(_groupA, GroupEvent.Added);\n            _context.CreateEntity().AddComponentA();\n            collector.Deactivate();\n            _context.CreateEntity().AddComponentA();\n            collector.Activate();\n            var entity = _context.CreateEntity().AddComponentA();\n            var entities = collector.CollectedEntities;\n            entities.Should().HaveCount(1);\n            entities.Should().Contain(entity);\n        }\n\n        [Fact]\n        public void CanToString()\n        {\n            var collector = new Collector<TestEntity>(_groupA, GroupEvent.Added);\n            _context.CreateEntity().AddComponentA();\n            collector.ToString().Should().Be(\"Collector(Group(AllOf(1)))\");\n        }\n\n        [Fact]\n        public void RetainsEntityEvenAfterDestroy()\n        {\n            var collector = new Collector<TestEntity>(_groupA, GroupEvent.Added);\n            var entity = _context.CreateEntity().AddComponentA();\n            entity.Destroy();\n            entity.RetainCount.Should().Be(1);\n            (entity.Aerc as SafeAERC)!.Owners.Should().Contain(collector);\n        }\n\n        [Fact]\n        public void ReleasesEntityWhenClearingCollectedEntities()\n        {\n            var collector = new Collector<TestEntity>(_groupA, GroupEvent.Added);\n            var entity = _context.CreateEntity().AddComponentA();\n            entity.Destroy();\n            collector.ClearCollectedEntities();\n            entity.RetainCount.Should().Be(0);\n        }\n\n        [Fact]\n        public void RetainsEntitiesOnlyOnce()\n        {\n            var unused = new Collector<TestEntity>(_groupA, GroupEvent.Added);\n            var entity = _context.CreateEntity()\n                .AddComponentA()\n                .ReplaceComponentA(new ComponentA());\n            entity.Destroy();\n            entity.RetainCount.Should().Be(1);\n        }\n\n        [Fact]\n        public void ReturnsCollectedEntitiesOnRemoved()\n        {\n            var collector = new Collector<TestEntity>(_groupA, GroupEvent.Removed);\n            var entity = _context.CreateEntity().AddComponentA();\n            collector.CollectedEntities.Should().BeEmpty();\n            entity.RemoveComponentA();\n            var entities = collector.CollectedEntities;\n            entities.Should().HaveCount(1);\n            entities.Should().Contain(entity);\n        }\n\n        [Fact]\n        public void ReturnsCollectedEntitiesOnAddedOrRemoved()\n        {\n            var collector = new Collector<TestEntity>(_groupA, GroupEvent.AddedOrRemoved);\n            var entity = _context.CreateEntity().AddComponentA();\n            var entities = collector.CollectedEntities;\n            entities.Should().HaveCount(1);\n            entities.Should().Contain(entity);\n            collector.ClearCollectedEntities();\n            entity.RemoveComponentA();\n            entities = collector.CollectedEntities;\n            entities.Should().HaveCount(1);\n            entities.Should().Contain(entity);\n        }\n\n        [Fact]\n        public void ThrowsWhenGroupCountIsNotEqualGroupEventCount()\n        {\n            FluentActions.Invoking(() => new Collector<TestEntity>(\n                new[] { _groupA },\n                new[]\n                {\n                    GroupEvent.Added,\n                    GroupEvent.Added\n                }\n            )).Should().Throw<CollectorException>();\n        }\n\n        [Fact]\n        public void ReturnsCollectedEntitiesOnMultipleGroupsAdded()\n        {\n            var collector = new Collector<TestEntity>(\n                new[] { _groupA, _groupB },\n                new[]\n                {\n                    GroupEvent.Added,\n                    GroupEvent.Added\n                }\n            );\n\n            var entityA = _context.CreateEntity().AddComponentA();\n            var entityB = _context.CreateEntity().AddComponentB();\n            var entities = collector.CollectedEntities;\n            entities.Should().HaveCount(2);\n            entities.Should().Contain(entityA);\n            entities.Should().Contain(entityB);\n        }\n\n        [Fact]\n        public void CanToStringWithMultipleGroups()\n        {\n            var collector = new Collector<TestEntity>(\n                new[] { _groupA, _groupB },\n                new[]\n                {\n                    GroupEvent.Added,\n                    GroupEvent.Added\n                }\n            );\n\n            collector.ToString().Should().Be(\"Collector(Group(AllOf(1)), Group(AllOf(2)))\");\n        }\n\n        [Fact]\n        public void ReturnsCollectedEntitiesOnMultipleGroupsRemoved()\n        {\n            var collector = new Collector<TestEntity>(\n                new[] { _groupA, _groupB },\n                new[]\n                {\n                    GroupEvent.Removed,\n                    GroupEvent.Removed\n                }\n            );\n\n            var entityA = _context.CreateEntity().AddComponentA();\n            var entityB = _context.CreateEntity().AddComponentB();\n            collector.CollectedEntities.Should().BeEmpty();\n            entityA.RemoveComponentA();\n            entityB.RemoveComponentB();\n            var entities = collector.CollectedEntities;\n            entities.Should().HaveCount(2);\n            entities.Should().Contain(entityA);\n            entities.Should().Contain(entityB);\n        }\n\n        [Fact]\n        public void ReturnsCollectedEntitiesOnMultipleGroupsAddedOrRemoved()\n        {\n            var collector = new Collector<TestEntity>(\n                new[] { _groupA, _groupB },\n                new[]\n                {\n                    GroupEvent.AddedOrRemoved,\n                    GroupEvent.AddedOrRemoved\n                }\n            );\n\n            var entityA = _context.CreateEntity().AddComponentA();\n            var entityB = _context.CreateEntity().AddComponentB();\n            var entities = collector.CollectedEntities;\n            entities.Should().HaveCount(2);\n            entities.Should().Contain(entityA);\n            entities.Should().Contain(entityB);\n            collector.ClearCollectedEntities();\n\n            entityA.RemoveComponentA();\n            entityB.RemoveComponentB();\n            entities = collector.CollectedEntities;\n            entities.Should().HaveCount(2);\n            entities.Should().Contain(entityA);\n            entities.Should().Contain(entityB);\n        }\n\n        [Fact]\n        public void ReturnsCollectedEntitiesOnMixedGroupEvents()\n        {\n            var collector = new Collector<TestEntity>(\n                new[] { _groupA, _groupB },\n                new[]\n                {\n                    GroupEvent.Added,\n                    GroupEvent.Removed\n                }\n            );\n\n            var entityA = _context.CreateEntity().AddComponentA();\n            var entityB = _context.CreateEntity().AddComponentB();\n            var entities = collector.CollectedEntities;\n            entities.Should().HaveCount(1);\n            entities.Should().Contain(entityA);\n            collector.ClearCollectedEntities();\n\n            entityA.RemoveComponentA();\n            entityB.RemoveComponentB();\n            entities = collector.CollectedEntities;\n            entities.Should().HaveCount(1);\n            entities.Should().Contain(entityB);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/ContextInfoTests.cs",
    "content": "using FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Tests\n{\n    public class ContextInfoTests\n    {\n        [Fact]\n        public void SetsFieldsWithConstructorValues()\n        {\n            var contextName = \"My Context\";\n            var componentNames = new[] { \"Health\", \"Position\", \"View\" };\n            var componentTypes = new[] { typeof(ComponentA), typeof(ComponentB), typeof(ComponentC) };\n            var info = new ContextInfo(contextName, componentNames, componentTypes);\n\n            info.Name.Should().Be(contextName);\n            info.ComponentNames.Should().BeSameAs(componentNames);\n            info.ComponentTypes.Should().BeSameAs(componentTypes);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/ContextTests.cs",
    "content": "using System;\nusing System.Linq;\nusing FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Tests\n{\n    public class ContextTests\n    {\n        readonly IContext<TestEntity> _context;\n        readonly ContextInfo _contextInfo;\n        readonly IAllOfMatcher<TestEntity> _matcherAB = Matcher<TestEntity>.AllOf(CID.ComponentA, CID.ComponentB);\n\n        public ContextTests()\n        {\n            _contextInfo = new ContextInfo(\n                \"Test Context\",\n                new[] { \"Health\", \"Position\", \"View\" },\n                new[] { typeof(ComponentA), typeof(ComponentB), typeof(ComponentC) });\n\n            _context = new TestContext(CID.TotalComponents);\n        }\n\n        [Fact]\n        public void IncrementsCreationIndex()\n        {\n            _context.CreateEntity().Id.Should().Be(0);\n            _context.CreateEntity().Id.Should().Be(1);\n        }\n\n        [Fact]\n        public void StartsWithGivenCreationIndex()\n        {\n            var context = new TestContext(_contextInfo.ComponentNames.Length, 42, _contextInfo);\n            context.CreateEntity().Id.Should().Be(42);\n        }\n\n        [Fact]\n        public void IsEmpty()\n        {\n            _context.GetEntities().Should().BeEmpty();\n        }\n\n        [Fact]\n        public void TotalEntityCountIsZero()\n        {\n            _context.Count.Should().Be(0);\n        }\n\n        [Fact]\n        public void CreatesEntity()\n        {\n            var entity = _context.CreateEntity();\n            entity.Should().NotBeNull();\n            entity.GetType().Should().Be(typeof(TestEntity));\n            entity.TotalComponents.Should().Be(_context.TotalComponents);\n            entity.IsEnabled.Should().BeTrue();\n        }\n\n        [Fact]\n        public void HasDefaultContextInfo()\n        {\n            _context.ContextInfo.Name.Should().Be(\"Unnamed Context\");\n            _context.ContextInfo.ComponentNames.Length.Should().Be(CID.TotalComponents);\n            for (var i = 0; i < _context.ContextInfo.ComponentNames.Length; i++)\n                _context.ContextInfo.ComponentNames[i].Should().Be($\"Index {i}\");\n        }\n\n        [Fact]\n        public void CreatesComponentPools()\n        {\n            _context.ComponentPools.Should().NotBeNull();\n            _context.ComponentPools.Length.Should().Be(CID.TotalComponents);\n        }\n\n        [Fact]\n        public void CreatesEntityWithComponentPools()\n        {\n            _context.CreateEntity().ComponentPools\n                .Should().BeSameAs(_context.ComponentPools);\n        }\n\n        [Fact]\n        public void CanToString()\n        {\n            _context.ToString().Should().Be(\"Unnamed Context\");\n        }\n\n        [Fact]\n        public void HasCustomContextInfo()\n        {\n            var context = new TestContext(_contextInfo.ComponentNames.Length, 0, _contextInfo);\n            context.ContextInfo.Should().BeSameAs(_contextInfo);\n        }\n\n        [Fact]\n        public void CreatesEntityWithSameContextInfo()\n        {\n            var context = new TestContext(_contextInfo.ComponentNames.Length, 0, _contextInfo);\n            context.CreateEntity().ContextInfo.Should().BeSameAs(_contextInfo);\n        }\n\n        [Fact]\n        public void ThrowsWhenComponentNamesLengthIsNotEqualToTotalComponents()\n        {\n            FluentActions.Invoking(() => new TestContext(_contextInfo.ComponentNames.Length + 1, 0, _contextInfo))\n                .Should().Throw<ContextInfoException>();\n        }\n\n        [Fact]\n        public void GetsTotalEntityCount()\n        {\n            _context.CreateEntity().AddComponentA();\n            _context.Count.Should().Be(1);\n        }\n\n        [Fact]\n        public void HasEntitiesThatWereCreatedWithCreateEntity()\n        {\n            var entity = _context.CreateEntity().AddComponentA();\n            _context.HasEntity(entity).Should().BeTrue();\n        }\n\n        [Fact]\n        public void ReturnsAllCreatedEntities()\n        {\n            var entity1 = _context.CreateEntity();\n            var entity2 = _context.CreateEntity();\n            var entities = _context.GetEntities();\n            entities.Length.Should().Be(2);\n            entities.Should().Contain(entity1);\n            entities.Should().Contain(entity2);\n        }\n\n        [Fact]\n        public void DestroysEntityAndRemovesIt()\n        {\n            var entity = _context.CreateEntity();\n            entity.Destroy();\n            _context.HasEntity(entity).Should().BeFalse();\n            _context.Count.Should().Be(0);\n            _context.GetEntities().Should().BeEmpty();\n        }\n\n        [Fact]\n        public void DestroysEntityAndRemovesAllComponents()\n        {\n            var entity = _context.CreateEntity();\n            entity.Destroy();\n            entity.GetComponents().Should().BeEmpty();\n        }\n\n        [Fact]\n        public void RemovesOnDestroyEntityHandler()\n        {\n            var entity = _context.CreateEntity();\n            var didDestroy = 0;\n            _context.OnEntityWillBeDestroyed += delegate { didDestroy += 1; };\n            entity.Destroy();\n            _context.CreateEntity().Destroy();\n            didDestroy.Should().Be(2);\n        }\n\n        [Fact]\n        public void DestroysAllEntities()\n        {\n            var testEntity = _context.CreateEntity();\n            _context.CreateEntity();\n            _context.DestroyAllEntities();\n            _context.HasEntity(testEntity).Should().BeFalse();\n            _context.Count.Should().Be(0);\n            _context.GetEntities().Should().BeEmpty();\n            testEntity.GetComponents().Should().BeEmpty();\n        }\n\n        [Fact]\n        public void EnsuresSameDeterministicOrderWhenGettingEntitiesAfterDestroyingAllEntities()\n        {\n            // This is a Unity specific problem. Run Unity Test Tools in the Unity project\n\n            const int numEntities = 10;\n\n            for (var i = 0; i < numEntities; i++)\n                _context.CreateEntity();\n\n            var order1 = _context.GetEntities().Select(entity => entity.Id).ToArray();\n\n            _context.Reset();\n\n            for (var i = 0; i < numEntities; i++)\n                _context.CreateEntity();\n\n            var order2 = _context.GetEntities().Select(entity => entity.Id).ToArray();\n\n            order1.Should().BeEquivalentTo(order2);\n        }\n\n        [Fact]\n        public void ThrowsWhenDestroyingAllEntitiesWithRetainedEntities()\n        {\n            FluentActions.Invoking(() =>\n                {\n                    _context.CreateEntity().Retain(new object());\n                    _context.DestroyAllEntities();\n                }\n            ).Should().Throw<ContextStillHasRetainedEntitiesException>();\n        }\n\n        [Fact]\n        public void CachesEntities()\n        {\n            _context.GetEntities().Should().BeSameAs(_context.GetEntities());\n        }\n\n        [Fact]\n        public void UpdatesEntitiesCacheWhenCreatingEntity()\n        {\n            var entities = _context.GetEntities();\n            _context.CreateEntity();\n            _context.GetEntities().Should().NotBeSameAs(entities);\n        }\n\n        [Fact]\n        public void UpdatesEntitiesCacheWhenDestroyingEntity()\n        {\n            var entity = _context.CreateEntity();\n            var entities = _context.GetEntities();\n            entity.Destroy();\n            _context.GetEntities().Should().NotBeSameAs(entities);\n        }\n\n        [Fact]\n        public void DispatchesOnEntityCreatedWhenCreatingNewEntity()\n        {\n            var didDispatch = 0;\n            Entity eventEntity = null;\n            _context.OnEntityCreated += (c, e) =>\n            {\n                didDispatch += 1;\n                eventEntity = e;\n                c.Should().BeSameAs(_context);\n            };\n\n            var entity = _context.CreateEntity();\n            didDispatch.Should().Be(1);\n            eventEntity.Should().BeSameAs(entity);\n        }\n\n        [Fact]\n        public void DispatchesOnEntityWillBeDestroyedWhenDestroyingEntity()\n        {\n            var entity = _context.CreateEntity().AddComponentA();\n            var didDispatch = 0;\n            _context.OnEntityWillBeDestroyed += (c, e) =>\n            {\n                didDispatch += 1;\n                c.Should().BeSameAs(_context);\n                e.Should().BeSameAs(entity);\n                e.HasComponentA().Should().BeTrue();\n                e.IsEnabled.Should().BeTrue();\n                c.Count.Should().Be(0);\n            };\n            entity.Destroy();\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void DispatchesOnEntityDestroyedWhenDestroyingEntity()\n        {\n            var entity = _context.CreateEntity();\n            var didDispatch = 0;\n            _context.OnEntityDestroyed += (p, e) =>\n            {\n                didDispatch += 1;\n                p.Should().BeSameAs(_context);\n                e.Should().BeSameAs(entity);\n                e.HasComponentA().Should().BeFalse();\n                e.IsEnabled.Should().BeFalse();\n            };\n            entity.Destroy();\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void ReleasesEntityAfterOnEntityDestroyed()\n        {\n            var entity = _context.CreateEntity();\n            var didDispatch = 0;\n            _context.OnEntityDestroyed += (_, e) =>\n            {\n                didDispatch += 1;\n                e.RetainCount.Should().Be(1);\n                var newEntity = _context.CreateEntity();\n                newEntity.Should().NotBeNull();\n                newEntity.Should().NotBeSameAs(e);\n            };\n            entity.Destroy();\n            var reusedEntity = _context.CreateEntity();\n            reusedEntity.Should().BeSameAs(entity);\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void ThrowsIfEntityIsReleasedBeforeItIsDestroyed()\n        {\n            FluentActions.Invoking(() => _context.CreateEntity().Release(_context))\n                .Should().Throw<EntityIsNotDestroyedException>();\n        }\n\n        [Fact]\n        public void DispatchesOnGroupCreatedWhenCreatingNewGroup()\n        {\n            var didDispatch = 0;\n            IGroup eventGroup = null;\n            _context.OnGroupCreated += (p, g) =>\n            {\n                didDispatch += 1;\n                p.Should().BeSameAs(_context);\n                eventGroup = g;\n            };\n            var group = _context.GetGroup(Matcher<TestEntity>.AllOf(0));\n            didDispatch.Should().Be(1);\n            eventGroup.Should().BeSameAs(group);\n        }\n\n        [Fact]\n        public void DoesNotDispatchOnGroupCreatedWhenGroupAlreadyExists()\n        {\n            _context.GetGroup(Matcher<TestEntity>.AllOf(0));\n            _context.OnGroupCreated += delegate { throw new Exception(\"context.OnGroupCreated\"); };\n            _context.GetGroup(Matcher<TestEntity>.AllOf(0));\n        }\n\n        [Fact]\n        public void RemovesEventHandlersWhenDestroyingEntity()\n        {\n            var entity1 = _context.CreateEntity();\n            entity1.OnComponentAdded += delegate { throw new Exception(\"entity.OnComponentAdded\"); };\n            entity1.OnComponentRemoved += delegate { throw new Exception(\"entity.OnComponentRemoved\"); };\n            entity1.OnComponentReplaced += delegate { throw new Exception(\"entity.OnComponentReplaced\"); };\n            entity1.Destroy();\n\n            var entity2 = _context.CreateEntity();\n            entity2.Should().BeSameAs(entity1);\n            entity2.AddComponentA()\n                .ReplaceComponentA(Component.A)\n                .RemoveComponentA();\n        }\n\n        [Fact]\n        public void WillNotRemoveOnEntityReleased()\n        {\n            var entity = _context.CreateEntity();\n            var didRelease = 0;\n            entity.OnEntityReleased += delegate { didRelease += 1; };\n            entity.Destroy();\n            didRelease.Should().Be(1);\n        }\n\n        [Fact]\n        public void RemovesOnEntityReleasedAfterBeingDispatched()\n        {\n            var entity = _context.CreateEntity();\n            var didRelease = 0;\n            entity.OnEntityReleased += delegate { didRelease += 1; };\n            entity.Destroy();\n            entity.Retain(this);\n            entity.Release(this);\n            didRelease.Should().Be(1);\n        }\n\n        [Fact]\n        public void RemovesOnEntityReleasedAfterBeingDispatchedWhenDelayedRelease()\n        {\n            var entity = _context.CreateEntity();\n            var didRelease = 0;\n            entity.OnEntityReleased += delegate { didRelease += 1; };\n            entity.Retain(this);\n            entity.Destroy();\n            didRelease.Should().Be(0);\n\n            entity.Release(this);\n            didRelease.Should().Be(1);\n\n            entity.Retain(this);\n            entity.Release(this);\n            didRelease.Should().Be(1);\n        }\n\n        [Fact]\n        public void ReturnsPushedEntity()\n        {\n            var entity1 = _context.CreateEntity().AddComponentA();\n            entity1.Destroy();\n            var entity2 = _context.CreateEntity();\n            entity2.HasComponent(CID.ComponentA).Should().BeFalse();\n            entity2.Should().BeSameAs(entity1);\n        }\n\n        [Fact]\n        public void OnlyReturnsReleasedEntities()\n        {\n            var entity1 = _context.CreateEntity();\n            entity1.Retain(this);\n            entity1.Destroy();\n\n            var entity2 = _context.CreateEntity();\n            entity2.Should().NotBeSameAs(entity1);\n            entity1.Release(this);\n\n            var entity3 = _context.CreateEntity();\n            entity3.Should().BeSameAs(entity1);\n        }\n\n        [Fact]\n        public void ReturnsNewEntity()\n        {\n            var entity1 = _context.CreateEntity().AddComponentA();\n            entity1.Destroy();\n            _context.CreateEntity();\n\n            var entity2 = _context.CreateEntity();\n            entity2.HasComponent(CID.ComponentA).Should().BeFalse();\n            entity2.Should().NotBeSameAs(entity1);\n        }\n\n        [Fact]\n        public void SetsUpEntityFromObjectPool()\n        {\n            var entity = _context.CreateEntity();\n            var id = entity.Id;\n            entity.Destroy();\n            var group = _context.GetGroup(Matcher<TestEntity>.AllOf(CID.ComponentA));\n\n            entity = _context.CreateEntity();\n            entity.Id.Should().Be(id + 1);\n            entity.IsEnabled.Should().BeTrue();\n\n            entity.AddComponentA();\n            group.GetEntities().Should().Contain(entity);\n        }\n\n        [Fact]\n        public void ThrowsWhenAddingComponentToDestroyedEntity()\n        {\n            var entity = _context.CreateEntity().AddComponentA();\n            entity.Destroy();\n            FluentActions.Invoking(() => entity.AddComponentA())\n                .Should().Throw<EntityIsNotEnabledException>();\n        }\n\n        [Fact]\n        public void ThrowsWhenRemovingComponentFromDestroyedEntity()\n        {\n            var entity = _context.CreateEntity().AddComponentA();\n            entity.Destroy();\n            FluentActions.Invoking(() => entity.RemoveComponentA())\n                .Should().Throw<EntityIsNotEnabledException>();\n        }\n\n        [Fact]\n        public void ThrowsWhenReplacingComponentOnDestroyedEntity()\n        {\n            var entity = _context.CreateEntity().AddComponentA();\n            entity.Destroy();\n            FluentActions.Invoking(() => entity.ReplaceComponentA(new ComponentA()))\n                .Should().Throw<EntityIsNotEnabledException>();\n        }\n\n        [Fact]\n        public void ThrowsWhenReplacingComponentWithNullOnDestroyedEntity()\n        {\n            var entity = _context.CreateEntity().AddComponentA();\n            entity.Destroy();\n            FluentActions.Invoking(() => entity.ReplaceComponentA(null))\n                .Should().Throw<EntityIsNotEnabledException>();\n        }\n\n        [Fact]\n        public void ThrowsWhenDestroyingDestroyedEntity()\n        {\n            var entity = _context.CreateEntity().AddComponentA();\n            entity.Destroy();\n            FluentActions.Invoking(() => entity.Destroy())\n                .Should().Throw<EntityIsNotEnabledException>();\n        }\n\n        [Fact]\n        public void GetsEmptyGroupForMatcherWhenNoEntitiesWereCreated()\n        {\n            var group = _context.GetGroup(Matcher<TestEntity>.AllOf(CID.ComponentA));\n            group.Should().NotBeNull();\n            group.GetEntities().Should().BeEmpty();\n        }\n\n        [Fact]\n        public void GetsGroupWithMatchingEntities()\n        {\n            var entity1 = _context.CreateEntity();\n            entity1.AddComponentA();\n            entity1.AddComponentB();\n\n            var entity2 = _context.CreateEntity();\n            entity2.AddComponentA();\n            entity2.AddComponentB();\n\n            var entityA = _context.CreateEntity();\n            entityA.AddComponentA();\n\n            var entities = _context.GetGroup(_matcherAB).GetEntities();\n            entities.Length.Should().Be(2);\n            entities.Should().Contain(entity1);\n            entities.Should().Contain(entity2);\n        }\n\n        [Fact]\n        public void GetsCachedGroup()\n        {\n            _context.GetGroup(_matcherAB).Should().BeSameAs(_context.GetGroup(_matcherAB));\n        }\n\n        [Fact]\n        public void CachedGroupContainsNewlyCreatedMatchingEntity()\n        {\n            var entity = _context.CreateEntity();\n            entity.AddComponentA();\n\n            var group = _context.GetGroup(_matcherAB);\n            entity.AddComponentB();\n            group.GetEntities().Should().Contain(entity);\n        }\n\n        [Fact]\n        public void CachedGroupDoesNotContainEntityWhichIsNotMatchingAnymore()\n        {\n            var entity = _context.CreateEntity();\n            entity.AddComponentA();\n            entity.AddComponentB();\n\n            var group = _context.GetGroup(_matcherAB);\n            entity.RemoveComponentA();\n            group.GetEntities().Should().NotContain(entity);\n        }\n\n        [Fact]\n        public void RemovesDestroyedEntityFromGroup()\n        {\n            var entity = _context.CreateEntity();\n            entity.AddComponentA();\n            entity.AddComponentB();\n\n            var group = _context.GetGroup(_matcherAB);\n            entity.Destroy();\n            group.GetEntities().Should().NotContain(entity);\n        }\n\n        [Fact]\n        public void GroupDispatchesOnEntityRemovedAndOnEntityAddedWhenReplacingComponent()\n        {\n            var entity = _context.CreateEntity();\n            entity.AddComponentA();\n            entity.AddComponentB();\n            var group = _context.GetGroup(_matcherAB);\n            var didDispatchRemoved = 0;\n            var didDispatchAdded = 0;\n            var componentA = new ComponentA();\n            group.OnEntityRemoved += (g, e, index, component) =>\n            {\n                g.Should().BeSameAs(group);\n                e.Should().BeSameAs(entity);\n                index.Should().Be(CID.ComponentA);\n                component.Should().BeSameAs(Component.A);\n                didDispatchRemoved++;\n            };\n            group.OnEntityAdded += (g, e, index, component) =>\n            {\n                g.Should().BeSameAs(group);\n                e.Should().BeSameAs(entity);\n                index.Should().Be(CID.ComponentA);\n                component.Should().BeSameAs(componentA);\n                didDispatchAdded++;\n            };\n            entity.ReplaceComponentA(componentA);\n            didDispatchRemoved.Should().Be(1);\n            didDispatchAdded.Should().Be(1);\n        }\n\n        [Fact]\n        public void GroupDispatchesOnEntityUpdatedWithPreviousAndCurrentComponentWhenReplacingComponent()\n        {\n            var entity = _context.CreateEntity();\n            entity.AddComponentA();\n            entity.AddComponentB();\n            var updated = 0;\n            var prevComp = entity.GetComponent(CID.ComponentA);\n            var newComp = new ComponentA();\n            var group = _context.GetGroup(Matcher<TestEntity>.AllOf(CID.ComponentA));\n            group.OnEntityUpdated += (g, e, index, previousComponent, newComponent) =>\n            {\n                updated += 1;\n                g.Should().BeSameAs(group);\n                e.Should().BeSameAs(entity);\n                index.Should().Be(CID.ComponentA);\n                previousComponent.Should().BeSameAs(prevComp);\n                newComponent.Should().BeSameAs(newComp);\n            };\n\n            entity.ReplaceComponent(CID.ComponentA, newComp);\n            updated.Should().Be(1);\n        }\n\n        [Fact]\n        public void GroupWithMatcherNoneOfDoesNotDispatchOnEntityAddedWhenDestroyingEntity()\n        {\n            var entity = _context.CreateEntity();\n            entity.AddComponentA();\n            entity.AddComponentB();\n            var matcher = Matcher<TestEntity>.AllOf(CID.ComponentB).NoneOf(CID.ComponentA);\n            var group = _context.GetGroup(matcher);\n            group.OnEntityAdded += delegate { throw new Exception(\"group.OnEntityAdded\"); };\n            entity.Destroy();\n        }\n\n        [Fact]\n        public void DispatchesOnEntityAddedEventsAfterAllGroupsAreUpdated()\n        {\n            var groupAB = _context.GetGroup(Matcher<TestEntity>.AllOf(CID.ComponentA, CID.ComponentB));\n            var groupB = _context.GetGroup(Matcher<TestEntity>.AllOf(CID.ComponentB));\n\n            groupAB.OnEntityAdded += delegate { groupB.Count.Should().Be(1); };\n\n            var entity = _context.CreateEntity();\n            entity.AddComponentA();\n            entity.AddComponentB();\n        }\n\n        [Fact]\n        public void DispatchesOnEntityRemovedEventsAfterAllGroupsAreUpdated()\n        {\n            var groupB = _context.GetGroup(Matcher<TestEntity>.AllOf(CID.ComponentB));\n            var groupAB = _context.GetGroup(Matcher<TestEntity>.AllOf(CID.ComponentA, CID.ComponentB));\n\n            groupB.OnEntityRemoved += delegate { groupAB.Count.Should().Be(0); };\n\n            var entity = _context.CreateEntity();\n            entity.AddComponentA();\n            entity.AddComponentB();\n\n            entity.RemoveComponentB();\n        }\n\n        [Fact]\n        public void ThrowsWhenEntityIndexForKeyDoesNotExist()\n        {\n            FluentActions.Invoking(() => _context.GetEntityIndex(\"unknown\"))\n                .Should().Throw<ContextEntityIndexDoesNotExistException>();\n        }\n\n        [Fact]\n        public void AddsEntityIndex()\n        {\n            var entityIndex = new PrimaryEntityIndex<TestEntity, string>(\n                \"TestIndex\",\n                _context.GetGroup(Matcher<TestEntity>.AllOf(1)),\n                (_, _) => string.Empty\n            );\n            _context.AddEntityIndex(entityIndex);\n            _context.GetEntityIndex(entityIndex.Name).Should().BeSameAs(entityIndex);\n        }\n\n        [Fact]\n        public void ThrowsWhenAddingEntityIndexWithSameName()\n        {\n            var entityIndex = new PrimaryEntityIndex<TestEntity, string>(\n                \"TestIndex\",\n                _context.GetGroup(Matcher<TestEntity>.AllOf(1)),\n                (_, _) => string.Empty\n            );\n            _context.AddEntityIndex(entityIndex);\n\n            FluentActions.Invoking(() => _context.AddEntityIndex(entityIndex))\n                .Should().Throw<ContextEntityIndexDoesAlreadyExistException>();\n        }\n\n        [Fact]\n        public void ResetsCreationIndex()\n        {\n            _context.CreateEntity();\n            _context.ResetCreationIndex();\n            _context.CreateEntity().Id.Should().Be(0);\n        }\n\n        [Fact]\n        public void RemovesOnEntityCreated()\n        {\n            _context.OnEntityCreated += delegate { throw new Exception(\"context.OnEntityCreated\"); };\n            _context.RemoveAllEventHandlers();\n            _context.CreateEntity();\n        }\n\n        [Fact]\n        public void RemovesOnEntityWillBeDestroyed()\n        {\n            _context.OnEntityWillBeDestroyed += delegate { throw new Exception(\"context.OnEntityWillBeDestroyed\"); };\n            _context.RemoveAllEventHandlers();\n            _context.CreateEntity().Destroy();\n        }\n\n        [Fact]\n        public void RemovesOnEntityDestroyed()\n        {\n            _context.OnEntityDestroyed += delegate { throw new Exception(\"context.OnEntityDestroyed\"); };\n            _context.RemoveAllEventHandlers();\n            _context.CreateEntity().Destroy();\n        }\n\n        [Fact]\n        public void RemovesOnGroupCreated()\n        {\n            _context.OnGroupCreated += delegate { throw new Exception(\"context.OnGroupCreated\"); };\n            _context.RemoveAllEventHandlers();\n            _context.GetGroup(Matcher<TestEntity>.AllOf(0));\n        }\n\n        [Fact]\n        public void ClearsAllComponentPools()\n        {\n            var entity = _context.CreateEntity();\n            entity.AddComponentA();\n            entity.AddComponentB();\n            entity.RemoveComponentA();\n            entity.RemoveComponentB();\n\n            _context.ComponentPools[CID.ComponentA].Count.Should().Be(1);\n            _context.ComponentPools[CID.ComponentB].Count.Should().Be(1);\n\n            _context.ClearComponentPools();\n            _context.ComponentPools[CID.ComponentA].Count.Should().Be(0);\n            _context.ComponentPools[CID.ComponentB].Count.Should().Be(0);\n        }\n\n        [Fact]\n        public void ClearsSpecificComponentPool()\n        {\n            var entity = _context.CreateEntity();\n            entity.AddComponentA();\n            entity.AddComponentB();\n            entity.RemoveComponentA();\n            entity.RemoveComponentB();\n\n            _context.ClearComponentPool(CID.ComponentB);\n            _context.ComponentPools[CID.ComponentA].Count.Should().Be(1);\n            _context.ComponentPools[CID.ComponentB].Count.Should().Be(0);\n        }\n\n        [Fact]\n        public void ThrowsWhenClearingComponentPoolThatDoesNotExist()\n        {\n            FluentActions.Invoking(() => _context.ClearComponentPool(99))\n                .Should().Throw<IndexOutOfRangeException>();\n        }\n\n        [Fact]\n        public void PopsNewListFromListPool()\n        {\n            var groupA = _context.GetGroup(Matcher<TestEntity>.AllOf(CID.ComponentA));\n            var groupAB = _context.GetGroup(Matcher<TestEntity>.AnyOf(CID.ComponentA, CID.ComponentB));\n            var groupABC = _context.GetGroup(Matcher<TestEntity>.AnyOf(CID.ComponentA, CID.ComponentB, CID.ComponentC));\n\n            var didExecute = 0;\n\n            groupA.OnEntityAdded += (_, entity, _, _) =>\n            {\n                didExecute += 1;\n                entity.RemoveComponentA();\n            };\n\n            groupAB.OnEntityAdded += delegate { didExecute += 1; };\n            groupABC.OnEntityAdded += delegate { didExecute += 1; };\n\n            _context.CreateEntity().AddComponentA();\n\n            didExecute.Should().Be(3);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/Entitas.Tests.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>$(DefaultTestTargetFramework)</TargetFramework>\n    <IsPackable>false</IsPackable>\n    <IsPublishable>false</IsPublishable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"FluentAssertions\" Version=\"6.11.0\" />\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.6.2\" />\n    <PackageReference Include=\"xunit\" Version=\"2.4.2\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.5\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"coverlet.collector\" Version=\"6.0.0\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"../../src/Entitas/Entitas.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "tests/Entitas.Tests/EntitasErrorMessagesTests.cs",
    "content": "using System;\nusing Xunit;\nusing Xunit.Abstractions;\n\nnamespace Entitas.Tests\n{\n    public class EntitasErrorMessagesTests\n    {\n        readonly ITestOutputHelper _output;\n        readonly TestContext _context;\n        readonly TestEntity _entity;\n\n        public EntitasErrorMessagesTests(ITestOutputHelper output)\n        {\n            _output = output;\n            var componentNames = new[] { \"Health\", \"Position\", \"View\" };\n            var contextInfo = new ContextInfo(\"My Context\", componentNames, null);\n            _context = new TestContext(componentNames.Length, 42, contextInfo);\n            _entity = _context.CreateEntity();\n        }\n\n        [Fact]\n        public void WhenAddingComponentToDestroyedEntity()\n        {\n            _entity.Destroy();\n            PrintErrorMessage(() => _entity.AddComponentA());\n        }\n\n        [Fact]\n        public void WhenRemovingComponentFromDestroyedEntity()\n        {\n            _entity.Destroy();\n            PrintErrorMessage(() => _entity.RemoveComponentA());\n        }\n\n        [Fact]\n        public void WhenReplacingComponentOnDestroyedEntity()\n        {\n            _entity.Destroy();\n            PrintErrorMessage(() => _entity.ReplaceComponentA(Component.A));\n        }\n\n        [Fact]\n        public void WhenAddingComponentTwice()\n        {\n            _entity.AddComponentA();\n            PrintErrorMessage(() => _entity.AddComponentA());\n        }\n\n        [Fact]\n        public void WhenRemovingComponentThatDoesNotExist()\n        {\n            PrintErrorMessage(() => _entity.RemoveComponentA());\n        }\n\n        [Fact]\n        public void WhenGettingComponentThatDoesNotExist()\n        {\n            PrintErrorMessage(() => _entity.GetComponentA());\n        }\n\n        [Fact]\n        public void WhenRetainingEntityTwice()\n        {\n            var owner = new object();\n            _entity.Retain(owner);\n            PrintErrorMessage(() => _entity.Retain(owner));\n        }\n\n        [Fact]\n        public void WhenReleasingEntityWithWrongOwner()\n        {\n            PrintErrorMessage(() => _entity.Release(new object()));\n        }\n\n        [Fact]\n        public void WhenGettingSingleEntityFromGroupWhenMultipleExist()\n        {\n            _context.CreateEntity().AddComponentA();\n            _context.CreateEntity().AddComponentA();\n            var matcher = (Matcher<TestEntity>)Matcher<TestEntity>.AllOf(CID.ComponentA);\n            matcher.ComponentNames = _context.ContextInfo.ComponentNames;\n            PrintErrorMessage(() => _context.GetGroup(matcher).GetSingleEntity());\n        }\n\n        [Fact]\n        public void WhenCreatingUnbalancedGroup()\n        {\n            PrintErrorMessage(() => new Collector<TestEntity>(new[]\n                {\n                    new Group<TestEntity>(Matcher<TestEntity>.AllOf(CID.ComponentA)),\n                    new Group<TestEntity>(Matcher<TestEntity>.AllOf(CID.ComponentB))\n                },\n                new[] { GroupEvent.Added }));\n        }\n\n        [Fact]\n        public void WhenWrongContextInfoComponentNamesCount()\n        {\n            var componentNames = new[] { \"Health\", \"Position\", \"View\" };\n            var contextInfo = new ContextInfo(\"My Context\", componentNames, null);\n            PrintErrorMessage(() => new TestContext(999, 0, contextInfo));\n        }\n\n        [Fact]\n        public void WhenDestroyingRetainedEntity()\n        {\n            var entity = _context.CreateEntity();\n            entity.Retain(this);\n            entity.Retain(new object());\n\n            entity = _context.CreateEntity();\n            entity.Retain(this);\n            entity.Retain(new object());\n\n            PrintErrorMessage(() => _context.DestroyAllEntities());\n        }\n\n        [Fact]\n        public void WhenReleasingEntityBeforeDestroy()\n        {\n            PrintErrorMessage(() => _entity.Release(_context));\n        }\n\n        [Fact]\n        public void WhenUnknownEntityIndex()\n        {\n            PrintErrorMessage(() => _context.GetEntityIndex(\"unknown\"));\n        }\n\n        [Fact]\n        public void WhenDuplicateEntityIndex()\n        {\n            var index = new PrimaryEntityIndex<TestEntity, string>(\n                \"TestIndex\",\n                _context.GetGroup((Matcher<TestEntity>)Matcher<TestEntity>.AllOf(CID.ComponentA)),\n                (_, _) => string.Empty\n            );\n            _context.AddEntityIndex(index);\n            PrintErrorMessage(() => _context.AddEntityIndex(index));\n        }\n\n        [Fact]\n        public void WhenGettingSingleEntityFromCollectionWhenMultipleExist()\n        {\n            PrintErrorMessage(() => new Entity[2].SingleEntity());\n        }\n\n        [Fact]\n        public void WhenPrimaryEntityIndexHasMultipleEntitiesForKey()\n        {\n            new PrimaryEntityIndex<TestEntity, string>(\n                \"TestIndex\",\n                _context.GetGroup(TestUserMatcher.User),\n                (_, c) => ((UserComponent)c).Name\n            );\n\n            _context.CreateEntity().AddUser(\"Test\", 42);\n            PrintErrorMessage(() => _context.CreateEntity().AddUser(\"Test\", 42));\n        }\n\n        void PrintErrorMessage(Action action)\n        {\n            try\n            {\n                action();\n            }\n            catch (Exception exception)\n            {\n                _output.WriteLine(exception.Message);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/EntitasExceptionTests.cs",
    "content": "﻿using FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Tests\n{\n    public class EntitasExceptionTests\n    {\n        [Fact]\n        public void CreatesExceptionWithHintSeparatedByNewLine()\n        {\n            new EntitasException(\"Message\", \"Hint\").Message\n                .Should().Be(\"Message\\nHint\");\n        }\n\n        [Fact]\n        public void IgnoresHintWhenNull()\n        {\n            new EntitasException(\"Message\", null).Message\n                .Should().Be(\"Message\");\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/EntitasStringExtension.cs",
    "content": "﻿using FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Tests\n{\n    public class EntitasStringExtension\n    {\n        [Fact]\n        public void DoesNotChangeStringWhenNotEndingWithSuffix()\n        {\n            \"Word\".RemoveSuffix(\"Test\").Should().Be(\"Word\");\n        }\n\n        [Fact]\n        public void RemovesSuffixWhenEndingWithSuffix()\n        {\n            \"WordTest\".RemoveSuffix(\"Test\").Should().Be(\"Word\");\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/EntityIndexTests.cs",
    "content": "using System.Collections.Generic;\nusing System.Linq;\nusing FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Tests\n{\n    public class EntityIndexTests\n    {\n        readonly IContext<TestEntity> _context;\n        readonly EntityIndex<TestEntity, string> _index;\n        readonly IContext<TestEntity> _multiKeyContext;\n        readonly EntityIndex<TestEntity, string> _multiKeyIndex;\n\n        public EntityIndexTests()\n        {\n            _context = new TestContext(CID.TotalComponents);\n            _index = CreateEntityIndex();\n            _multiKeyContext = new TestContext(CID.TotalComponents);\n            _multiKeyIndex = CreateMultiKeyEntityIndex();\n        }\n\n        [Fact]\n        public void HasNoEntities()\n        {\n            _index.GetEntities(\"unknownKey\").Should().BeEmpty();\n        }\n\n        [Fact]\n        public void GetsEntitiesForKey()\n        {\n            var entity1 = _context.CreateEntity().AddUser(\"Test\", 1);\n            var entity2 = _context.CreateEntity().AddUser(\"Test\", 2);\n            var entities = _index.GetEntities(\"Test\");\n            entities.Count.Should().Be(2);\n            entities.Should().Contain(entity1);\n            entities.Should().Contain(entity2);\n        }\n\n        [Fact]\n        public void MultiKeyGetsEntityForKey()\n        {\n            var entity1 = _multiKeyContext.CreateEntity().AddUser(\"Test\", 1);\n            var entity2 = _multiKeyContext.CreateEntity().AddUser(\"Test\", 2);\n            _multiKeyIndex.GetEntities(\"1\").First().Should().BeSameAs(entity1);\n            _multiKeyIndex.GetEntities(\"2\").Should().Contain(entity1);\n            _multiKeyIndex.GetEntities(\"2\").Should().Contain(entity2);\n            _multiKeyIndex.GetEntities(\"3\").First().Should().BeSameAs(entity2);\n        }\n\n        [Fact]\n        public void RetainsEntity()\n        {\n            var entity1 = _context.CreateEntity().AddUser(\"Test\", 1);\n            var entity2 = _context.CreateEntity().AddUser(\"Test\", 2);\n            entity1.RetainCount.Should().Be(3); // Context, Group, EntityIndex\n            entity2.RetainCount.Should().Be(3); // Context, Group, EntityIndex\n        }\n\n        [Fact]\n        public void MultiKeyRetainsEntity()\n        {\n            var entity1 = _multiKeyContext.CreateEntity().AddUser(\"Test\", 1);\n            var entity2 = _multiKeyContext.CreateEntity().AddUser(\"Test\", 2);\n            entity1.RetainCount.Should().Be(3);\n            entity2.RetainCount.Should().Be(3);\n            (entity1.Aerc as SafeAERC)?.Owners.Should().Contain(_multiKeyIndex);\n            (entity1.Aerc as SafeAERC)?.Owners.Should().Contain(_multiKeyIndex);\n        }\n\n        [Fact]\n        public void HasExistingEntities()\n        {\n            _context.CreateEntity().AddUser(\"Test\", 1);\n            _context.CreateEntity().AddUser(\"Test\", 2);\n            CreateEntityIndex().GetEntities(\"Test\").Count.Should().Be(2);\n        }\n\n        [Fact]\n        public void MultiKeyHasExistingEntities()\n        {\n            _multiKeyContext.CreateEntity().AddUser(\"Test\", 1);\n            _multiKeyContext.CreateEntity().AddUser(\"Test\", 2);\n            _multiKeyIndex.GetEntities(\"1\").Count.Should().Be(1);\n            _multiKeyIndex.GetEntities(\"2\").Count.Should().Be(2);\n            _multiKeyIndex.GetEntities(\"3\").Count.Should().Be(1);\n        }\n\n        [Fact]\n        public void ReleasesAndRemovesEntityFromIndexWhenComponentGetsRemoved()\n        {\n            var entity1 = _context.CreateEntity().AddUser(\"Test\", 1);\n            _context.CreateEntity().AddUser(\"Test\", 2);\n            entity1.RemoveUser();\n            _index.GetEntities(\"Test\").Count.Should().Be(1);\n            entity1.RetainCount.Should().Be(1); // Context\n            (entity1.Aerc as SafeAERC)?.Owners.Should().NotContain(_multiKeyIndex);\n        }\n\n        [Fact]\n        public void MultiKeyReleasesAndRemovesEntityFromIndexWhenComponentGetsRemoved()\n        {\n            var entity1 = _multiKeyContext.CreateEntity().AddUser(\"Test\", 1);\n            var entity2 = _multiKeyContext.CreateEntity().AddUser(\"Test\", 2);\n            entity1.RemoveUser();\n            _multiKeyIndex.GetEntities(\"1\").Count.Should().Be(0);\n            _multiKeyIndex.GetEntities(\"2\").Count.Should().Be(1);\n            _multiKeyIndex.GetEntities(\"3\").Count.Should().Be(1);\n            entity1.RetainCount.Should().Be(1);\n            entity2.RetainCount.Should().Be(3);\n            (entity1.Aerc as SafeAERC)?.Owners.Should().NotContain(_multiKeyIndex);\n            (entity2.Aerc as SafeAERC)?.Owners.Should().Contain(_multiKeyIndex);\n        }\n\n        [Fact]\n        public void CanToString()\n        {\n            _index.ToString().Should().Be(\"EntityIndex(TestIndex)\");\n        }\n\n        [Fact]\n        public void ClearsIndexAndReleasesEntity()\n        {\n            var entity1 = _context.CreateEntity().AddUser(\"Test\", 1);\n            var entity2 = _context.CreateEntity().AddUser(\"Test\", 2);\n            _index.Deactivate();\n            _index.GetEntities(\"Test\").Should().BeEmpty();\n            entity1.RetainCount.Should().Be(2); // Context, Group\n            entity2.RetainCount.Should().Be(2); // Context, Group\n        }\n\n        [Fact]\n        public void DoesNotAddEntitiesAnymore()\n        {\n            _index.Deactivate();\n            _context.CreateEntity().AddUser(\"Test\", 1);\n            _index.GetEntities(\"Test\").Should().BeEmpty();\n        }\n\n        [Fact]\n        public void HasExistingEntitiesWhenActivating()\n        {\n            var entity1 = _context.CreateEntity().AddUser(\"Test\", 1);\n            var entity2 = _context.CreateEntity().AddUser(\"Test\", 2);\n            _index.Deactivate();\n            _index.Activate();\n            var entities = _index.GetEntities(\"Test\");\n            entities.Count.Should().Be(2);\n            entities.Should().Contain(entity1);\n            entities.Should().Contain(entity2);\n        }\n\n        [Fact]\n        public void MultiKeyHasExistingEntitiesWhenActivating()\n        {\n            var entity1 = _multiKeyContext.CreateEntity().AddUser(\"Test\", 1);\n            var entity2 = _multiKeyContext.CreateEntity().AddUser(\"Test\", 2);\n            _multiKeyIndex.Deactivate();\n            _multiKeyIndex.Activate();\n            _multiKeyIndex.GetEntities(\"1\").First().Should().BeSameAs(entity1);\n            _multiKeyIndex.GetEntities(\"2\").Should().Contain(entity1);\n            _multiKeyIndex.GetEntities(\"2\").Should().Contain(entity2);\n            _multiKeyIndex.GetEntities(\"3\").First().Should().BeSameAs(entity2);\n        }\n\n        [Fact]\n        public void AddsNewEntitiesWhenActivated()\n        {\n            var entity1 = _context.CreateEntity().AddUser(\"Test\", 1);\n            var entity2 = _context.CreateEntity().AddUser(\"Test\", 2);\n            _index.Deactivate();\n            _index.Activate();\n            var entity3 = _context.CreateEntity().AddUser(\"Test\", 3);\n\n            var entities = _index.GetEntities(\"Test\");\n            entities.Count.Should().Be(3);\n            entities.Should().Contain(entity1);\n            entities.Should().Contain(entity2);\n            entities.Should().Contain(entity3);\n        }\n\n        [Fact]\n        public void GetsLastComponentThatTriggeredAddingEntityToGroup()\n        {\n            IComponent lastComponent = null;\n\n            var group = _context.GetGroup(Matcher<TestEntity>.AllOf(1, 2));\n            new EntityIndex<TestEntity, string>(\n                \"TestIndex\",\n                group, (_, c) =>\n                {\n                    lastComponent = c;\n                    return ((UserComponent)c).Name;\n                });\n\n            var user1 = new UserComponent { Name = \"Test1\", Age = 42 };\n            var user2 = new UserComponent { Name = \"Test2\", Age = 24 };\n\n            var entity = _context.CreateEntity();\n            entity.AddComponent(CID.ComponentA, user1);\n            entity.AddComponent(CID.ComponentB, user2);\n\n            lastComponent.Should().BeSameAs(user2);\n        }\n\n        [Fact]\n        public void WorksWithNoneOf()\n        {\n            var lastComponents = new List<IComponent>();\n\n            var user1 = new UserComponent { Name = \"Test1\", Age = 42 };\n            var user2 = new UserComponent { Name = \"Test2\", Age = 24 };\n\n            var index = new EntityIndex<TestEntity, string>(\n                \"TestIndex\",\n                _context.GetGroup(Matcher<TestEntity>.AllOf(CID.ComponentA).NoneOf(CID.ComponentB)),\n                (entity, c) =>\n                {\n                    lastComponents.Add(c);\n                    return c == user1\n                        ? ((UserComponent)c).Name\n                        : ((UserComponent)entity.GetComponent(CID.ComponentA)).Name;\n                }\n            );\n\n            var entity = _context.CreateEntity();\n            entity.AddComponent(CID.ComponentA, user1);\n            entity.AddComponent(CID.ComponentB, user2);\n\n            lastComponents.Count.Should().Be(2);\n            lastComponents[0].Should().Be(user1);\n            lastComponents[1].Should().Be(user2);\n\n            index.GetEntities(\"Max\").Should().BeEmpty();\n            index.GetEntities(\"Jack\").Should().BeEmpty();\n        }\n\n        EntityIndex<TestEntity, string> CreateEntityIndex() =>\n            new EntityIndex<TestEntity, string>(\n                \"TestIndex\",\n                _context.GetGroup(Matcher<TestEntity>.AllOf(0)),\n                (entity, component) => (component as UserComponent)?.Name ?? entity.GetUser().Name);\n\n        EntityIndex<TestEntity, string> CreateMultiKeyEntityIndex() => new EntityIndex<TestEntity, string>(\n            \"TestIndex\",\n            _multiKeyContext.GetGroup(Matcher<TestEntity>.AllOf(0)),\n            (entity, c) => (c as UserComponent ?? entity.GetUser()).Age == 1\n                ? new[] { \"1\", \"2\" }\n                : new[] { \"2\", \"3\" });\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/EntityTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Tests\n{\n    public class EntityTests\n    {\n        readonly int[] _indexesA = { CID.ComponentA };\n        readonly int[] _indexesAB = { CID.ComponentA, CID.ComponentB };\n        readonly TestEntity _entity;\n\n        public EntityTests()\n        {\n            _entity = new TestEntity();\n            _entity.Initialize(0, CID.TotalComponents, new Stack<IComponent>[CID.TotalComponents]);\n        }\n\n        [Fact]\n        public void HasDefaultContextInfo()\n        {\n            _entity.ContextInfo.Name.Should().Be(\"No Context\");\n            _entity.ContextInfo.ComponentNames.Length.Should().Be(CID.TotalComponents);\n            _entity.ContextInfo.ComponentTypes.Should().BeNull();\n            for (var i = 0; i < _entity.ContextInfo.ComponentNames.Length; i++)\n                _entity.ContextInfo.ComponentNames[i].Should().Be(i.ToString());\n        }\n\n        [Fact]\n        public void InitializesEntity()\n        {\n            var contextInfo = new ContextInfo(null, null, null);\n            var componentPools = new Stack<IComponent>[42];\n            var entity = new TestEntity();\n            entity.Initialize(1, 2, componentPools, contextInfo);\n\n            entity.IsEnabled.Should().BeTrue();\n            entity.Id.Should().Be(1);\n            entity.TotalComponents.Should().Be(2);\n            entity.ComponentPools.Should().BeSameAs(componentPools);\n            entity.ContextInfo.Should().BeSameAs(contextInfo);\n        }\n\n        [Fact]\n        public void ReusesEntityAfterBeingDestroyed()\n        {\n            var contextInfo = new ContextInfo(null, null, null);\n            var componentPools = new Stack<IComponent>[42];\n            var entity = new TestEntity();\n            entity.Initialize(1, 2, componentPools, contextInfo);\n\n            entity.InternalDestroy();\n\n            entity.Reuse(42);\n\n            entity.IsEnabled.Should().BeTrue();\n            entity.Id.Should().Be(42);\n            entity.TotalComponents.Should().Be(2);\n            entity.ComponentPools.Should().BeSameAs(componentPools);\n            entity.ContextInfo.Should().BeSameAs(contextInfo);\n        }\n\n        [Fact]\n        public void ThrowsWhenGettingComponentThatDoesNotExist()\n        {\n            FluentActions.Invoking(() => _entity.GetComponentA())\n                .Should().Throw<EntityDoesNotHaveComponentException>();\n        }\n\n        [Fact]\n        public void GetsTotalComponentsCountWhenEmpty()\n        {\n            _entity.TotalComponents.Should().Be(CID.TotalComponents);\n        }\n\n        [Fact]\n        public void GetsEmptyArrayOfComponentsWhenEmpty()\n        {\n            _entity.GetComponents().Should().BeEmpty();\n        }\n\n        [Fact]\n        public void GetsEmptyArrayOfComponentIndexesWhenEmpty()\n        {\n            _entity.GetComponentIndexes().Should().BeEmpty();\n        }\n\n        [Fact]\n        public void DoesNotHaveComponentWhenEmpty()\n        {\n            _entity.HasComponentA().Should().BeFalse();\n        }\n\n        [Fact]\n        public void DoesNotHaveComponentsWhenEmpty()\n        {\n            _entity.HasComponents(_indexesA).Should().BeFalse();\n        }\n\n        [Fact]\n        public void DoesNotHaveAnyComponentsWhenEmpty()\n        {\n            _entity.HasAnyComponent(_indexesA).Should().BeFalse();\n        }\n\n        [Fact]\n        public void AddsComponent()\n        {\n            _entity.AddComponentA();\n            AssertHasComponentA(_entity);\n        }\n\n        [Fact]\n        public void ThrowsWhenRemovingComponentThatDoesNotExist()\n        {\n            FluentActions.Invoking(() => _entity.RemoveComponentA())\n                .Should().Throw<EntityDoesNotHaveComponentException>();\n        }\n\n        [Fact]\n        public void ReplacingNonExistingComponentAddsComponent()\n        {\n            _entity.ReplaceComponentA(Component.A);\n            AssertHasComponentA(_entity);\n        }\n\n        [Fact]\n        public void ThrowsWhenAddComponentTwice()\n        {\n            _entity.AddComponentA();\n            FluentActions.Invoking(() => _entity.AddComponentA())\n                .Should().Throw<EntityAlreadyHasComponentException>();\n        }\n\n        [Fact]\n        public void RemovesComponent()\n        {\n            _entity.AddComponentA();\n            _entity.RemoveComponentA();\n            AssertHasNotComponentA(_entity);\n        }\n\n        [Fact]\n        public void ReplacesExistingComponent()\n        {\n            _entity.AddComponentA();\n            var newComponentA = new ComponentA();\n            _entity.ReplaceComponentA(newComponentA);\n            AssertHasComponentA(_entity, newComponentA);\n        }\n\n        [Fact]\n        public void DoesNotHaveAllComponentsWhenNotAllComponentsWereAdded()\n        {\n            _entity.AddComponentA();\n            _entity.HasComponents(_indexesAB).Should().BeFalse();\n        }\n\n        [Fact]\n        public void HasAnyComponentsWhenAnyComponentWasAdded()\n        {\n            _entity.AddComponentA();\n            _entity.HasAnyComponent(_indexesAB).Should().BeTrue();\n        }\n\n        [Fact]\n        public void IsEmpty()\n        {\n            _entity.IsEmpty().Should().BeTrue();\n        }\n\n        [Fact]\n        public void IsNotEmptyWhenAnyComponentWasAdded()\n        {\n            _entity.AddComponentA();\n            _entity.IsEmpty().Should().BeFalse();\n        }\n\n        [Fact]\n        public void GetsAllComponents()\n        {\n            _entity.AddComponentA();\n            _entity.AddComponentB();\n            var components = _entity.GetComponents();\n            components.Length.Should().Be(2);\n            components.Should().Contain(Component.A);\n            components.Should().Contain(Component.B);\n        }\n\n        [Fact]\n        public void GetsAllComponentIndexes()\n        {\n            _entity.AddComponentA();\n            _entity.AddComponentB();\n            var componentIndexes = _entity.GetComponentIndexes();\n            componentIndexes.Length.Should().Be(2);\n            componentIndexes.Should().Contain(CID.ComponentA);\n            componentIndexes.Should().Contain(CID.ComponentB);\n        }\n\n        [Fact]\n        public void HasOtherComponent()\n        {\n            _entity.AddComponentA();\n            _entity.AddComponentB();\n            _entity.HasComponentB().Should().BeTrue();\n        }\n\n        [Fact]\n        public void HasComponentsWhenAllComponentsWereAdded()\n        {\n            _entity.AddComponentA();\n            _entity.AddComponentB();\n            _entity.HasComponents(_indexesAB).Should().BeTrue();\n        }\n\n        [Fact]\n        public void RemovesAllComponents()\n        {\n            _entity.AddComponentA();\n            _entity.AddComponentB();\n            _entity.RemoveAllComponents();\n            _entity.HasComponentA().Should().BeFalse();\n            _entity.HasComponentB().Should().BeFalse();\n            _entity.GetComponents().Should().BeEmpty();\n            _entity.GetComponentIndexes().Should().BeEmpty();\n        }\n\n        [Fact]\n        public void ToStringDoesNotRemoveComponentSuffix()\n        {\n            _entity.AddUser(\"Test\", 42);\n            _entity.Retain(this);\n            _entity.ToString().Should().Be(\"Entity_0(User(Test, 42))\");\n        }\n\n        [Fact]\n        public void UsesComponentToString()\n        {\n            _entity.AddComponent(0, new UserComponent { Name = \"Max\", Age = 42 });\n            _entity.ToString().Should().Be(\"Entity_0(User(Max, 42))\");\n        }\n\n        [Fact]\n        public void UsesFullComponentNameWithNamespaceIfToStringIsNotImplemented()\n        {\n            _entity.AddComponent(0, new My.Namespace.UserComponent());\n            _entity.ToString().Should().Be(\"Entity_0(My.Namespace.UserComponent)\");\n        }\n\n        [Fact]\n        public void GetsComponentPool()\n        {\n            var componentPool = _entity.GetComponentPool(CID.ComponentA);\n            componentPool.Count.Should().Be(0);\n        }\n\n        [Fact]\n        public void GetsSameComponentPoolInstance()\n        {\n            _entity.GetComponentPool(CID.ComponentA)\n                .Should().BeSameAs(_entity.GetComponentPool(CID.ComponentA));\n        }\n\n        [Fact]\n        public void PushesComponentToComponentPoolWhenRemoved()\n        {\n            _entity.AddComponentA();\n            var component = _entity.GetComponentA();\n            _entity.RemoveComponentA();\n\n            var componentPool = _entity.GetComponentPool(CID.ComponentA);\n            componentPool.Count.Should().Be(1);\n            componentPool.Pop().Should().BeSameAs(component);\n        }\n\n        [Fact]\n        public void CreatesNewComponentWhenComponentPoolIsEmpty()\n        {\n            var type = typeof(UserComponent);\n            var component = _entity.CreateComponent(1, type);\n            component.GetType().Should().Be(type);\n\n            var user = (UserComponent)component;\n            user.Name.Should().BeNull();\n            user.Age.Should().Be(0);\n        }\n\n        [Fact]\n        public void GetsPooledComponent()\n        {\n            var component = new UserComponent();\n            _entity.AddComponent(1, component);\n            _entity.RemoveComponent(1);\n            var newComponent = (UserComponent)_entity.CreateComponent(1, typeof(UserComponent));\n            newComponent.Should().BeSameAs(component);\n        }\n\n        [Fact]\n        public void DispatchesOnComponentAddedWhenAddingComponent()\n        {\n            var didDispatch = 0;\n            _entity.OnComponentAdded += (entity, index, component) =>\n            {\n                didDispatch += 1;\n                entity.Should().BeSameAs(_entity);\n                index.Should().Be(CID.ComponentA);\n                component.Should().BeSameAs(Component.A);\n            };\n            _entity.OnComponentRemoved += delegate { throw new Exception(\"entity.OnComponentRemoved\"); };\n            _entity.OnComponentReplaced += delegate { throw new Exception(\"entity.OnComponentReplaced\"); };\n\n            _entity.AddComponentA();\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void DispatchesOnComponentRemovedWhenRemovingComponent()\n        {\n            var didDispatch = 0;\n            _entity.AddComponentA();\n\n            _entity.OnComponentRemoved += (entity, index, component) =>\n            {\n                didDispatch += 1;\n                entity.Should().BeSameAs(_entity);\n                index.Should().Be(CID.ComponentA);\n                component.Should().BeSameAs(Component.A);\n            };\n            _entity.OnComponentAdded += delegate { throw new Exception(\"entity.OnComponentAdded\"); };\n            _entity.OnComponentReplaced += delegate { throw new Exception(\"entity.OnComponentReplaced\"); };\n\n            _entity.RemoveComponentA();\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void DispatchesOnComponentRemovedBeforePushingComponentToPool()\n        {\n            _entity.AddComponentA();\n\n            _entity.OnComponentRemoved += (entity, index, component) =>\n            {\n                var newComponent = entity.CreateComponent(index, component.GetType());\n                component.Should().NotBeSameAs(newComponent);\n            };\n\n            _entity.RemoveComponentA();\n        }\n\n        [Fact]\n        public void DispatchesOnComponentReplacedWhenReplacingComponent()\n        {\n            var didDispatch = 0;\n            _entity.AddComponentA();\n            var newComponentA = new ComponentA();\n\n            _entity.OnComponentReplaced += (entity, index, previousComponent, newComponent) =>\n            {\n                didDispatch += 1;\n                entity.Should().BeSameAs(_entity);\n                index.Should().Be(CID.ComponentA);\n                previousComponent.Should().BeSameAs(Component.A);\n                newComponent.Should().BeSameAs(newComponentA);\n            };\n            _entity.OnComponentAdded += delegate { throw new Exception(\"OnComponentAdded\"); };\n            _entity.OnComponentRemoved += delegate { throw new Exception(\"OnComponentRemoved\"); };\n\n            _entity.ReplaceComponentA(newComponentA);\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void ProvidesPreviousAndNewComponentOnComponentReplacedWhenReplacingWithDifferentComponent()\n        {\n            var didDispatch = 0;\n            var prevComp = new ComponentA();\n            var newComp = new ComponentA();\n\n            _entity.OnComponentReplaced += (entity, _, previousComponent, newComponent) =>\n            {\n                didDispatch += 1;\n                entity.Should().BeSameAs(_entity);\n                previousComponent.Should().BeSameAs(prevComp);\n                newComponent.Should().BeSameAs(newComp);\n            };\n\n            _entity.AddComponent(CID.ComponentA, prevComp);\n            _entity.ReplaceComponent(CID.ComponentA, newComp);\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void ProvidesPreviousAndNewComponentOnComponentReplacedWhenReplacingWithSameComponent()\n        {\n            var didDispatch = 0;\n            _entity.OnComponentReplaced += (entity, _, previousComponent, newComponent) =>\n            {\n                didDispatch += 1;\n                entity.Should().BeSameAs(_entity);\n                previousComponent.Should().BeSameAs(Component.A);\n                newComponent.Should().BeSameAs(Component.A);\n            };\n\n            _entity.AddComponentA();\n            _entity.ReplaceComponentA(Component.A);\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void DoesNotDispatchAnythingWhenReplacingNonExistingComponentWithNull()\n        {\n            _entity.OnComponentAdded += delegate { throw new Exception(\"entity.OnComponentAdded\"); };\n            _entity.OnComponentReplaced += delegate { throw new Exception(\"entity.OnComponentReplaced\"); };\n            _entity.OnComponentRemoved += delegate { throw new Exception(\"entity.OnComponentRemoved\"); };\n            _entity.ReplaceComponentA(null);\n        }\n\n        [Fact]\n        public void DispatchesOnComponentAddedWhenReplaceComponentWhichHasNotBeenAdded()\n        {\n            var didDispatch = 0;\n            var newComponentA = new ComponentA();\n\n            _entity.OnComponentAdded += (entity, index, component) =>\n            {\n                didDispatch += 1;\n                entity.Should().BeSameAs(_entity);\n                index.Should().Be(CID.ComponentA);\n                component.Should().BeSameAs(newComponentA);\n            };\n            _entity.OnComponentReplaced += delegate { throw new Exception(\"entity.OnComponentReplaced\"); };\n            _entity.OnComponentRemoved += delegate { throw new Exception(\"entity.OnComponentRemoved\"); };\n\n            _entity.ReplaceComponentA(newComponentA);\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void DispatchesOnComponentRemovedWhenReplacingComponentWithNull()\n        {\n            var didDispatch = 0;\n            _entity.AddComponentA();\n\n            _entity.OnComponentRemoved += (_, _, component) =>\n            {\n                didDispatch += 1;\n                component.Should().BeSameAs(Component.A);\n            };\n            _entity.OnComponentAdded += delegate { throw new Exception(\"entity.OnComponentAdded\"); };\n            _entity.OnComponentReplaced += delegate { throw new Exception(\"entity.OnComponentReplaced\"); };\n\n            _entity.ReplaceComponentA(null);\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void DispatchesOnComponentRemovedWhenRemovingAllComponents()\n        {\n            var didDispatch = 0;\n            _entity.AddComponentA();\n            _entity.AddComponentB();\n            _entity.OnComponentRemoved += delegate { didDispatch += 1; };\n            _entity.RemoveAllComponents();\n            didDispatch.Should().Be(2);\n        }\n\n        [Fact]\n        public void DispatchesOnDestroyWhenCallingDestroy()\n        {\n            var didDispatch = 0;\n            _entity.OnDestroyEntity += delegate { didDispatch += 1; };\n            _entity.Destroy();\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void RetainsEntity()\n        {\n            _entity.RetainCount.Should().Be(0);\n            _entity.Retain(this);\n            _entity.RetainCount.Should().Be(1);\n            (_entity.Aerc as SafeAERC)?.Owners.Should().Contain(this);\n        }\n\n        [Fact]\n        public void ReleasesEntity()\n        {\n            _entity.Retain(this);\n            _entity.Release(this);\n            _entity.RetainCount.Should().Be(0);\n            (_entity.Aerc as SafeAERC)?.Owners.Should().NotContain(this);\n        }\n\n        [Fact]\n        public void ThrowsWhenReleasingMoreThanItHasBeenRetained()\n        {\n            _entity.Retain(this);\n            _entity.Release(this);\n            FluentActions.Invoking(() => _entity.Release(this))\n                .Should().Throw<EntityIsNotRetainedByOwnerException>();\n        }\n\n        [Fact]\n        public void ThrowsWhenRetainingTwiceWithSameOwner()\n        {\n            var owner = new object();\n            _entity.Retain(owner);\n            FluentActions.Invoking(() => _entity.Retain(owner))\n                .Should().Throw<EntityIsAlreadyRetainedByOwnerException>();\n        }\n\n        [Fact]\n        public void ThrowsWhenReleasingWithUnknownOwner()\n        {\n            _entity.Retain(new object());\n            FluentActions.Invoking(() => _entity.Release(new object()))\n                .Should().Throw<EntityIsNotRetainedByOwnerException>();\n        }\n\n        [Fact]\n        public void ThrowsWhenReleasingWithOwnerWhichDoesNotRetainEntityAnymore()\n        {\n            var owner1 = new object();\n            var owner2 = new object();\n            _entity.Retain(owner1);\n            _entity.Retain(owner2);\n            _entity.Release(owner2);\n            FluentActions.Invoking(() => _entity.Release(owner2))\n                .Should().Throw<EntityIsNotRetainedByOwnerException>();\n        }\n\n        [Fact]\n        public void DoesNotDispatchOnEntityReleasedWhenRetaining()\n        {\n            _entity.OnEntityReleased += delegate { throw new Exception(\"entity.OnEntityReleased\"); };\n            _entity.Retain(this);\n        }\n\n        [Fact]\n        public void DispatchesOnEntityReleasedWhenRetainAndRelease()\n        {\n            var didDispatch = 0;\n            _entity.OnEntityReleased += entity =>\n            {\n                didDispatch += 1;\n                entity.Should().BeSameAs(_entity);\n            };\n\n            _entity.Retain(this);\n            _entity.Release(this);\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void CachesComponentsAndIndexes()\n        {\n            _entity.AddComponentA();\n            _entity.GetComponents().Should().BeSameAs(_entity.GetComponents());\n            _entity.GetComponentIndexes().Should().BeSameAs(_entity.GetComponentIndexes());\n        }\n\n        [Fact]\n        public void UpdatesCacheWhenNewComponentIsAdded()\n        {\n            _entity.AddComponentA();\n            var components = _entity.GetComponents();\n            var indexes = _entity.GetComponentIndexes();\n            _entity.AddComponentB();\n            _entity.GetComponents().Should().NotBeSameAs(components);\n            _entity.GetComponentIndexes().Should().NotBeSameAs(indexes);\n        }\n\n        [Fact]\n        public void UpdatesCacheWhenComponentIsRemoved()\n        {\n            _entity.AddComponentA();\n            var components = _entity.GetComponents();\n            var indexes = _entity.GetComponentIndexes();\n            _entity.RemoveComponentA();\n            _entity.GetComponents().Should().NotBeSameAs(components);\n            _entity.GetComponentIndexes().Should().NotBeSameAs(indexes);\n        }\n\n        [Fact]\n        public void UpdatesComponentsCacheButNotIndexesCacheWhenComponentIsReplaced()\n        {\n            _entity.AddComponentA();\n            var components = _entity.GetComponents();\n            var indexes = _entity.GetComponentIndexes();\n            _entity.ReplaceComponentA(new ComponentA());\n            _entity.GetComponents().Should().NotBeSameAs(components);\n            _entity.GetComponentIndexes().Should().BeSameAs(indexes);\n        }\n\n        [Fact]\n        public void UpdatesIndexesCacheWhenAddingNewComponentWithReplaceComponent()\n        {\n            _entity.AddComponentA();\n            var indexes = _entity.GetComponentIndexes();\n            _entity.ReplaceComponentC(Component.C);\n            _entity.GetComponentIndexes().Should().NotBeSameAs(indexes);\n        }\n\n        [Fact]\n        public void DoesNotUpdateCacheWhenComponentIsReplacedWithSameComponent()\n        {\n            _entity.AddComponentA();\n            var components = _entity.GetComponents();\n            var indexes = _entity.GetComponentIndexes();\n            _entity.ReplaceComponentA(Component.A);\n            _entity.GetComponents().Should().BeSameAs(components);\n            _entity.GetComponentIndexes().Should().BeSameAs(indexes);\n        }\n\n        [Fact]\n        public void UpdatesCacheWhenAllComponentsAreRemoved()\n        {\n            _entity.AddComponentA();\n            var components = _entity.GetComponents();\n            var indexes = _entity.GetComponentIndexes();\n            _entity.RemoveAllComponents();\n            _entity.GetComponents().Should().NotBeSameAs(components);\n            _entity.GetComponentIndexes().Should().NotBeSameAs(indexes);\n        }\n\n        [Fact]\n        public void CachesEntityDescription()\n        {\n            _entity.AddComponentA();\n            _entity.ToString().Should().BeSameAs(_entity.ToString());\n        }\n\n        [Fact]\n        public void UIpdatesCacheWhenNewComponentWasAdded()\n        {\n            _entity.AddComponentA();\n            var cache = _entity.ToString();\n            _entity.AddComponentB();\n            _entity.ToString().Should().NotBeSameAs(cache);\n        }\n\n        [Fact]\n        public void UpdatesCacheWhenComponentWasRemoved()\n        {\n            _entity.AddComponentA();\n            var cache = _entity.ToString();\n            _entity.RemoveComponentA();\n            _entity.ToString().Should().NotBeSameAs(cache);\n        }\n\n        [Fact]\n        public void DoesUpdateCacheWhenComponentWasReplaced()\n        {\n            _entity.AddComponentA();\n            var cache = _entity.ToString();\n            _entity.ReplaceComponentA(new ComponentA());\n            _entity.ToString().Should().NotBeSameAs(cache);\n        }\n\n        [Fact]\n        public void UpdatesCacheWhenAllComponentsWereRemoved()\n        {\n            _entity.AddComponentA();\n            var cache = _entity.ToString();\n            _entity.RemoveAllComponents();\n            _entity.ToString().Should().NotBeSameAs(cache);\n        }\n\n        [Fact]\n        public void DoesNotUpdateCacheWhenEntityGetsRetained()\n        {\n            _entity.AddComponentA();\n            var cache = _entity.ToString();\n            _entity.Retain(this);\n            _entity.ToString().Should().BeSameAs(cache);\n        }\n\n        [Fact]\n        public void DoesNotUpdateCacheWhenEntityGetsReleased()\n        {\n            _entity.Retain(this);\n            _entity.Retain(new object());\n            var cache = _entity.ToString();\n            _entity.Release(this);\n            _entity.ToString().Should().BeSameAs(cache);\n        }\n\n        [Fact]\n        public void ReleasedEntityDoesNotHaveUpdatedCache()\n        {\n            _entity.Retain(this);\n            var cache = _entity.ToString();\n            _entity.OnEntityReleased += _ => { _entity.ToString().Should().BeSameAs(cache); };\n            _entity.Release(this);\n        }\n\n        [Fact]\n        public void UpdatesCacheWhenRemoveAllComponentsIsCalledEvenIfEntityHasNoComponents()\n        {\n            var cache = _entity.ToString();\n            _entity.RemoveAllComponents();\n            _entity.ToString().Should().NotBeSameAs(cache);\n        }\n\n        void AssertHasComponentA(TestEntity entity, IComponent componentA = null)\n        {\n            componentA ??= Component.A;\n\n            entity.GetComponentA().Should().BeSameAs(componentA);\n\n            var components = entity.GetComponents();\n            components.Length.Should().Be(1);\n            components.Should().Contain(componentA);\n\n            var indexes = entity.GetComponentIndexes();\n            indexes.Length.Should().Be(1);\n            indexes.Should().Contain(CID.ComponentA);\n\n            entity.HasComponentA().Should().BeTrue();\n            entity.HasComponents(_indexesA).Should().BeTrue();\n            entity.HasAnyComponent(_indexesA).Should().BeTrue();\n        }\n\n        void AssertHasNotComponentA(TestEntity entity)\n        {\n            var components = entity.GetComponents();\n            components.Length.Should().Be(0);\n\n            var indexes = entity.GetComponentIndexes();\n            indexes.Length.Should().Be(0);\n\n            entity.HasComponentA().Should().BeFalse();\n            entity.HasComponents(_indexesA).Should().BeFalse();\n            entity.HasAnyComponent(_indexesA).Should().BeFalse();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/GroupTests.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Tests\n{\n    public class GroupTests\n    {\n        readonly IGroup<TestEntity> _groupA;\n        readonly TestEntity _entity1;\n        readonly TestEntity _entity2;\n\n        public GroupTests()\n        {\n            _groupA = new Group<TestEntity>(Matcher<TestEntity>.AllOf(CID.ComponentA));\n            _entity1 = CreateEntity().AddComponentA();\n            _entity2 = CreateEntity().AddComponentA();\n        }\n\n        [Fact]\n        public void DoesNotHaveEntitiesWhichHaveNotBeenAdded()\n        {\n            _groupA.GetEntities().Should().BeEmpty();\n        }\n\n        [Fact]\n        public void DoesNotAddEntitiesToBuffer()\n        {\n            var buffer = new List<TestEntity>();\n            buffer.Add(CreateEntity());\n            var retBuffer = _groupA.GetEntities(buffer);\n            buffer.Should().BeEmpty();\n            retBuffer.Should().BeSameAs(buffer);\n        }\n\n        [Fact]\n        public void IsEmpty()\n        {\n            _groupA.Count.Should().Be(0);\n        }\n\n        [Fact]\n        public void DoesNotContainEntity()\n        {\n            _groupA.ContainsEntity(_entity1).Should().BeFalse();\n        }\n\n        [Fact]\n        public void AddsMatchingEntity()\n        {\n            HandleSilently(_entity1);\n            AssertContains(_entity1);\n        }\n\n        [Fact]\n        public void FillsBufferWithEntities()\n        {\n            HandleSilently(_entity1);\n            var buffer = new List<TestEntity>();\n            _groupA.GetEntities(buffer);\n            buffer.Count.Should().Be(1);\n            buffer[0].Should().BeSameAs(_entity1);\n        }\n\n        [Fact]\n        public void ClearsBufferBeforeFilling()\n        {\n            HandleSilently(_entity1);\n            var buffer = new List<TestEntity>();\n            buffer.Add(CreateEntity());\n            buffer.Add(CreateEntity());\n            _groupA.GetEntities(buffer);\n            buffer.Count.Should().Be(1);\n            buffer[0].Should().BeSameAs(_entity1);\n        }\n\n        [Fact]\n        public void DoesNotAddSameEntityTwice()\n        {\n            HandleSilently(_entity1);\n            HandleSilently(_entity1);\n            AssertContains(_entity1);\n        }\n\n        [Fact]\n        public void EnumeratesGroup()\n        {\n            HandleSilently(_entity1);\n            var i = 0;\n            Entity entity = null;\n            foreach (var e in _groupA)\n            {\n                i++;\n                entity = e;\n            }\n\n            i.Should().Be(1);\n            entity.Should().BeSameAs(_entity1);\n        }\n\n        [Fact]\n        public void ReturnsEnumerable()\n        {\n            HandleSilently(_entity1);\n            _groupA.AsEnumerable().Single().Should().BeSameAs(_entity1);\n        }\n\n        [Fact]\n        public void RemovesEntity()\n        {\n            HandleSilently(_entity1);\n            _entity1.RemoveComponentA();\n            HandleSilently(_entity1);\n            AssertContainsNot(_entity1);\n        }\n\n        [Fact]\n        public void DoesNotAddEntityWhenEntityIsNotEnabled()\n        {\n            _entity1.InternalDestroy();\n            HandleSilently(_entity1);\n            AssertContainsNot(_entity1);\n        }\n\n        [Fact]\n        public void DoesNotAddEntityWhenNotMatching()\n        {\n            var entity = CreateEntity().AddComponentB();\n            HandleSilently(entity);\n            AssertContainsNot(entity);\n        }\n\n        [Fact]\n        public void ReturnsNullWhenSingleEntityDoesNotExist()\n        {\n            _groupA.GetSingleEntity().Should().BeNull();\n        }\n\n        [Fact]\n        public void ReturnsSingleEntity()\n        {\n            HandleSilently(_entity1);\n            _groupA.GetSingleEntity().Should().BeSameAs(_entity1);\n        }\n\n        [Fact]\n        public void ThrowsWhenGettingSingleEntityAndMultipleMatchingEntitiesExist()\n        {\n            HandleSilently(_entity1);\n            HandleSilently(_entity2);\n            FluentActions.Invoking(() => _groupA.GetSingleEntity())\n                .Should().Throw<GroupSingleEntityException<TestEntity>>();\n        }\n\n        [Fact]\n        public void DispatchesOnEntityAddedWhenMatchingEntityAdded()\n        {\n            var didDispatch = 0;\n            _groupA.OnEntityAdded += (group, entity, index, component) =>\n            {\n                didDispatch++;\n                group.Should().BeSameAs(_groupA);\n                entity.Should().BeSameAs(_entity1);\n                index.Should().Be(CID.ComponentA);\n                component.Should().BeSameAs(Component.A);\n            };\n            _groupA.OnEntityRemoved += delegate { throw new Exception(\"group.OnEntityRemoved\"); };\n            _groupA.OnEntityUpdated += delegate { throw new Exception(\"group.OnEntityUpdated\"); };\n\n            HandleAddA(_entity1);\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void DoesNotDispatchOnEntityAddedWhenMatchingEntityAlreadyHasBeenAdded()\n        {\n            HandleAddA(_entity1);\n            _groupA.OnEntityAdded += delegate { throw new Exception(\"group.OnEntityAdded\"); };\n            _groupA.OnEntityRemoved += delegate { throw new Exception(\"group.OnEntityRemoved\"); };\n            _groupA.OnEntityUpdated += delegate { throw new Exception(\"group.OnEntityUpdated\"); };\n            HandleAddA(_entity1);\n        }\n\n        [Fact]\n        public void DoesNotDispatchOnEntityAddedWhenEntityIsNotMatching()\n        {\n            var entity = CreateEntity().AddComponentB();\n            _groupA.OnEntityAdded += delegate { throw new Exception(\"group.OnEntityAdded\"); };\n            _groupA.OnEntityRemoved += delegate { throw new Exception(\"group.OnEntityRemoved\"); };\n            _groupA.OnEntityUpdated += delegate { throw new Exception(\"group.OnEntityUpdated\"); };\n            HandleAddB(entity);\n        }\n\n        [Fact]\n        public void DispatchesOnEntityRemovedWhenEntityGotRemoved()\n        {\n            var didDispatch = 0;\n            HandleSilently(_entity1);\n            _groupA.OnEntityRemoved += (group, entity, index, component) =>\n            {\n                didDispatch++;\n                group.Should().BeSameAs(_groupA);\n                entity.Should().BeSameAs(_entity1);\n                index.Should().Be(CID.ComponentA);\n                component.Should().BeSameAs(Component.A);\n            };\n            _groupA.OnEntityAdded += delegate { throw new Exception(\"group.OnEntityAdded\"); };\n            _groupA.OnEntityUpdated += delegate { throw new Exception(\"group.OnEntityUpdated\"); };\n\n            _entity1.RemoveComponentA();\n            HandleRemoveA(_entity1, Component.A);\n\n            didDispatch.Should().Be(1);\n        }\n\n        [Fact]\n        public void DoesNotDispatchOnEntityRemovedWhenEntityDidNotGetRemoved()\n        {\n            _groupA.OnEntityRemoved += delegate { throw new Exception(\"group.OnEntityRemoved\"); };\n            _entity1.RemoveComponentA();\n            HandleRemoveA(_entity1, Component.A);\n        }\n\n        [Fact]\n        public void DispatchesOnEntityRemovedOnEntityAddedAndOnEntityUpdatedWhenUpdating()\n        {\n            HandleSilently(_entity1);\n\n            var removed = 0;\n            var added = 0;\n            var updated = 0;\n            var newComponentA = new ComponentA();\n\n            _groupA.OnEntityRemoved += (group, entity, index, component) =>\n            {\n                removed += 1;\n                group.Should().Be(_groupA);\n                entity.Should().Be(_entity1);\n                index.Should().Be(CID.ComponentA);\n                component.Should().BeSameAs(Component.A);\n            };\n            _groupA.OnEntityAdded += (group, entity, index, component) =>\n            {\n                added += 1;\n                group.Should().Be(_groupA);\n                entity.Should().Be(_entity1);\n                index.Should().Be(CID.ComponentA);\n                component.Should().BeSameAs(newComponentA);\n            };\n            _groupA.OnEntityUpdated += (group, entity, index, previousComponent, newComponent) =>\n            {\n                updated += 1;\n                group.Should().Be(_groupA);\n                entity.Should().Be(_entity1);\n                index.Should().Be(CID.ComponentA);\n                previousComponent.Should().BeSameAs(Component.A);\n                newComponent.Should().BeSameAs(newComponentA);\n            };\n\n            UpdateA(_entity1, newComponentA);\n\n            removed.Should().Be(1);\n            added.Should().Be(1);\n            updated.Should().Be(1);\n        }\n\n        [Fact]\n        public void DoesNotDispatchOnEntityRemovedAndOnEntityAddedWhenUpdatingWhenGroupDoesNotContainEntity()\n        {\n            _groupA.OnEntityRemoved += delegate { throw new Exception(\"group.OnEntityRemoved\"); };\n            _groupA.OnEntityAdded += delegate { throw new Exception(\"group.OnEntityAdded\"); };\n            _groupA.OnEntityUpdated += delegate { throw new Exception(\"group.OnEntityUpdated\"); };\n            UpdateA(_entity1, new ComponentA());\n        }\n\n        [Fact]\n        public void RemovesAllEventHandlers()\n        {\n            _groupA.OnEntityAdded += delegate { throw new Exception(\"group.OnEntityAdded\"); };\n            _groupA.OnEntityRemoved += delegate { throw new Exception(\"group.OnEntityRemoved\"); };\n            _groupA.OnEntityUpdated += delegate { throw new Exception(\"group.OnEntityUpdated\"); };\n\n            _groupA.RemoveAllEventHandlers();\n\n            HandleAddA(_entity1);\n\n            var cA = _entity1.GetComponentA();\n            _entity1.RemoveComponentA();\n            HandleRemoveA(_entity1, cA);\n\n            _entity1.AddComponentA();\n            HandleAddA(_entity1);\n            UpdateA(_entity1, Component.A);\n        }\n\n        [Fact]\n        public void GetsCachedEntities()\n        {\n            HandleSilently(_entity1);\n            _groupA.GetEntities().Should().BeSameAs(_groupA.GetEntities());\n        }\n\n        [Fact]\n        public void UpdatesCacheWhenAddingNewMatchingEntity()\n        {\n            HandleSilently(_entity1);\n            var cache = _groupA.GetEntities();\n            HandleSilently(_entity2);\n            _groupA.GetEntities().Should().NotBeSameAs(cache);\n        }\n\n        [Fact]\n        public void DoesNotUpdateCacheWhenAddingNotMatchingEntity()\n        {\n            HandleSilently(_entity1);\n            var cache = _groupA.GetEntities();\n            var entity = CreateEntity();\n            HandleSilently(entity);\n            _groupA.GetEntities().Should().BeSameAs(cache);\n        }\n\n        [Fact]\n        public void UpdatesCacheWhenRemovingEntity()\n        {\n            HandleSilently(_entity1);\n            var cache = _groupA.GetEntities();\n            _entity1.RemoveComponentA();\n            HandleSilently(_entity1);\n            _groupA.GetEntities().Should().NotBeSameAs(cache);\n        }\n\n        [Fact]\n        public void DoesNotUpdateCacheWhenRemovingEntityThatWasNotAddedBefore()\n        {\n            HandleSilently(_entity1);\n            var cache = _groupA.GetEntities();\n            _entity2.RemoveComponentA();\n            HandleSilently(_entity2);\n            _groupA.GetEntities().Should().BeSameAs(cache);\n        }\n\n        [Fact]\n        public void DoesNotUpdateCacheWhenUpdatingEntity()\n        {\n            HandleSilently(_entity1);\n            var cache = _groupA.GetEntities();\n            UpdateA(_entity1, new ComponentA());\n            _groupA.GetEntities().Should().BeSameAs(cache);\n        }\n\n        [Fact]\n        public void GetsCachedSingleEntities()\n        {\n            HandleSilently(_entity1);\n            var cache = _groupA.GetSingleEntity();\n            _groupA.GetSingleEntity().Should().BeSameAs(cache);\n        }\n\n        [Fact]\n        public void UpdatesCacheWhenNewSingleEntityIsAdded()\n        {\n            HandleSilently(_entity1);\n            var cache = _groupA.GetSingleEntity();\n            _entity1.RemoveComponentA();\n            HandleSilently(_entity1);\n            HandleSilently(_entity2);\n            _groupA.GetSingleEntity().Should().NotBeSameAs(cache);\n        }\n\n        [Fact]\n        public void UpdatesCacheWhenSingleEntityIsRemoved()\n        {\n            HandleSilently(_entity1);\n            var cache = _groupA.GetSingleEntity();\n            _entity1.RemoveComponentA();\n            HandleSilently(_entity1);\n            _groupA.GetSingleEntity().Should().NotBeSameAs(cache);\n        }\n\n        [Fact]\n        public void DoesNotUpdateCacheWhenSingleEntityIsUpdated()\n        {\n            HandleSilently(_entity1);\n            var cache = _groupA.GetSingleEntity();\n            UpdateA(_entity1, new ComponentA());\n            _groupA.GetSingleEntity().Should().BeSameAs(cache);\n        }\n\n        [Fact]\n        public void RetainsMatchedEntity()\n        {\n            _entity1.RetainCount.Should().Be(0);\n            HandleSilently(_entity1);\n            _entity1.RetainCount.Should().Be(1);\n        }\n\n        [Fact]\n        public void ReleasesRemovedEntity()\n        {\n            HandleSilently(_entity1);\n            _entity1.RemoveComponentA();\n            HandleSilently(_entity1);\n            _entity1.RetainCount.Should().Be(0);\n        }\n\n        [Fact]\n        public void UpdatesCacheBeforeCallingDelegatesSilently()\n        {\n            var didExecute = 0;\n            _entity1.OnEntityReleased += _ =>\n            {\n                didExecute += 1;\n                _groupA.GetEntities().Length.Should().Be(0);\n            };\n            HandleSilently(_entity1);\n            _groupA.GetEntities();\n            _entity1.RemoveComponentA();\n            HandleSilently(_entity1);\n            didExecute.Should().Be(1);\n        }\n\n        [Fact]\n        public void UpdatesCacheBeforeCallingDelegates()\n        {\n            var didExecute = 0;\n            _entity1.OnEntityReleased += _ =>\n            {\n                didExecute += 1;\n                _groupA.GetEntities().Length.Should().Be(0);\n            };\n            HandleAddA(_entity1);\n            _groupA.GetEntities();\n            _entity1.RemoveComponentA();\n            HandleRemoveA(_entity1, Component.A);\n            didExecute.Should().Be(1);\n        }\n\n        [Fact]\n        public void UpdatesSingleEntityCacheBeforeCallingDelegatesSilently()\n        {\n            var didExecute = 0;\n            _entity1.OnEntityReleased += _ =>\n            {\n                didExecute += 1;\n                _groupA.GetSingleEntity().Should().BeNull();\n            };\n            HandleSilently(_entity1);\n            _groupA.GetSingleEntity();\n            _entity1.RemoveComponentA();\n            HandleSilently(_entity1);\n            didExecute.Should().Be(1);\n        }\n\n        [Fact]\n        public void UpdatesSingleEntityCacheBeforeCallingDelegates()\n        {\n            var didExecute = 0;\n            _entity1.OnEntityReleased += _ =>\n            {\n                didExecute += 1;\n                _groupA.GetSingleEntity().Should().BeNull();\n            };\n            HandleAddA(_entity1);\n            _groupA.GetSingleEntity();\n            _entity1.RemoveComponentA();\n            HandleRemoveA(_entity1, Component.A);\n            didExecute.Should().Be(1);\n        }\n\n        [Fact]\n        public void RetainsEntityUntilAfterEventHandlersWereCalled()\n        {\n            HandleAddA(_entity1);\n            var didDispatch = 0;\n            _groupA.OnEntityRemoved += (_, entity, _, _) =>\n            {\n                didDispatch += 1;\n                entity.RetainCount.Should().Be(1);\n            };\n            _entity1.RemoveComponentA();\n            HandleRemoveA(_entity1, Component.A);\n\n            didDispatch.Should().Be(1);\n            _entity1.RetainCount.Should().Be(0);\n        }\n\n        [Fact]\n        public void CanToString()\n        {\n            var matcher = Matcher<TestEntity>.AllOf(Matcher<TestEntity>.AllOf(0), Matcher<TestEntity>.AllOf(1));\n            var group = new Group<TestEntity>(matcher);\n            group.ToString().Should().Be(\"Group(AllOf(0, 1))\");\n        }\n\n        public static TestEntity CreateEntity()\n        {\n            var entity = new TestEntity();\n            entity.Initialize(0, CID.TotalComponents, new Stack<IComponent>[CID.TotalComponents]);\n            return entity;\n        }\n\n        void AssertContains(params TestEntity[] expectedEntities)\n        {\n            _groupA.Count.Should().Be(expectedEntities.Length);\n\n            var entities = _groupA.GetEntities();\n            entities.Length.Should().Be(expectedEntities.Length);\n\n            foreach (var entity in expectedEntities)\n            {\n                entities.Should().Contain(entity);\n                _groupA.ContainsEntity(entity).Should().BeTrue();\n            }\n        }\n\n        void AssertContainsNot(TestEntity entity)\n        {\n            _groupA.Count.Should().Be(0);\n            _groupA.GetEntities().Should().BeEmpty();\n            _groupA.ContainsEntity(entity).Should().BeFalse();\n        }\n\n        void HandleSilently(TestEntity entity) => _groupA.HandleEntitySilently(entity);\n        void Handle(TestEntity entity, int index, IComponent component) => _groupA.HandleEntity(entity, index, component);\n        void HandleAddA(TestEntity entity) => Handle(entity, CID.ComponentA, entity.GetComponentA());\n        void HandleAddB(TestEntity entity) => Handle(entity, CID.ComponentB, entity.GetComponentB());\n        void HandleRemoveA(TestEntity entity, IComponent component) => Handle(entity, CID.ComponentA, component);\n        void UpdateA(TestEntity entity, IComponent component) => _groupA.UpdateEntity(entity, CID.ComponentA, Component.A, component);\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/MatcherTests.cs",
    "content": "using System.Collections.Generic;\nusing FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Tests\n{\n    public class MatcherTests\n    {\n        readonly TestEntity _eA;\n        readonly TestEntity _eB;\n        readonly TestEntity _eC;\n        readonly TestEntity _eAB;\n        readonly TestEntity _eABC;\n\n        public MatcherTests()\n        {\n            _eA = CreateEntity();\n            _eA.AddComponentA();\n\n            _eB = CreateEntity();\n            _eB.AddComponentB();\n\n            _eC = CreateEntity();\n            _eC.AddComponentC();\n\n            _eAB = CreateEntity();\n            _eAB.AddComponentA();\n            _eAB.AddComponentB();\n\n            _eABC = CreateEntity();\n            _eABC.AddComponentA();\n            _eABC.AddComponentB();\n            _eABC.AddComponentC();\n        }\n\n        [Fact]\n        public void AllOfHasAllIndexes()\n        {\n            var matcher = CreateAllOfAB();\n            AssertIndexesEqual(matcher.Indexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(matcher.AllOfIndexes, CID.ComponentA, CID.ComponentB);\n        }\n\n        [Fact]\n        public void AnyOfHasAllIndexes()\n        {\n            var matcher = CreateAnyOfAB();\n            AssertIndexesEqual(matcher.Indexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(matcher.AnyOfIndexes, CID.ComponentA, CID.ComponentB);\n        }\n\n        [Fact]\n        public void AllOfNoneOfHasAllIndexes()\n        {\n            var matcher = CreateAllOfABNoneOfCD();\n            AssertIndexesEqual(matcher.Indexes, CID.ComponentA, CID.ComponentB, CID.ComponentC, CID.ComponentD);\n            AssertIndexesEqual(matcher.AllOfIndexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(matcher.NoneOfIndexes, CID.ComponentC, CID.ComponentD);\n        }\n\n        [Fact]\n        public void AnyOfNoneOfHasAllIndexes()\n        {\n            var matcher = CreateAnyOfABNoneOfCD();\n            AssertIndexesEqual(matcher.Indexes, CID.ComponentA, CID.ComponentB, CID.ComponentC, CID.ComponentD);\n            AssertIndexesEqual(matcher.AnyOfIndexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(matcher.NoneOfIndexes, CID.ComponentC, CID.ComponentD);\n        }\n\n        [Fact]\n        public void AllOfAnyOfHasAllIndexes()\n        {\n            var matcher = CreateAllOfABAnyOfCD();\n            AssertIndexesEqual(matcher.Indexes, CID.ComponentA, CID.ComponentB, CID.ComponentC, CID.ComponentD);\n            AssertIndexesEqual(matcher.AllOfIndexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(matcher.AnyOfIndexes, CID.ComponentC, CID.ComponentD);\n        }\n\n        [Fact]\n        public void AllOfHasAllIndexesWithoutDuplicates()\n        {\n            var matcher = Matcher<TestEntity>.AllOf(CID.ComponentA, CID.ComponentA, CID.ComponentB, CID.ComponentB);\n            AssertIndexesEqual(matcher.Indexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(matcher.AllOfIndexes, CID.ComponentA, CID.ComponentB);\n        }\n\n        [Fact]\n        public void AnyOfHasAllIndexesWithoutDuplicates()\n        {\n            var matcher = Matcher<TestEntity>.AnyOf(CID.ComponentA, CID.ComponentA, CID.ComponentB, CID.ComponentB);\n            AssertIndexesEqual(matcher.Indexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(matcher.AnyOfIndexes, CID.ComponentA, CID.ComponentB);\n        }\n\n        [Fact]\n        public void AllOfNoneOfHasAllIndexesWithoutDuplicates()\n        {\n            var matcher = Matcher<TestEntity>\n                .AllOf(CID.ComponentA, CID.ComponentA, CID.ComponentB)\n                .NoneOf(CID.ComponentB, CID.ComponentC, CID.ComponentC);\n            AssertIndexesEqual(matcher.Indexes, CID.ComponentA, CID.ComponentB, CID.ComponentC);\n            AssertIndexesEqual(matcher.AllOfIndexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(matcher.NoneOfIndexes, CID.ComponentB, CID.ComponentC);\n        }\n\n        [Fact]\n        public void AnyOfNoneOfHasAllIndexesWithoutDuplicates()\n        {\n            var matcher = Matcher<TestEntity>\n                .AnyOf(CID.ComponentA, CID.ComponentA, CID.ComponentB)\n                .NoneOf(CID.ComponentB, CID.ComponentC, CID.ComponentC);\n            AssertIndexesEqual(matcher.Indexes, CID.ComponentA, CID.ComponentB, CID.ComponentC);\n            AssertIndexesEqual(matcher.AnyOfIndexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(matcher.NoneOfIndexes, CID.ComponentB, CID.ComponentC);\n        }\n\n        [Fact]\n        public void AllOfAnyOfHasAllIndexesWithoutDuplicates()\n        {\n            var matcher = Matcher<TestEntity>\n                .AllOf(CID.ComponentA, CID.ComponentA, CID.ComponentB)\n                .AnyOf(CID.ComponentB, CID.ComponentC, CID.ComponentC);\n            AssertIndexesEqual(matcher.Indexes, CID.ComponentA, CID.ComponentB, CID.ComponentC);\n            AssertIndexesEqual(matcher.AllOfIndexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(matcher.AnyOfIndexes, CID.ComponentB, CID.ComponentC);\n        }\n\n        [Fact]\n        public void AllOfCachesIndexes()\n        {\n            var matcher = CreateAllOfAB();\n            matcher.Indexes.Should().BeSameAs(matcher.Indexes);\n        }\n\n        [Fact]\n        public void AnyOfCachesIndexes()\n        {\n            var matcher = CreateAnyOfAB();\n            matcher.Indexes.Should().BeSameAs(matcher.Indexes);\n        }\n\n        [Fact]\n        public void AllOfNoneOfCachesIndexes()\n        {\n            var matcher = CreateAllOfABNoneOfCD();\n            matcher.Indexes.Should().BeSameAs(matcher.Indexes);\n        }\n\n        [Fact]\n        public void AnyOfNoneOfCachesIndexes()\n        {\n            var matcher = CreateAnyOfABNoneOfCD();\n            matcher.Indexes.Should().BeSameAs(matcher.Indexes);\n        }\n\n        [Fact]\n        public void AllOfAnyOfCachesIndexes()\n        {\n            var matcher = CreateAllOfABAnyOfCD();\n            matcher.Indexes.Should().BeSameAs(matcher.Indexes);\n        }\n\n        [Fact]\n        public void AllOfDoesNotMatch()\n        {\n            CreateAllOfAB().Matches(_eA).Should().BeFalse();\n        }\n\n        [Fact]\n        public void AnyOfDoesNotMatch()\n        {\n            CreateAnyOfAB().Matches(_eC).Should().BeFalse();\n        }\n\n        [Fact]\n        public void AllOfNoneOfDoesNotMatch()\n        {\n            CreateAllOfABNoneOfCD().Matches(_eABC).Should().BeFalse();\n        }\n\n        [Fact]\n        public void AnyOfNoneOfDoesNotMatch()\n        {\n            CreateAnyOfABNoneOfCD().Matches(_eABC).Should().BeFalse();\n        }\n\n        [Fact]\n        public void AllOfAnyOfDoesNotMatch()\n        {\n            CreateAllOfABAnyOfCD().Matches(_eAB).Should().BeFalse();\n        }\n\n        [Fact]\n        public void AllOfMatches()\n        {\n            var matcher = CreateAllOfAB();\n            matcher.Matches(_eAB).Should().BeTrue();\n            matcher.Matches(_eABC).Should().BeTrue();\n        }\n\n        [Fact]\n        public void AnyOfMatches()\n        {\n            var matcher = CreateAnyOfAB();\n            matcher.Matches(_eA).Should().BeTrue();\n            matcher.Matches(_eB).Should().BeTrue();\n            matcher.Matches(_eABC).Should().BeTrue();\n        }\n\n        [Fact]\n        public void AllOfNoneOfMatches()\n        {\n            CreateAllOfABNoneOfCD().Matches(_eAB).Should().BeTrue();\n        }\n\n        [Fact]\n        public void AnyOfNoneOfMatches()\n        {\n            var matcher = CreateAnyOfABNoneOfCD();\n            matcher.Matches(_eA).Should().BeTrue();\n            matcher.Matches(_eB).Should().BeTrue();\n        }\n\n        [Fact]\n        public void AllOfAnyOfMatches()\n        {\n            CreateAllOfABAnyOfCD().Matches(_eABC).Should().BeTrue();\n        }\n\n        [Fact]\n        public void AllOfMergesMatchersToNewMatcher()\n        {\n            var m1 = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m2 = Matcher<TestEntity>.AllOf(CID.ComponentB);\n            var m3 = Matcher<TestEntity>.AllOf(CID.ComponentC);\n            var mergedMatcher = Matcher<TestEntity>.AllOf(m1, m2, m3);\n            AssertIndexesEqual(mergedMatcher.Indexes, CID.ComponentA, CID.ComponentB, CID.ComponentC);\n            AssertIndexesEqual(mergedMatcher.AllOfIndexes, CID.ComponentA, CID.ComponentB, CID.ComponentC);\n        }\n\n        [Fact]\n        public void AnyOfMergesMatchersToNewMatcher()\n        {\n            var m1 = Matcher<TestEntity>.AnyOf(CID.ComponentA);\n            var m2 = Matcher<TestEntity>.AnyOf(CID.ComponentB);\n            var m3 = Matcher<TestEntity>.AnyOf(CID.ComponentC);\n            var mergedMatcher = Matcher<TestEntity>.AnyOf(m1, m2, m3);\n            AssertIndexesEqual(mergedMatcher.Indexes, CID.ComponentA, CID.ComponentB, CID.ComponentC);\n            AssertIndexesEqual(mergedMatcher.AnyOfIndexes, CID.ComponentA, CID.ComponentB, CID.ComponentC);\n        }\n\n        [Fact]\n        public void AllOfMergesMatchersToNewMatcherWithoutDuplicates()\n        {\n            var m1 = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m2 = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m3 = Matcher<TestEntity>.AllOf(CID.ComponentB);\n            var mergedMatcher = Matcher<TestEntity>.AllOf(m1, m2, m3);\n            AssertIndexesEqual(mergedMatcher.Indexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(mergedMatcher.AllOfIndexes, CID.ComponentA, CID.ComponentB);\n        }\n\n        [Fact]\n        public void AnyOfMergesMatchersToNewMatcherWithoutDuplicates()\n        {\n            var m1 = Matcher<TestEntity>.AnyOf(CID.ComponentA);\n            var m2 = Matcher<TestEntity>.AnyOf(CID.ComponentB);\n            var m3 = Matcher<TestEntity>.AnyOf(CID.ComponentB);\n            var mergedMatcher = Matcher<TestEntity>.AnyOf(m1, m2, m3);\n            AssertIndexesEqual(mergedMatcher.Indexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(mergedMatcher.AnyOfIndexes, CID.ComponentA, CID.ComponentB);\n        }\n\n        [Fact]\n        public void AllOfThrowsWhenMergingMatcherWithMoreThanOneIndex()\n        {\n            var matcher = Matcher<TestEntity>.AllOf(CID.ComponentA, CID.ComponentB);\n            FluentActions.Invoking(() => Matcher<TestEntity>.AllOf(matcher))\n                .Should().Throw<MatcherException>();\n        }\n\n        [Fact]\n        public void AnyOfThrowsWhenMergingMatcherWithMoreThanOneIndex()\n        {\n            var matcher = Matcher<TestEntity>.AnyOf(CID.ComponentA, CID.ComponentB);\n            FluentActions.Invoking(() => Matcher<TestEntity>.AnyOf(matcher))\n                .Should().Throw<MatcherException>();\n        }\n\n        [Fact]\n        public void AllOfCanToString()\n        {\n            CreateAllOfAB().ToString().Should().Be(\"AllOf(1, 2)\");\n        }\n\n        [Fact]\n        public void AnyOfCanToString()\n        {\n            CreateAnyOfAB().ToString().Should().Be(\"AnyOf(1, 2)\");\n        }\n\n        [Fact]\n        public void AllOfNoneOfCanToString()\n        {\n            CreateAllOfABNoneOfCD().ToString().Should().Be(\"AllOf(1, 2).NoneOf(3, 4)\");\n        }\n\n        [Fact]\n        public void AnyOfNoneOfCanToString()\n        {\n            CreateAnyOfABNoneOfCD().ToString().Should().Be(\"AnyOf(1, 2).NoneOf(3, 4)\");\n        }\n\n        [Fact]\n        public void AllOfAnyOfCanToString()\n        {\n            CreateAllOfABAnyOfCD().ToString().Should().Be(\"AllOf(1, 2).AnyOf(3, 4)\");\n        }\n\n        [Fact]\n        public void ToStringUsesComponentNamesWhenSet()\n        {\n            var matcher = (Matcher<TestEntity>)CreateAllOfAB();\n            matcher.ComponentNames = new[] {\"one\", \"two\", \"three\"};\n            matcher.ToString().Should().Be(\"AllOf(two, three)\");\n        }\n\n        [Fact]\n        public void ToStringUsesComponentNamesWhenMergedMatcher()\n        {\n            var m1 = (Matcher<TestEntity>)Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m2 = (Matcher<TestEntity>)Matcher<TestEntity>.AllOf(CID.ComponentB);\n            var m3 = (Matcher<TestEntity>)Matcher<TestEntity>.AllOf(CID.ComponentC);\n            m2.ComponentNames = new[] {\"m_0\", \"m_1\", \"m_2\", \"m_3\"};\n            var mergedMatcher = Matcher<TestEntity>.AllOf(m1, m2, m3);\n            mergedMatcher.ToString().Should().Be(\"AllOf(m_1, m_2, m_3)\");\n        }\n\n        [Fact]\n        public void AllOfNoneOfToStringUsesComponentNamesWhenComponentNamesSet()\n        {\n            var matcher = (Matcher<TestEntity>)CreateAllOfABNoneOfCD();\n            matcher.ComponentNames = new[] {\"one\", \"two\", \"three\", \"four\", \"five\"};\n            matcher.ToString().Should().Be(\"AllOf(two, three).NoneOf(four, five)\");\n        }\n\n        [Fact]\n        public void NoneOfMutatesAllOfMatcher()\n        {\n            var m1 = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m2 = m1.NoneOf(CID.ComponentB);\n            m1.Should().BeSameAs(m2);\n            AssertIndexesEqual(m1.Indexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(m1.AllOfIndexes, CID.ComponentA);\n            AssertIndexesEqual(m1.NoneOfIndexes, CID.ComponentB);\n        }\n\n        [Fact]\n        public void NoneOfMutatesAllOfMergedMatcher()\n        {\n            var m1 = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m2 = Matcher<TestEntity>.AllOf(CID.ComponentB);\n            var m3 = Matcher<TestEntity>.AllOf(m1);\n            var m4 = m3.NoneOf(m2);\n            m3.Should().BeSameAs(m4);\n            AssertIndexesEqual(m3.Indexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(m3.AllOfIndexes, CID.ComponentA);\n            AssertIndexesEqual(m3.NoneOfIndexes, CID.ComponentB);\n        }\n\n        [Fact]\n        public void NoneOfMutatesAnyOfMatcher()\n        {\n            var m1 = Matcher<TestEntity>.AnyOf(CID.ComponentA);\n            var m2 = m1.NoneOf(CID.ComponentB);\n            m1.Should().BeSameAs(m2);\n            AssertIndexesEqual(m1.Indexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(m1.AnyOfIndexes, CID.ComponentA);\n            AssertIndexesEqual(m1.NoneOfIndexes, CID.ComponentB);\n        }\n\n        [Fact]\n        public void NoneOfMutatesAnyOfMergedMatcher()\n        {\n            var m1 = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m2 = Matcher<TestEntity>.AllOf(CID.ComponentB);\n            var m3 = Matcher<TestEntity>.AnyOf(m1);\n            var m4 = m3.NoneOf(m2);\n            m3.Should().BeSameAs(m4);\n            AssertIndexesEqual(m3.Indexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(m3.AnyOfIndexes, CID.ComponentA);\n            AssertIndexesEqual(m3.NoneOfIndexes, CID.ComponentB);\n        }\n\n        [Fact]\n        public void AnyOfMutatesAllOfMatcher()\n        {\n            var m1 = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m2 = m1.AnyOf(CID.ComponentB);\n            m1.Should().BeSameAs(m2);\n            AssertIndexesEqual(m1.Indexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(m1.AllOfIndexes, CID.ComponentA);\n            AssertIndexesEqual(m1.AnyOfIndexes, CID.ComponentB);\n        }\n\n        [Fact]\n        public void AnyOfMutatesAllOfMergedMatcher()\n        {\n            var m1 = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m2 = Matcher<TestEntity>.AllOf(CID.ComponentB);\n            var m3 = Matcher<TestEntity>.AllOf(m1);\n            var m4 = m3.AnyOf(m2);\n            m3.Should().BeSameAs(m4);\n            AssertIndexesEqual(m3.Indexes, CID.ComponentA, CID.ComponentB);\n            AssertIndexesEqual(m3.AllOfIndexes, CID.ComponentA);\n            AssertIndexesEqual(m3.AnyOfIndexes, CID.ComponentB);\n        }\n\n        [Fact]\n        public void UpdatesCacheWhenCallingAnyOf()\n        {\n            var matcher = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var cache = matcher.Indexes;\n            matcher.AnyOf(CID.ComponentB);\n            matcher.Indexes.Should().NotBeSameAs(cache);\n        }\n\n        [Fact]\n        public void UpdatesCacheWhenCallingNoneOf()\n        {\n            var matcher = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var cache = matcher.Indexes;\n            matcher.NoneOf(CID.ComponentB);\n            matcher.Indexes.Should().NotBeSameAs(cache);\n        }\n\n        [Fact]\n        public void UpdatesHashWhenChangedWithAnyOf()\n        {\n            var matcher = AllOfAB();\n            var hash = matcher.GetHashCode();\n            matcher.AnyOf(42).GetHashCode().Should().NotBe(hash);\n        }\n\n        [Fact]\n        public void UpdatesHashWhenChangedWithNoneOf()\n        {\n            var matcher = AllOfAB();\n            var hash = matcher.GetHashCode();\n            matcher.NoneOf(42).GetHashCode().Should().NotBe(hash);\n        }\n\n        [Fact]\n        public void EqualsEqualAllOfMatcher()\n        {\n            var m1 = AllOfAB();\n            var m2 = AllOfAB();\n            m1.Should().NotBeSameAs(m2);\n            m1.Equals(m2).Should().BeTrue();\n            m1.GetHashCode().Should().Be(m2.GetHashCode());\n        }\n\n        [Fact]\n        public void EqualsEqualAllOfMatcherIndependentOfTheOrderOfIndexes()\n        {\n            var m1 = AllOfAB();\n            var m2 = AllOfBA();\n            m1.Equals(m2).Should().BeTrue();\n            m1.GetHashCode().Should().Be(m2.GetHashCode());\n        }\n\n        [Fact]\n        public void EqualsMergedMatcher()\n        {\n            var m1 = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m2 = Matcher<TestEntity>.AllOf(CID.ComponentB);\n            var m3 = AllOfBA();\n\n            var mergedMatcher = Matcher<TestEntity>.AllOf(m1, m2);\n            mergedMatcher.Equals(m3).Should().BeTrue();\n            mergedMatcher.GetHashCode().Should().Be(m3.GetHashCode());\n        }\n\n        [Fact]\n        public void DoesNotEqualDifferentAllOfMatcher()\n        {\n            var m1 = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m2 = AllOfAB();\n            m1.Equals(m2).Should().BeFalse();\n            m1.GetHashCode().Should().NotBe(m2.GetHashCode());\n        }\n\n        [Fact]\n        public void AllOfDoesNotEqualAnyOfWithSameIndexes()\n        {\n            var m1 = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m2 = Matcher<TestEntity>.AnyOf(CID.ComponentA);\n            m1.Equals(m2).Should().BeFalse();\n            m1.GetHashCode().Should().NotBe(m2.GetHashCode());\n        }\n\n        [Fact]\n        public void DoesNotEqualDifferentTypeMatchersWithSameIndexes()\n        {\n            var m1 = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m2 = Matcher<TestEntity>.AllOf(CID.ComponentB);\n            var m3 = Matcher<TestEntity>.AllOf(m1, m2);\n            var m4 = Matcher<TestEntity>.AnyOf(m1, m2);\n            m3.Equals(m4).Should().BeFalse();\n            m3.GetHashCode().Should().NotBe(m4.GetHashCode());\n        }\n\n        [Fact]\n        public void EqualsCompoundMatcher()\n        {\n            var m1 = Matcher<TestEntity>.AllOf(CID.ComponentA);\n            var m2 = Matcher<TestEntity>.AnyOf(CID.ComponentB);\n            var m3 = Matcher<TestEntity>.AnyOf(CID.ComponentC);\n            var m4 = Matcher<TestEntity>.AnyOf(CID.ComponentD);\n\n            var mX = Matcher<TestEntity>.AllOf(m1, m2).AnyOf(m3, m4);\n            var mY = Matcher<TestEntity>.AllOf(m1, m2).AnyOf(m3, m4);\n\n            mX.Equals(mY).Should().BeTrue();\n            mX.GetHashCode().Should().Be(mY.GetHashCode());\n        }\n\n        static TestEntity CreateEntity()\n        {\n            var entity = new TestEntity();\n            entity.Initialize(0, CID.TotalComponents, new Stack<IComponent>[CID.TotalComponents]);\n            return entity;\n        }\n\n        static IAllOfMatcher<TestEntity> CreateAllOfAB() => Matcher<TestEntity>.AllOf(CID.ComponentA, CID.ComponentB);\n        static IAnyOfMatcher<TestEntity> CreateAnyOfAB() => Matcher<TestEntity>.AnyOf(CID.ComponentA, CID.ComponentB);\n\n        static ICompoundMatcher<TestEntity> CreateAllOfABNoneOfCD() => Matcher<TestEntity>\n            .AllOf(CID.ComponentA, CID.ComponentB)\n            .NoneOf(CID.ComponentC, CID.ComponentD);\n\n        static ICompoundMatcher<TestEntity> CreateAnyOfABNoneOfCD() => Matcher<TestEntity>\n            .AnyOf(CID.ComponentA, CID.ComponentB)\n            .NoneOf(CID.ComponentC, CID.ComponentD);\n\n        static ICompoundMatcher<TestEntity> CreateAllOfABAnyOfCD() => Matcher<TestEntity>\n            .AllOf(CID.ComponentA, CID.ComponentB)\n            .AnyOf(CID.ComponentC, CID.ComponentD);\n\n        static void AssertIndexesEqual(int[] indexes, params int[] expectedIndexes)\n        {\n            indexes.Length.Should().Be(expectedIndexes.Length);\n            for (var i = 0; i < expectedIndexes.Length; i++)\n                indexes[i].Should().Be(expectedIndexes[i]);\n        }\n\n        static IAllOfMatcher<TestEntity> AllOfAB() => Matcher<TestEntity>.AllOf(CID.ComponentA, CID.ComponentB);\n        static IAllOfMatcher<TestEntity> AllOfBA() => Matcher<TestEntity>.AllOf(CID.ComponentB, CID.ComponentA);\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/ParallelSystemTests.cs",
    "content": "﻿using System;\nusing FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Tests\n{\n    [Collection(nameof(ParallelSystemTests))]\n    public class ParallelSystemTests\n    {\n        readonly TestContext _context;\n\n        public ParallelSystemTests()\n        {\n            _context = new TestContext(1);\n        }\n\n        [Fact]\n        public void ProcessesEntity()\n        {\n            var system = new TestParallelSystem(_context);\n            var entity = _context.CreateEntity();\n            entity.AddUser(\"Test\", -1);\n            system.Execute();\n            entity.GetUser().Name.Should().Be(\"Test-Processed\");\n        }\n\n        [Fact]\n        public void ProcessesAllEntities()\n        {\n            var system = new TestParallelSystem(_context);\n            for (var i = 0; i < 4; i++)\n                _context.CreateEntity().AddUser($\"Test{i}\", -1);\n\n            system.Execute();\n\n            var entities = _context.GetEntities();\n            entities.Length.Should().Be(4);\n            for (var i = 0; i < entities.Length; i++)\n                entities[i].GetUser().Name.Should().Be($\"Test{i}-Processed\");\n        }\n\n        [Fact]\n        public void ThrowsWhenThreadThrows()\n        {\n            var system = new TestParallelSystem(_context);\n            system.Exception = new Exception(\"Test Exception\");\n            for (var i = 0; i < 10; i++)\n                _context.CreateEntity().AddUser($\"Test{i}\", -1);\n\n            FluentActions.Invoking(() => system.Execute()).Should().Throw<Exception>();\n        }\n\n        [Fact]\n        public void RecoversFromException()\n        {\n            var system = new TestParallelSystem(_context);\n            system.Exception = new Exception(\"Test Exception\");\n            for (var i = 0; i < 10; i++)\n                _context.CreateEntity().AddUser($\"Test{i}\", -1);\n\n            var didThrow = 0;\n            try\n            {\n                system.Execute();\n            }\n            catch (Exception)\n            {\n                didThrow += 1;\n            }\n\n            didThrow.Should().Be(1);\n            system.Exception = null;\n            system.Execute();\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/PrimaryEntityIndexTests.cs",
    "content": "using FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Tests\n{\n    public class PrimaryEntityIndexTests\n    {\n        readonly IContext<TestEntity> _context;\n        readonly PrimaryEntityIndex<TestEntity, string> _index;\n        readonly IContext<TestEntity> _multiKeyContext;\n        readonly PrimaryEntityIndex<TestEntity, string> _multiKeyIndex;\n\n        public PrimaryEntityIndexTests()\n        {\n            _context = new TestContext(1);\n            _index = CreatePrimaryEntityIndex();\n            _multiKeyContext = new TestContext(1);\n            _multiKeyIndex = CreateMultiKeyPrimaryEntityIndex();\n        }\n\n        [Fact]\n        public void ReturnsNullWhenGettingEntityForUnknownKey()\n        {\n            _index.GetEntity(\"unknownKey\").Should().BeNull();\n        }\n\n        [Fact]\n        public void GetsEntityForKey()\n        {\n            var entity = _context.CreateEntity().AddUser(\"Test\", 42);\n            _index.GetEntity(\"Test\").Should().BeSameAs(entity);\n        }\n\n        [Fact]\n        public void MultiKeyGetsEntityForKey()\n        {\n            var entity = _multiKeyContext.CreateEntity().AddUser(\"Test\", 42);\n            _multiKeyIndex.GetEntity(\"Test1\").Should().BeSameAs(entity);\n            _multiKeyIndex.GetEntity(\"Test2\").Should().BeSameAs(entity);\n        }\n\n        [Fact]\n        public void RetainsEntity()\n        {\n            var entity = _context.CreateEntity().AddUser(\"Test\", 42);\n            entity.RetainCount.Should().Be(3); // Context, Group, EntityIndex\n            (entity.Aerc as SafeAERC)?.Owners.Should().Contain(_index);\n        }\n\n        [Fact]\n        public void MultiKeyRetainsEntity()\n        {\n            var entity = _multiKeyContext.CreateEntity().AddUser(\"Test\", 42);\n            entity.RetainCount.Should().Be(3); // Context, Group, EntityIndex\n            (entity.Aerc as SafeAERC)?.Owners.Should().Contain(_multiKeyIndex);\n        }\n\n        [Fact]\n        public void HasExistingEntity()\n        {\n            var entity = _context.CreateEntity().AddUser(\"Test\", 42);\n            var newIndex = CreatePrimaryEntityIndex();\n            newIndex.GetEntity(\"Test\").Should().BeSameAs(entity);\n        }\n\n        [Fact]\n        public void ReleasesAndRemovesEntityFromIndexWhenComponentGetsRemoved()\n        {\n            var entity = _context.CreateEntity().AddUser(\"Test\", 42);\n            entity.RemoveUser();\n            _index.GetEntity(\"Test\").Should().BeNull();\n            entity.RetainCount.Should().Be(1); // Context\n            (entity.Aerc as SafeAERC)?.Owners.Should().NotContain(_index);\n        }\n\n        [Fact]\n        public void MultiKeyReleasesAndRemovesEntityFromIndexWhenComponentGetsRemoved()\n        {\n            var entity = _multiKeyContext.CreateEntity().AddUser(\"Test\", 42);\n            entity.RemoveUser();\n            _multiKeyIndex.GetEntity(\"Test1\").Should().BeNull();\n            _multiKeyIndex.GetEntity(\"Test2\").Should().BeNull();\n            entity.RetainCount.Should().Be(1);\n            (entity.Aerc as SafeAERC)?.Owners.Should().NotContain(_multiKeyIndex);\n        }\n\n        [Fact]\n        public void ThrowsWhenAddingEntityForSameKey()\n        {\n            _context.CreateEntity().AddUser(\"Test\", 42);\n            FluentActions.Invoking(() => _context.CreateEntity().AddUser(\"Test\", 42))\n                .Should().Throw<EntityIndexException>();\n        }\n\n        [Fact]\n        public void CanToString()\n        {\n            _index.ToString().Should().Be(\"PrimaryEntityIndex(TestIndex)\");\n        }\n\n        [Fact]\n        public void ClearsIndexAndReleasesEntity()\n        {\n            var entity = _context.CreateEntity().AddUser(\"Test\", 42);\n            _index.Deactivate();\n            _index.GetEntity(\"Test\").Should().BeNull();\n            entity.RetainCount.Should().Be(2); // Context, Group\n        }\n\n        [Fact]\n        public void DoesNotAddEntitiesAnymore()\n        {\n            _context.CreateEntity().AddUser(\"Test\", 42);\n            _index.Deactivate();\n            _context.CreateEntity().AddUser(\"Test\", 42);\n            _index.GetEntity(\"Test\").Should().BeNull();\n        }\n\n        [Fact]\n        public void HasExistingEntityWhenActivating()\n        {\n            var entity = _context.CreateEntity().AddUser(\"Test\", 42);\n            ;\n            _index.Deactivate();\n            _index.Activate();\n            _index.GetEntity(\"Test\").Should().BeSameAs(entity);\n        }\n\n        [Fact]\n        public void MultiKeyHasExistingEntityWhenActivating()\n        {\n            var entity = _multiKeyContext.CreateEntity().AddUser(\"Test\", 42);\n            _multiKeyIndex.Deactivate();\n            _multiKeyIndex.Activate();\n            _multiKeyIndex.GetEntity(\"Test1\").Should().BeSameAs(entity);\n            _multiKeyIndex.GetEntity(\"Test2\").Should().BeSameAs(entity);\n        }\n\n        [Fact]\n        public void AddsNewEntitiesWhenActivated()\n        {\n            _context.CreateEntity().AddUser(\"Test1\", 42);\n            _index.Deactivate();\n            _index.Activate();\n            var entity = _context.CreateEntity().AddUser(\"Test2\", 24);\n            _index.GetEntity(\"Test2\").Should().BeSameAs(entity);\n        }\n\n        PrimaryEntityIndex<TestEntity, string> CreatePrimaryEntityIndex()\n        {\n            return new PrimaryEntityIndex<TestEntity, string>(\n                \"TestIndex\",\n                _context.GetGroup(TestUserMatcher.User),\n                (entity, c) => (c as UserComponent ?? entity.GetUser()).Name);\n        }\n\n        PrimaryEntityIndex<TestEntity, string> CreateMultiKeyPrimaryEntityIndex()\n        {\n            return new PrimaryEntityIndex<TestEntity, string>(\n                \"TestIndex\",\n                _multiKeyContext.GetGroup(TestUserMatcher.User),\n                (entity, c) =>\n                {\n                    var name = (c as UserComponent ?? entity.GetUser()).Name;\n                    return new[] { $\"{name}1\", $\"{name}2\" };\n                });\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/ReactiveSystemTests.cs",
    "content": "﻿using FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Tests\n{\n    public class ReactiveSystemTests\n    {\n        readonly TestContext _context;\n\n        public ReactiveSystemTests()\n        {\n            _context = new TestContext(CID.TotalComponents);\n        }\n\n        [Fact]\n        public void DoesNotExecuteWhenNoEntitiesWereCollected()\n        {\n            var system = CreateAddedSystem();\n            system.Execute();\n            AssertEntities(system, null);\n        }\n\n        [Fact]\n        public void ExecutesWhenTriggered()\n        {\n            var system = CreateAddedSystem();\n            var entity = CreateEntityAB();\n            system.Execute();\n            AssertEntities(system, entity);\n        }\n\n        [Fact]\n        public void ExecutesOnlyOnceWhenTriggered()\n        {\n            var system = CreateAddedSystem();\n            var entity = CreateEntityAB();\n            system.Execute();\n            system.Execute();\n            AssertEntities(system, entity);\n        }\n\n        [Fact]\n        public void RetainsAndReleasesCollectedEntities()\n        {\n            var system = CreateAddedSystem();\n            var entity = CreateEntityAB();\n            var retainCount = entity.RetainCount;\n            system.Execute();\n            retainCount.Should().Be(3); // retained by context, group and collector\n            entity.RetainCount.Should().Be(2); // retained by context and group\n        }\n\n        [Fact]\n        public void CollectsChangedEntitiesInExecute()\n        {\n            var system = CreateAddedSystem();\n            var entity = CreateEntityAB();\n            system.ExecuteAction = entities => { entities[0].ReplaceComponentA(Component.A); };\n            system.Execute();\n            system.Execute();\n            AssertEntities(system, entity, 2);\n        }\n\n        [Fact]\n        public void CollectsCreatedEntitiesInExecute()\n        {\n            var system = CreateAddedSystem();\n            var entity1 = CreateEntityAB();\n            TestEntity entity2 = null;\n            system.ExecuteAction = delegate { entity2 ??= CreateEntityAB(); };\n            system.Execute();\n            AssertEntities(system, entity1);\n            system.Execute();\n            AssertEntities(system, entity2, 2);\n        }\n\n        [Fact]\n        public void DoesNotExecuteWhenNotTriggered()\n        {\n            var system = CreateAddedSystem();\n            _context.CreateEntity().AddComponentA();\n            system.Execute();\n            AssertEntities(system, null);\n        }\n\n        [Fact]\n        public void DeactivatesAndWillNotTrigger()\n        {\n            var system = CreateAddedSystem();\n            system.Deactivate();\n            CreateEntityAB();\n            system.Execute();\n            AssertEntities(system, null);\n        }\n\n        [Fact]\n        public void ActivatesAndWillTriggerAgain()\n        {\n            var system = CreateAddedSystem();\n            system.Deactivate();\n            system.Activate();\n            var entity = CreateEntityAB();\n            system.Execute();\n            AssertEntities(system, entity);\n        }\n\n        [Fact]\n        public void ClearsCollectedEntities()\n        {\n            var system = CreateAddedSystem();\n            CreateEntityAB();\n            system.Clear();\n            system.Execute();\n            AssertEntities(system, null);\n        }\n\n        [Fact]\n        public void CanToString()\n        {\n            CreateAddedSystem().ToString().Should().Be(\"ReactiveSystem(ReactiveSystemSpy)\");\n        }\n\n        [Fact]\n        public void RemovedExecutesWhenTriggered()\n        {\n            var system = CreateRemovedSystem();\n            var entity = CreateEntityAB()\n                .RemoveComponentA();\n\n            system.Execute();\n            AssertEntities(system, entity);\n        }\n\n        [Fact]\n        public void RemovedExecutesOnlyOnceWhenTriggered()\n        {\n            var system = CreateRemovedSystem();\n            var entity = CreateEntityAB()\n                .RemoveComponentA();\n\n            system.Execute();\n            system.Execute();\n            AssertEntities(system, entity);\n        }\n\n        [Fact]\n        public void RemovedDoesNotExecuteWhenNotTriggered()\n        {\n            var system = CreateRemovedSystem();\n            CreateEntityAB()\n                .AddComponentC()\n                .RemoveComponentC();\n\n            system.Execute();\n            AssertEntities(system, null);\n        }\n\n        [Fact]\n        public void RetainsEntitiesUntilExecuteCompleted()\n        {\n            var system = CreateRemovedSystem();\n            var entity = CreateEntityAB();\n            var didExecute = 0;\n            system.ExecuteAction = entities =>\n            {\n                didExecute += 1;\n                entities[0].RetainCount.Should().Be(1);\n            };\n\n            entity.Destroy();\n            system.Execute();\n            didExecute.Should().Be(1);\n            entity.RetainCount.Should().Be(0);\n        }\n\n        [Fact]\n        public void AddedRemovedExecutesWhenAdded()\n        {\n            var system = CreateAddedRemovedSystem();\n            var entity = CreateEntityAB();\n            system.Execute();\n            AssertEntities(system, entity);\n        }\n\n        [Fact]\n        public void AddedRemovedExecutesWhenRemoved()\n        {\n            var system = CreateAddedRemovedSystem();\n            var entity = CreateEntityAB();\n            system.Execute();\n            entity.RemoveComponentA();\n            system.Execute();\n            AssertEntities(system, entity, 2);\n        }\n\n        [Fact]\n        public void ExecutesWhenTriggeredOnMultipleContexts()\n        {\n            var context1 = new TestContext(CID.TotalComponents);\n            var context2 = new TestContext(CID.TotalComponents);\n\n            var groupA = context1.GetGroup(Matcher<TestEntity>.AllOf(CID.ComponentA));\n            var groupB = context2.GetGroup(Matcher<TestEntity>.AllOf(CID.ComponentB));\n\n            var groups = new[] { groupA, groupB };\n            var groupEvents = new[]\n            {\n                GroupEvent.Added,\n                GroupEvent.Removed\n            };\n            var collector = new Collector<TestEntity>(groups, groupEvents);\n\n            var system = new ReactiveSystemSpy(collector);\n\n            var eA1 = context1.CreateEntity().AddComponentA();\n            context2.CreateEntity().AddComponentA();\n\n            var eB1 = context1.CreateEntity().AddComponentB();\n            var eB2 = context2.CreateEntity().AddComponentB();\n\n            system.Execute();\n            AssertEntities(system, eA1);\n\n            eB1.RemoveComponentB();\n            eB2.RemoveComponentB();\n            system.Execute();\n            AssertEntities(system, eB2, 2);\n        }\n\n        [Fact]\n        public void FiltersEntities()\n        {\n            var system = new ReactiveSystemSpy(\n                _context.CreateCollector(Matcher<TestEntity>.AllOf(CID.ComponentA, CID.ComponentB)),\n                e => ((UserComponent)e.GetComponent(CID.ComponentA)).Age > 42\n            );\n\n            _context.CreateEntity()\n                .AddComponentA()\n                .AddComponentC();\n\n            var entity1 = _context.CreateEntity();\n            entity1.AddComponentB();\n            entity1.AddComponent(CID.ComponentA, new UserComponent { Age = 10 });\n\n            var entity2 = _context.CreateEntity();\n            entity2.AddComponentB();\n            entity2.AddComponent(CID.ComponentA, new UserComponent { Age = 50 });\n\n            var didExecute = 0;\n            system.ExecuteAction = delegate\n            {\n                didExecute += 1;\n                entity2.RetainCount.Should().Be(3); // retained by context, group and collector\n            };\n\n            system.Execute();\n            didExecute.Should().Be(1);\n\n            system.Execute();\n\n            system.Entities.Length.Should().Be(1);\n            system.Entities[0].Should().BeSameAs(entity2);\n\n            entity1.RetainCount.Should().Be(2); // retained by context and group\n            entity2.RetainCount.Should().Be(2);\n        }\n\n        [Fact]\n        public void ClearsReactiveSystemAfterExecute()\n        {\n            var system = new ReactiveSystemSpy(_context.CreateCollector(Matcher<TestEntity>.AllOf(CID.ComponentA, CID.ComponentB)));\n            system.ExecuteAction = entities => { entities[0].ReplaceComponentA(Component.A); };\n            var entity = CreateEntityAB();\n            system.Execute();\n            system.Clear();\n            system.Execute();\n            AssertEntities(system, entity);\n        }\n\n        ReactiveSystemSpy CreateAddedSystem() => new ReactiveSystemSpy(_context.CreateCollector(Matcher<TestEntity>.AllOf(CID.ComponentA, CID.ComponentB)));\n        ReactiveSystemSpy CreateRemovedSystem() => new ReactiveSystemSpy(_context.CreateCollector(Matcher<TestEntity>.AllOf(CID.ComponentA, CID.ComponentB).Removed()));\n        ReactiveSystemSpy CreateAddedRemovedSystem() => new ReactiveSystemSpy(_context.CreateCollector(Matcher<TestEntity>.AllOf(CID.ComponentA, CID.ComponentB).AddedOrRemoved()));\n\n        TestEntity CreateEntityAB() => _context.CreateEntity()\n            .AddComponentA()\n            .AddComponentB();\n\n        TestEntity CreateEntityAC() => _context.CreateEntity()\n            .AddComponentA()\n            .AddComponentC();\n\n        TestEntity CreateEntityABC() => _context.CreateEntity()\n            .AddComponentA()\n            .AddComponentB()\n            .AddComponentC();\n\n        static void AssertEntities(IReactiveSystemSpy system, TestEntity entity, int didExecute = 1)\n        {\n            if (entity == null)\n            {\n                system.DidExecute.Should().Be(0);\n                system.Entities.Should().BeNull();\n            }\n            else\n            {\n                system.DidExecute.Should().Be(didExecute);\n                system.Entities.Length.Should().Be(1);\n                system.Entities.Should().Contain(entity);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/SystemsTests.cs",
    "content": "using FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Tests\n{\n    public class SystemsTests\n    {\n        readonly TestContext _context;\n        readonly Systems _systems;\n\n        public SystemsTests()\n        {\n            _context = new TestContext(CID.TotalComponents);\n            _systems = new Systems();\n        }\n\n        [Fact]\n        public void InitializesInitializeSystemSpy()\n        {\n            var system = new InitializeSystemSpy();\n            system.DidInitialize.Should().Be(0);\n            system.Initialize();\n            system.DidInitialize.Should().Be(1);\n        }\n\n        [Fact]\n        public void ExecutesExecuteSystemSpy()\n        {\n            var system = new ExecuteSystemSpy();\n            system.DidExecute.Should().Be(0);\n            system.Execute();\n            system.DidExecute.Should().Be(1);\n        }\n\n        [Fact]\n        public void CleansUpCleanupSystemSpy()\n        {\n            var system = new CleanupSystemSpy();\n            system.DidCleanup.Should().Be(0);\n            system.Cleanup();\n            system.DidCleanup.Should().Be(1);\n        }\n\n        [Fact]\n        public void TearsDownTearDownSystemSpy()\n        {\n            var system = new TearDownSystemSpy();\n            system.DidTearDown.Should().Be(0);\n            system.TearDown();\n            system.DidTearDown.Should().Be(1);\n        }\n\n        [Fact]\n        public void InitializesExecutesCleansUpAndTearsDownSystem()\n        {\n            var system = CreateReactiveSystem();\n\n            system.DidInitialize.Should().Be(0);\n            system.Initialize();\n            system.DidInitialize.Should().Be(1);\n\n            system.DidExecute.Should().Be(0);\n            system.Execute();\n            system.DidExecute.Should().Be(1);\n            system.Entities.Length.Should().Be(1);\n\n            system.DidCleanup.Should().Be(0);\n            system.Cleanup();\n            system.DidCleanup.Should().Be(1);\n\n            system.DidTearDown.Should().Be(0);\n            system.TearDown();\n            system.DidTearDown.Should().Be(1);\n        }\n\n        [Fact]\n        public void IgnoresAddingNull()\n        {\n            _systems.Add(null);\n        }\n\n        [Fact]\n        public void ReturnsSystemsWhenAddingSystem()\n        {\n            _systems.Add(new InitializeSystemSpy()).Should().BeSameAs(_systems);\n        }\n\n        [Fact]\n        public void InitializesIInitializeSystem()\n        {\n            var system = new InitializeSystemSpy();\n            _systems.Add(system);\n            _systems.Initialize();\n            system.DidInitialize.Should().Be(1);\n        }\n\n        [Fact]\n        public void RemovesIInitializeSystem()\n        {\n            var system = new InitializeSystemSpy();\n            _systems.Add(system);\n            _systems.Remove(system);\n            _systems.Initialize();\n            system.DidInitialize.Should().Be(0);\n        }\n\n        [Fact]\n        public void ExecutesIExecuteSystem()\n        {\n            var system = new ExecuteSystemSpy();\n            _systems.Add(system);\n            _systems.Execute();\n            system.DidExecute.Should().Be(1);\n        }\n\n        [Fact]\n        public void RemovesIExecuteSystem()\n        {\n            var system = new ExecuteSystemSpy();\n            _systems.Add(system);\n            _systems.Remove(system);\n            _systems.Execute();\n            system.DidExecute.Should().Be(0);\n        }\n\n        [Fact]\n        public void AddsReactiveSystem()\n        {\n            var system = CreateReactiveSystem();\n            _systems.Add(system);\n            _systems.Execute();\n            system.DidExecute.Should().Be(1);\n        }\n\n        [Fact]\n        public void RemovesReactiveSystem()\n        {\n            var system = CreateReactiveSystem();\n            _systems.Add(system);\n            _systems.Remove(system);\n            _systems.Execute();\n            system.DidExecute.Should().Be(0);\n        }\n\n        [Fact]\n        public void CleansUpICleanupSystem()\n        {\n            var system = new CleanupSystemSpy();\n            _systems.Add(system);\n            _systems.Cleanup();\n            system.DidCleanup.Should().Be(1);\n        }\n\n        [Fact]\n        public void RemovesICleanupSystem()\n        {\n            var system = new CleanupSystemSpy();\n            _systems.Add(system);\n            _systems.Remove(system);\n            _systems.Cleanup();\n            system.DidCleanup.Should().Be(0);\n        }\n\n        [Fact]\n        public void TearsDownITearDownSystem()\n        {\n            var system = new TearDownSystemSpy();\n            _systems.Add(system);\n            _systems.TearDown();\n            system.DidTearDown.Should().Be(1);\n        }\n\n        [Fact]\n        public void RemovesITearDownSystem()\n        {\n            var system = new TearDownSystemSpy();\n            _systems.Add(system);\n            _systems.Remove(system);\n            _systems.TearDown();\n            system.DidTearDown.Should().Be(0);\n        }\n\n        [Fact]\n        public void RemovesMixedSystem()\n        {\n            var system = CreateReactiveSystem();\n            _systems.Add(system);\n            _systems.Remove(system);\n\n            _systems.Initialize();\n            system.DidInitialize.Should().Be(0);\n\n            _systems.Execute();\n            system.DidExecute.Should().Be(0);\n\n            _systems.Cleanup();\n            system.DidCleanup.Should().Be(0);\n\n            _systems.TearDown();\n            system.DidTearDown.Should().Be(0);\n        }\n\n        [Fact]\n        public void InitializesExecutesCleansUpAndTearsDownSystems()\n        {\n            var system = CreateReactiveSystem();\n            _systems.Add(system);\n\n            system.DidInitialize.Should().Be(0);\n            _systems.Initialize();\n            system.DidInitialize.Should().Be(1);\n\n            system.DidExecute.Should().Be(0);\n            _systems.Execute();\n            system.DidExecute.Should().Be(1);\n\n            system.DidCleanup.Should().Be(0);\n            _systems.Cleanup();\n            system.DidCleanup.Should().Be(1);\n\n            system.DidTearDown.Should().Be(0);\n            _systems.TearDown();\n            system.DidTearDown.Should().Be(1);\n        }\n\n        [Fact]\n        public void InitializesExecutesCleansUpAndTearsDownSystemsRecursively()\n        {\n            var system = CreateReactiveSystem();\n            _systems.Add(system);\n\n            var parentSystems = new Systems();\n            parentSystems.Add(_systems);\n\n            system.DidInitialize.Should().Be(0);\n            parentSystems.Initialize();\n            system.DidInitialize.Should().Be(1);\n\n            system.DidExecute.Should().Be(0);\n            parentSystems.Execute();\n            parentSystems.Execute();\n            system.DidExecute.Should().Be(1);\n\n            system.DidCleanup.Should().Be(0);\n            parentSystems.Cleanup();\n            system.DidCleanup.Should().Be(1);\n\n            system.DidTearDown.Should().Be(0);\n            parentSystems.TearDown();\n            system.DidTearDown.Should().Be(1);\n        }\n\n        [Fact]\n        public void ClearsReactiveSystems()\n        {\n            var system = CreateReactiveSystem();\n            _systems.Add(system);\n\n            _systems.Initialize();\n            system.DidInitialize.Should().Be(1);\n\n            _systems.ClearReactiveSystems();\n            _systems.Execute();\n            system.DidExecute.Should().Be(0);\n        }\n\n        [Fact]\n        public void ClearsReactiveSystemsRecursively()\n        {\n            var system = CreateReactiveSystem();\n            _systems.Add(system);\n\n            var parentSystems = new Systems();\n            parentSystems.Add(_systems);\n\n            parentSystems.Initialize();\n            system.DidInitialize.Should().Be(1);\n\n            parentSystems.ClearReactiveSystems();\n            parentSystems.Execute();\n            system.DidExecute.Should().Be(0);\n        }\n\n        [Fact]\n        public void DeactivatesReactiveSystems()\n        {\n            var system = CreateReactiveSystem();\n            _systems.Add(system);\n\n            _systems.Initialize();\n            system.DidInitialize.Should().Be(1);\n\n            _systems.DeactivateReactiveSystems();\n            _systems.Execute();\n            system.DidExecute.Should().Be(0);\n        }\n\n        [Fact]\n        public void DeactivatesReactiveSystemsRecursively()\n        {\n            var system = CreateReactiveSystem();\n            _systems.Add(system);\n\n            var parentSystems = new Systems();\n            parentSystems.Add(_systems);\n\n            parentSystems.Initialize();\n            system.DidInitialize.Should().Be(1);\n\n            parentSystems.DeactivateReactiveSystems();\n            parentSystems.Execute();\n            system.DidExecute.Should().Be(0);\n        }\n\n        [Fact]\n        public void ActivatesReactiveSystems()\n        {\n            var system = CreateReactiveSystem();\n            _systems.Add(system);\n\n            _systems.Initialize();\n            system.DidInitialize.Should().Be(1);\n\n            _systems.DeactivateReactiveSystems();\n            _systems.ActivateReactiveSystems();\n            _systems.Execute();\n            system.DidExecute.Should().Be(0);\n\n            _context.CreateEntity().AddComponentA();\n            _systems.Execute();\n            system.DidExecute.Should().Be(1);\n        }\n\n        [Fact]\n        public void ActivatesReactiveSystemsRecursively()\n        {\n            var system = CreateReactiveSystem();\n            _systems.Add(system);\n\n            var parentSystems = new Systems();\n            parentSystems.Add(_systems);\n\n            parentSystems.Initialize();\n            system.DidInitialize.Should().Be(1);\n\n            parentSystems.DeactivateReactiveSystems();\n            parentSystems.ActivateReactiveSystems();\n            parentSystems.Execute();\n            system.DidExecute.Should().Be(0);\n\n            _context.CreateEntity().AddComponentA();\n            _systems.Execute();\n            system.DidExecute.Should().Be(1);\n        }\n\n        ReactiveSystemSpy CreateReactiveSystem()\n        {\n            var system = new ReactiveSystemSpy(_context.CreateCollector(Matcher<TestEntity>.AllOf(CID.ComponentA)));\n            _context.CreateEntity().AddComponentA();\n            return system;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/fixtures/Components.cs",
    "content": "﻿using Entitas;\n\npublic sealed class ComponentA : IComponent { }\n\npublic sealed class ComponentB : IComponent { }\n\npublic sealed class ComponentC : IComponent { }\n\npublic static class Component\n{\n    public static readonly ComponentA A = new ComponentA();\n    public static readonly ComponentB B = new ComponentB();\n    public static readonly ComponentC C = new ComponentC();\n}\n\npublic static class CID\n{\n    public const int ComponentA = 1;\n    public const int ComponentB = 2;\n    public const int ComponentC = 3;\n    public const int ComponentD = 4;\n\n    public const int TotalComponents = 5;\n}\n\npublic static class TestComponentsEntityExtension\n{\n    public static TestEntity AddComponentA(this Entity entity)\n    {\n        entity.AddComponent(CID.ComponentA, Component.A);\n        return (TestEntity)entity;\n    }\n\n    public static TestEntity AddComponentB(this Entity entity)\n    {\n        entity.AddComponent(CID.ComponentB, Component.B);\n        return (TestEntity)entity;\n    }\n\n    public static TestEntity AddComponentC(this Entity entity)\n    {\n        entity.AddComponent(CID.ComponentC, Component.C);\n        return (TestEntity)entity;\n    }\n\n    public static bool HasComponentA(this Entity entity)\n    {\n        return entity.HasComponent(CID.ComponentA);\n    }\n\n    public static bool HasComponentB(this Entity entity)\n    {\n        return entity.HasComponent(CID.ComponentB);\n    }\n\n    public static bool HasComponentC(this Entity entity)\n    {\n        return entity.HasComponent(CID.ComponentC);\n    }\n\n    public static TestEntity RemoveComponentA(this Entity entity)\n    {\n        entity.RemoveComponent(CID.ComponentA);\n        return (TestEntity)entity;\n    }\n\n    public static TestEntity RemoveComponentB(this Entity entity)\n    {\n        entity.RemoveComponent(CID.ComponentB);\n        return (TestEntity)entity;\n    }\n\n    public static TestEntity RemoveComponentC(this Entity entity)\n    {\n        entity.RemoveComponent(CID.ComponentC);\n        return (TestEntity)entity;\n    }\n\n    public static ComponentA GetComponentA(this Entity entity)\n    {\n        return (ComponentA)entity.GetComponent(CID.ComponentA);\n    }\n\n    public static ComponentB GetComponentB(this Entity entity)\n    {\n        return (ComponentB)entity.GetComponent(CID.ComponentB);\n    }\n\n    public static ComponentC GetComponentC(this Entity entity)\n    {\n        return (ComponentC)entity.GetComponent(CID.ComponentC);\n    }\n\n    public static TestEntity ReplaceComponentA(this Entity entity, ComponentA component)\n    {\n        entity.ReplaceComponent(CID.ComponentA, component);\n        return (TestEntity)entity;\n    }\n\n    public static TestEntity ReplaceComponentB(this Entity entity, ComponentB component)\n    {\n        entity.ReplaceComponent(CID.ComponentB, component);\n        return (TestEntity)entity;\n    }\n\n    public static TestEntity ReplaceComponentC(this Entity entity, ComponentC component)\n    {\n        entity.ReplaceComponent(CID.ComponentC, component);\n        return (TestEntity)entity;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/fixtures/Contexts.cs",
    "content": "using System;\nusing Entitas;\n\npublic static class TestEntityExtension\n{\n    public static TestEntity AddUser(this TestEntity entity, string name, int age)\n    {\n        entity.AddComponent(0, new UserComponent { Name = name, Age = age });\n        return entity;\n    }\n\n    public static TestEntity RemoveUser(this TestEntity entity)\n    {\n        entity.RemoveComponent(0);\n        return entity;\n    }\n\n    public static UserComponent GetUser(this TestEntity entity)\n    {\n        return (UserComponent)entity.GetComponent(0);\n    }\n}\n\npublic static class OtherTestEntityExtension\n{\n    public static void AddUser(this OtherTestEntity entity, string name, int age)\n    {\n        entity.AddComponent(0, new UserComponent { Name = name, Age = age });\n    }\n\n    public static void RemoveUser(this OtherTestEntity entity)\n    {\n        entity.RemoveComponent(0);\n    }\n\n    public static UserComponent GetUser(this OtherTestEntity entity)\n    {\n        return (UserComponent)entity.GetComponent(0);\n    }\n}\n\npublic sealed class TestEntity : Entity { }\n\npublic sealed class TestContext : Context<TestEntity>\n{\n    static readonly Func<TestEntity> CreateEntityDelegate = () => new TestEntity();\n\n    public TestContext(int totalComponents) :\n        base(totalComponents, CreateEntityDelegate) { }\n\n    public TestContext(int totalComponents, string[] componentNames, Type[] componentTypes) :\n        this(totalComponents, 0, new ContextInfo(\"TestContext\", componentNames, componentTypes)) { }\n\n    public TestContext(int totalComponents, int startCreationIndex, ContextInfo contextInfo) :\n        base(\n            totalComponents,\n            startCreationIndex,\n            contextInfo,\n            SafeAERC.Delegate,\n            CreateEntityDelegate\n        ) { }\n}\n\npublic sealed class OtherTestEntity : Entity { }\n\npublic sealed class OtherTestContext : Context<OtherTestEntity>\n{\n    public OtherTestContext() :\n        base(\n            1,\n            0,\n            new ContextInfo(\n                \"OtherTestContext\",\n                new[] { \"User\" },\n                new[] { typeof(UserComponent) }\n            ),\n            SafeAERC.Delegate,\n            () => new OtherTestEntity()\n        ) { }\n}\n\npublic static class TestUserMatcher\n{\n    static IMatcher<TestEntity> _matcher;\n\n    public static IMatcher<TestEntity> User\n    {\n        get\n        {\n            if (_matcher == null)\n            {\n                var matcher = (Matcher<TestEntity>)Matcher<TestEntity>.AllOf(0);\n                matcher.ComponentNames = new[] { \"User\" };\n                _matcher = matcher;\n            }\n\n            return _matcher;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/fixtures/Systems/CleanupSystemSpy.cs",
    "content": "﻿using Entitas;\n\npublic class CleanupSystemSpy : ICleanupSystem\n{\n    public int DidCleanup => _didCleanup;\n\n    int _didCleanup;\n\n    public void Cleanup() => _didCleanup += 1;\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/fixtures/Systems/ExecuteSystemSpy.cs",
    "content": "﻿using Entitas;\n\npublic class ExecuteSystemSpy : IExecuteSystem\n{\n    public int DidExecute => _didExecute;\n\n    int _didExecute;\n\n    public void Execute() => _didExecute += 1;\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/fixtures/Systems/InitializeSystemSpy.cs",
    "content": "﻿using Entitas;\n\npublic class InitializeSystemSpy : IInitializeSystem\n{\n    public int DidInitialize => _didInitialize;\n\n    int _didInitialize;\n\n    public void Initialize() => _didInitialize += 1;\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/fixtures/Systems/ReactiveSystemSpy.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing Entitas;\n\npublic interface IReactiveSystemSpy\n{\n    int DidInitialize { get; }\n    int DidExecute { get; }\n    int DidCleanup { get; }\n    int DidTearDown { get; }\n    TestEntity[] Entities { get; }\n}\n\npublic class ReactiveSystemSpy : ReactiveSystem<TestEntity>, IReactiveSystemSpy, IInitializeSystem, ICleanupSystem, ITearDownSystem\n{\n    public int DidInitialize => _didInitialize;\n    public int DidExecute => _didExecute;\n    public int DidCleanup => _didCleanup;\n    public int DidTearDown => _didTearDown;\n    public TestEntity[] Entities => _entities;\n\n    public Action<List<TestEntity>> ExecuteAction;\n\n    protected int _didInitialize;\n    protected int _didExecute;\n    protected int _didCleanup;\n    protected int _didTearDown;\n    protected TestEntity[] _entities;\n\n    readonly Func<TestEntity, bool> _filter;\n\n    public ReactiveSystemSpy(ICollector<TestEntity> collector) : base(collector) { }\n\n    public ReactiveSystemSpy(ICollector<TestEntity> collector, Func<Entity, bool> filter) : this(collector)\n    {\n        _filter = filter;\n    }\n\n    protected override ICollector<TestEntity> GetTrigger(IContext<TestEntity> context) => null;\n\n    protected override bool Filter(TestEntity entity) => _filter?.Invoke(entity) != false;\n\n    public void Initialize() => _didInitialize += 1;\n\n    protected override void Execute(List<TestEntity> entities)\n    {\n        _didExecute += 1;\n        _entities = entities?.ToArray();\n        ExecuteAction?.Invoke(entities);\n    }\n\n    public void Cleanup() => _didCleanup += 1;\n\n    public void TearDown() => _didTearDown += 1;\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/fixtures/Systems/TearDownSystemSpy.cs",
    "content": "﻿using Entitas;\n\npublic class TearDownSystemSpy : ITearDownSystem\n{\n    public int DidTearDown => _didTearDown;\n\n    int _didTearDown;\n\n    public void TearDown() => _didTearDown += 1;\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/fixtures/Systems/TestParallelSystem.cs",
    "content": "﻿using System;\nusing System.Threading;\nusing Entitas;\n\npublic sealed class TestParallelSystem : ParallelSystem<TestEntity>\n{\n    public Exception Exception;\n\n    public TestParallelSystem(TestContext context) : base(context.GetGroup(TestUserMatcher.User)) { }\n\n    protected override void Execute(TestEntity entity)\n    {\n        if (Exception != null)\n        {\n            throw Exception;\n        }\n\n        var user = entity.GetUser();\n        user.Name += \"-Processed\";\n        user.Age = Thread.CurrentThread.ManagedThreadId;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Tests/fixtures/UserComponent.cs",
    "content": "using Entitas;\n\npublic sealed class UserComponent : IComponent\n{\n    public string Name;\n    public int Age;\n\n    public override string ToString()\n    {\n        return $\"User({Name}, {Age})\";\n    }\n}\n\nnamespace My.Namespace\n{\n    public sealed class UserComponent : IComponent\n    {\n        public string Name;\n        public int Age;\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Unity.Tests/Entitas.Unity.Tests.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>$(DefaultTestTargetFramework)</TargetFramework>\n    <IsPackable>false</IsPackable>\n    <IsPublishable>false</IsPublishable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"FluentAssertions\" Version=\"6.11.0\" />\n    <PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.6.2\" />\n    <PackageReference Include=\"xunit\" Version=\"2.4.2\" />\n    <PackageReference Include=\"xunit.runner.visualstudio\" Version=\"2.4.5\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"coverlet.collector\" Version=\"6.0.0\">\n      <PrivateAssets>all</PrivateAssets>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"../../src/Entitas.Unity/Entitas.Unity.csproj\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "tests/Entitas.Unity.Tests/SystemInfoTests.cs",
    "content": "using FluentAssertions;\nusing Xunit;\n\nnamespace Entitas.Unity.Tests\n{\n    public class SystemInfoTests\n    {\n        readonly SystemInfo _systemInfo;\n\n        public SystemInfoTests()\n        {\n            _systemInfo = new SystemInfo(new TestExecuteSystem());\n        }\n\n        [Fact]\n        public void CreatesSystemInfoForInitializeSystem()\n        {\n            var system = new TestInitializeSystem();\n            var info = new SystemInfo(system);\n\n            info.System.Should().BeSameAs(system);\n\n            info.SystemName.Should().Be(\"TestInitialize\");\n            info.IsInitializeSystems.Should().BeTrue();\n            info.IsExecuteSystems.Should().BeFalse();\n            info.IsCleanupSystems.Should().BeFalse();\n            info.IsTearDownSystems.Should().BeFalse();\n            info.IsReactiveSystems.Should().BeFalse();\n\n            info.AccumulatedExecutionDuration.Should().Be(0);\n            info.MinExecutionDuration.Should().Be(0);\n            info.MaxExecutionDuration.Should().Be(0);\n            info.AverageExecutionDuration.Should().Be(0);\n\n            info.IsActive.Should().BeTrue();\n        }\n\n        [Fact]\n        public void CreatesSystemInfoForExecuteSystem()\n        {\n            var system = new TestExecuteSystem();\n            var info = new SystemInfo(system);\n\n            info.SystemName.Should().Be(\"TestExecute\");\n            info.IsInitializeSystems.Should().BeFalse();\n            info.IsExecuteSystems.Should().BeTrue();\n            info.IsCleanupSystems.Should().BeFalse();\n            info.IsTearDownSystems.Should().BeFalse();\n            info.IsReactiveSystems.Should().BeFalse();\n        }\n\n        [Fact]\n        public void CreatesSystemInfoForCleanupSystem()\n        {\n            var system = new TestCleanupSystem();\n            var info = new SystemInfo(system);\n\n            info.SystemName.Should().Be(\"TestCleanup\");\n            info.IsInitializeSystems.Should().BeFalse();\n            info.IsExecuteSystems.Should().BeFalse();\n            info.IsCleanupSystems.Should().BeTrue();\n            info.IsTearDownSystems.Should().BeFalse();\n            info.IsReactiveSystems.Should().BeFalse();\n        }\n\n        [Fact]\n        public void CreatesSystemInfoForTeardownSystem()\n        {\n            var system = new TestTearDownSystem();\n            var info = new SystemInfo(system);\n\n            info.SystemName.Should().Be(\"TestTearDown\");\n            info.IsInitializeSystems.Should().BeFalse();\n            info.IsExecuteSystems.Should().BeFalse();\n            info.IsCleanupSystems.Should().BeFalse();\n            info.IsTearDownSystems.Should().BeTrue();\n            info.IsReactiveSystems.Should().BeFalse();\n        }\n\n        [Fact]\n        public void CreatesSystemInfoForReactiveSystem()\n        {\n            var system = new TestReactiveSystem(new Context<Entity>(1, () => new Entity()));\n            var info = new SystemInfo(system);\n\n            info.SystemName.Should().Be(\"TestReactive\");\n            info.IsInitializeSystems.Should().BeFalse();\n            info.IsExecuteSystems.Should().BeFalse();\n            info.IsCleanupSystems.Should().BeFalse();\n            info.IsTearDownSystems.Should().BeFalse();\n            info.IsReactiveSystems.Should().BeTrue();\n        }\n\n        [Fact(Skip = \"Needs Unity\")]\n        public void UsesNameOfDebugSystem()\n        {\n            const string systemName = \"My System\";\n            var system = new DebugSystems(systemName);\n            var info = new SystemInfo(system);\n            info.SystemName.Should().Be(systemName);\n        }\n\n        [Fact]\n        public void AddsExecutionDuration()\n        {\n            _systemInfo.AddExecutionDuration(42);\n            _systemInfo.AccumulatedExecutionDuration.Should().Be(42);\n            _systemInfo.MinExecutionDuration.Should().Be(42);\n            _systemInfo.MaxExecutionDuration.Should().Be(42);\n            _systemInfo.AverageExecutionDuration.Should().Be(42);\n        }\n\n        [Fact]\n        public void AddsCleanupDuration()\n        {\n            _systemInfo.AddCleanupDuration(42);\n            _systemInfo.AccumulatedCleanupDuration.Should().Be(42);\n            _systemInfo.MinCleanupDuration.Should().Be(42);\n            _systemInfo.MaxCleanupDuration.Should().Be(42);\n            _systemInfo.AverageCleanupDuration.Should().Be(42);\n        }\n\n        [Fact]\n        public void AddsAnotherExecutionDuration()\n        {\n            _systemInfo.AddExecutionDuration(20);\n            _systemInfo.AddExecutionDuration(10);\n            _systemInfo.AccumulatedExecutionDuration.Should().Be(30);\n            _systemInfo.MinExecutionDuration.Should().Be(10);\n            _systemInfo.MaxExecutionDuration.Should().Be(20);\n            _systemInfo.AverageExecutionDuration.Should().Be(15);\n        }\n\n        [Fact]\n        public void AddsAnotherCleanupDuration()\n        {\n            _systemInfo.AddCleanupDuration(20);\n            _systemInfo.AddCleanupDuration(10);\n            _systemInfo.AccumulatedCleanupDuration.Should().Be(30);\n            _systemInfo.MinCleanupDuration.Should().Be(10);\n            _systemInfo.MaxCleanupDuration.Should().Be(20);\n            _systemInfo.AverageCleanupDuration.Should().Be(15);\n        }\n\n        [Fact]\n        public void ResetsDurations()\n        {\n            _systemInfo.AddExecutionDuration(20);\n            _systemInfo.AddExecutionDuration(10);\n            _systemInfo.AddCleanupDuration(200);\n            _systemInfo.AddCleanupDuration(100);\n            _systemInfo.ResetDurations();\n\n            _systemInfo.AccumulatedExecutionDuration.Should().Be(0);\n            _systemInfo.MinExecutionDuration.Should().Be(10);\n            _systemInfo.MaxExecutionDuration.Should().Be(20);\n            _systemInfo.AverageExecutionDuration.Should().Be(0);\n\n            _systemInfo.AccumulatedCleanupDuration.Should().Be(0);\n            _systemInfo.MinCleanupDuration.Should().Be(100);\n            _systemInfo.MaxCleanupDuration.Should().Be(200);\n            _systemInfo.AverageCleanupDuration.Should().Be(0);\n        }\n\n        [Fact]\n        public void KeepsMinDurationAfterReset()\n        {\n            _systemInfo.AddExecutionDuration(20);\n            _systemInfo.AddExecutionDuration(10);\n            _systemInfo.AddCleanupDuration(200);\n            _systemInfo.AddCleanupDuration(100);\n            _systemInfo.ResetDurations();\n\n            _systemInfo.AddExecutionDuration(15);\n            _systemInfo.AddCleanupDuration(150);\n\n            _systemInfo.AccumulatedExecutionDuration.Should().Be(15);\n            _systemInfo.MinExecutionDuration.Should().Be(10);\n            _systemInfo.MaxExecutionDuration.Should().Be(20);\n            _systemInfo.AverageExecutionDuration.Should().Be(15);\n\n            _systemInfo.AccumulatedCleanupDuration.Should().Be(150);\n            _systemInfo.MinCleanupDuration.Should().Be(100);\n            _systemInfo.MaxCleanupDuration.Should().Be(200);\n            _systemInfo.AverageCleanupDuration.Should().Be(150);\n        }\n    }\n}\n"
  },
  {
    "path": "tests/Entitas.Unity.Tests/fixtures/TestCleanupSystem.cs",
    "content": "﻿using Entitas;\n\npublic class TestCleanupSystem : ICleanupSystem\n{\n    public void Cleanup() { }\n}\n"
  },
  {
    "path": "tests/Entitas.Unity.Tests/fixtures/TestExecuteSystem.cs",
    "content": "﻿using Entitas;\n\npublic class TestExecuteSystem : IExecuteSystem\n{\n    public void Execute() { }\n}\n"
  },
  {
    "path": "tests/Entitas.Unity.Tests/fixtures/TestInitializeSystem.cs",
    "content": "﻿using Entitas;\n\npublic class TestInitializeSystem : IInitializeSystem\n{\n    public void Initialize() { }\n}\n"
  },
  {
    "path": "tests/Entitas.Unity.Tests/fixtures/TestReactiveSystem.cs",
    "content": "﻿using System.Collections.Generic;\nusing Entitas;\n\npublic class TestReactiveSystem : ReactiveSystem<Entity>\n{\n    public TestReactiveSystem(IContext<Entity> context) : base(context) { }\n\n    protected override ICollector<Entity> GetTrigger(IContext<Entity> context)\n    {\n        return context.CreateCollector(Matcher<Entity>.AllOf(0));\n    }\n\n    protected override bool Filter(Entity entity)\n    {\n        return true;\n    }\n\n    protected override void Execute(List<Entity> entities) { }\n}\n"
  },
  {
    "path": "tests/Entitas.Unity.Tests/fixtures/TestTearDownSystem.cs",
    "content": "﻿using Entitas;\n\npublic class TestTearDownSystem : ITearDownSystem\n{\n    public void TearDown() { }\n}\n"
  }
]