-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Entitas pure C#
Simon Schmid edited this page Oct 9, 2018
·
3 revisions
-
Create new C# Console Project
MyGame
with at least .Net 4.6 -
Add refereces to
Entitas.dll
Entitas.CodeGeneration.Attributes.dll
DesperateDevs.Utils.dll
-
Extract the contents of
Jenny.zip
to the root of your project -
Navigate into the same folder as
MyGame.csproj
-
Run
mono ../Jenny/Jenny.exe
and select- Create new Jenny.properties
- Edit Jenny.properties
- Assign the location of Jenny to
Jenny.SearchPaths
Jenny.Ignore.Keys =
Jenny.SearchPaths = ../Jenny
Jenny.Plugins =
Jenny.PreProcessors =
Jenny.DataProviders =
Jenny.CodeGenerators =
Jenny.PostProcessors =
Jenny.Server.Port = 3333
Jenny.Client.Host = localhost
- Run
mono ..Jenny/Jenny.exe
and select- Use Jenny.properties
- Select the following plugins
- DesperateDevs.CodeGeneration.Plugins
- Entitas.CodeGeneration.Plugins
- Entitas.Roslyn.CodeGeneration.Plugins
- Select
- Save and continue (auto import)
- When prompted to resolve plugin collisions, please choose
Entitas.Roslyn...
- Update
Jenny.properties
DesperateDevs.CodeGeneration.Plugins.ProjectPath = MyGame.csproj
DesperateDevs.CodeGeneration.Plugins.TargetDirectory = .
- You're all setup and you can generate now
- Run
mono ../Jenny/Jenny.exe gen
- Add your first component and generate
using Entitas;
namespace MyGame
{
class Program
{
public static void Main(string[] args)
{
var e = Contexts.sharedInstance.game.CreateEntity();
e.AddHealth(100);
}
}
}
public sealed class HealthComponent : IComponent
{
public int value;
}
MyGame
├── Jenny
│ └── Plugins
│ ├── DesperateDevs
│ ├── Entitas
│ └── Entitas.Roslyn
├── Libraries
│ ├── DesperateDevs.Utils.dll
│ ├── Entitas.CodeGeneration.Attributes.dll
│ └── Entitas.dll
├── MyGame
│ ├── Generated
│ ├── Jenny.properties
│ ├── MyGame.csproj
│ ├── Program.cs
│ └── simonschmid.userproperties
└── MyGame.sln
Guides: Introduction - Installation - Upgrading - FAQ - Cookbook - Contributing
Need Help? Ask a question on Discord or create an issue.
- The Basics
- Concepts
- Architecture / Patterns