Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sschmid committed May 17, 2023
1 parent 562f3ea commit afaa47f
Show file tree
Hide file tree
Showing 43 changed files with 196 additions and 184 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ bin
TestResults

# IDEs
.idea
.vs
.vscode
.idea
**/Assets/Plugins/Editor/JetBrains
**/Assets/Plugins/Editor/JetBrains.meta

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2014 - 2022 Simon Schmid
Copyright (c) 2014 - 2023 Simon Schmid

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
318 changes: 165 additions & 153 deletions README.md

Large diffs are not rendered by default.

Binary file removed readme/Images/Blueprints/BlueprintInspector.png
Binary file not shown.
Binary file removed readme/Images/Blueprints/Blueprints.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed readme/Images/Blueprints/Entitas-Preferences.png
Binary file not shown.
Binary file removed readme/Images/Blueprints/GameController-Console.png
Binary file not shown.
Binary file removed readme/Images/Blueprints/GameController-Setup.png
Binary file not shown.
Binary file removed readme/Images/Donate-PayPal.gif
Binary file not shown.
Binary file removed readme/Images/Entitas-ECS.psd
Binary file not shown.
Binary file removed readme/Images/Entitas-Header.png
Binary file not shown.
Binary file removed readme/Images/Entitas-Header.psd
Binary file not shown.
Binary file removed readme/Images/Entitas.psd
Binary file not shown.
Binary file removed readme/Images/ExampleProject.png
Binary file not shown.
Binary file removed readme/Images/GramGames.png
Binary file not shown.
Binary file removed readme/Images/MadeForUnity.png
Binary file not shown.
Binary file removed readme/Images/Match-One.png
Binary file not shown.
Binary file removed readme/Images/UniteEurope2015.png
Binary file not shown.
Binary file removed readme/Images/UniteEurope2016.png
Binary file not shown.
Binary file removed readme/Images/Unity.png
Binary file not shown.
Binary file removed readme/Images/Unity.psd
Binary file not shown.
Binary file removed readme/Images/csharp.png
Binary file not shown.
Binary file removed readme/Images/madeWithEntitas.psd
Binary file not shown.
Binary file removed readme/Images/wooga-logo.png
Binary file not shown.
58 changes: 29 additions & 29 deletions readme/Readme/ReadmeSnippets.cs
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
using Entitas;
using UnityEngine;
using static GameMatcher;

// ReSharper disable UnusedVariable

namespace Readme
{
public static class ReadmeSnippets
public sealed class MoveSystem : IExecuteSystem
{
public static GameEntity CreateRedGem(this GameContext context, Vector3 position)
readonly IGroup<GameEntity> _group;

public MoveSystem(GameContext context)
{
var entity = context.CreateEntity();
entity.isGameBoardElement = true;
entity.isMovable = true;
entity.AddPosition(position);
entity.AddAsset("RedGem");
entity.isInteractive = true;
return entity;
_group = context.GetGroup(AllOf(Position, Velocity));
}

static void MoveSystem(GameContext context)
public void Execute()
{
var entities = context.GetEntities(GameMatcher.AllOf(
GameMatcher.Position,
GameMatcher.Velocity)
);
foreach (var e in entities)
{
var pos = e.position;
var vel = e.velocity;
e.ReplacePosition(pos.value + vel.value);
}
foreach (var e in _group.GetEntities())
e.ReplacePosition(e.position.value + e.velocity.value);
}
}

public static class ReadmeSnippets
{
public static void CreateEntity(this GameContext context, Vector3 position)
{
var entity = context.CreateEntity();
entity.AddPosition(Vector3.zero);
entity.AddVelocity(Vector3.forward);
entity.AddAsset("Player");
}

/*
*
*
* Wiki
*
*
*
*
*/

static void EntityExample(GameEntity entity)
Expand Down Expand Up @@ -64,9 +64,9 @@ static void ContextExample()

// Returns all entities having MovableComponent and PositionComponent.
// Matchers are also generated for you.
var entities = context.GetEntities(GameMatcher.AllOf(
GameMatcher.Movable,
GameMatcher.Position)
var entities = context.GetEntities(AllOf(
Movable,
Position)
);
foreach (var e in entities)
{
Expand All @@ -76,19 +76,19 @@ static void ContextExample()

static void GroupExample(GameContext context)
{
context.GetGroup(GameMatcher.Position).GetEntities();
context.GetGroup(Position).GetEntities();

// ----------------------------

context.GetGroup(GameMatcher.Position).OnEntityAdded += (group, entity, index, component) =>
context.GetGroup(Position).OnEntityAdded += (group, entity, index, component) =>
{
// Do something
};
}

static void CollectorExample(GameContext context)
{
var group = context.GetGroup(GameMatcher.Position);
var group = context.GetGroup(Position);
var collector = group.CreateCollector(GroupEvent.Added);

// ----------------------------
Expand Down
File renamed without changes
Binary file added readme/images/Entitas-Header.png
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit afaa47f

Please sign in to comment.