Comments (6)
I just opened a new branch and wrote the exclude logic for engine:checkRequirements: #72
Anyway this feature request isn't as easy as it looked like.
I think we need to rewrite some parts of the Entity assignment functionality inside the engine for this feature. The biggest problem I see right now is the componentRemoved
functionality.
The initial assignment of Entities for Systems with exclude should already be working, but this needs some testing.
from lovetoys.
Interesting, how would this differ from not including "ExcludedComponent"
in System:requires()
?
from lovetoys.
In case you got an Entity with ['CompA', 'CompB', 'CompC']
. Now there is a System which requires ['CompA', 'CompB']
, but doesn't want Entities with CompC
.
This is actually a good idea, but we never encountered a scenario, where we needed this.
from lovetoys.
wow, happend to see this repo, good job guys. the 'ecs' is what i want , i just want to use this framework to develop my game , ew... how can i communicate with you guys? like a gorup ?
from lovetoys.
If instead of doing an: excludes, it is better to create operators something like "!" .
! = Select all entities with one of these.
function MoveSystem:requires()
return {"position", "!velocity"}
end
It would also be good to change requires by filter
from lovetoys.
I think the most flexible solution here would be to add a new method like requiresEntity
that gets passed one entity at a time, returning a boolean that indicates whether this entity is required by this system or not.
from lovetoys.
Related Issues (20)
- Treating systems as objects does not make sense HOT 2
- Travis-CI caches project files HOT 4
- module 'src.namespace' not found HOT 7
- Engine refers to global Entity HOT 4
- Docs for adding/starting systems HOT 1
- Should fail when calling addSystem(system, 'derp')
- Adding multiple instances of a system doesnt always throw an error
- Strange bug adding components HOT 12
- Question: systems can only update or draw? HOT 2
- Error when initializing lovetoys HOT 2
- Docs outdated? Init code doesn't seem to work HOT 6
- Entity:remove() / Entity:add() crashes when not initializing with globals
- what's the difference between allRequirements and singleRequirements HOT 1
- Best practice for removing entites based on some system logic? HOT 6
- Error: lovetoys/init.lua:7: module 'src.namespace' not found: HOT 3
- The version on luarocks is missing `init.lua` HOT 4
- main.lua file of the lovetoys example game linke at readme file is broken HOT 3
- How do you manually create classes? HOT 2
- Can't make sample code work HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lovetoys.