Commit graph

  • 9c5ceacacb -some cleanup Mergul 2019-10-10 22:14:18 +02:00
  • 41f1c6474b -fully working betterC for windows *replaced array[..] = array[ .. ] sclice copy with mempcy *added own std library (allocator, alloca, Mutex) *changed tamplates for collecting components for systems -fixed issue with multiple optional components registering for system Mergul 2019-10-10 20:56:44 +02:00
  • ed99807871 Merge branch 'master' of https://Mergul@bitbucket.org/mmcomando/ecs.git Mergul 2019-08-14 11:02:15 +02:00
  • 49a60d33c5 -fixed events thread safety Mergul 2019-08-14 11:00:21 +02:00
  • ebec25633e -now event handler system does not have to has EventInput structure Mergul 2019-08-13 11:58:01 +00:00
  • beab56033c -events are simplified to handleEvent(Entity*,Event) (use entity.getComponent to get entity components) Mergul 2019-08-13 11:13:26 +00:00
  • 9402e917f2 -added function to create EntityTemplate form Entity Mergul 2019-08-10 16:32:57 +00:00
  • 1be08eb534 -added pure annotation for some functions -addEntity now returns pointer instead of reference (it's has more sense) -added function addEntityCopy(EntityID) which adds copy of entity with it's whole data Mergul 2019-08-10 16:20:50 +00:00
  • 8318d2efb4 -added support for optional components in event handling Mergul 2019-08-10 15:44:01 +00:00
  • dfdb56d501 -system name getter -added error checking for event handling in registerSystem -now only valid handleEvent() functions are taken by system during register Mergul 2019-08-10 15:35:36 +00:00
  • f27e4c30ad -updated copyright Mergul 2019-06-27 16:53:51 +00:00
  • 86d91bc11c Merge branch 'master' of https://Mergul@bitbucket.org/mmcomando/ecs.git Mergul 2019-06-18 22:24:52 +00:00
  • 01ff3962b5 -added SimpleVector (vector with only ubyte data) -components adding and removing now use SimpleVector (optimalization) Mergul 2019-06-18 20:12:18 +02:00
  • b04ab77e0c -added components change caching (no HashMap searching during components adding or removing) Mergul 2019-06-18 17:49:51 +02:00
  • 235bbb49f2 -block allocator now track allocated blocks and is able to free memory -jobs data is now allocated in System struct -written memory cleanup (AddressSanitizer don't show any leak) Mergul 2019-06-18 16:45:38 +02:00
  • 9824b587fb -fixed stack-overflow error Mergul 2019-06-18 13:57:31 +02:00
  • 17fc7bc004 -removed __xtoHash() method Mergul 2019-06-17 18:25:36 +00:00
  • 28dfdc0176 Merge branch 'master' of https://Mergul@bitbucket.org/mmcomando/ecs.git Mergul 2019-06-17 18:05:01 +00:00
  • 9f125078ed -dmd bug workaround Mergul 2019-06-17 18:04:54 +00:00
  • 1396d0bf85 -removed -fvisibility=hidden (switch works only with betterC) Mergul 2019-06-02 11:05:38 +02:00
  • cb257a2360 -added export attribute Mergul 2019-05-15 08:47:30 +00:00
  • 9220a28f7c -fixed issue with ExcludedComponents as enum or alias -removed way to add excluded component by adding attribiute @excluded (it's very stupid way) Mergul 2019-04-06 20:27:28 +00:00
  • fe158e1b60 -removed commited code Mergul 2019-04-06 19:24:58 +00:00
  • 8b24ecf7d1 -some changes in registerSystem Mergul 2019-04-06 19:22:25 +00:00
  • a5eade669e -removed mixin genFillInputData Mergul 2019-04-06 18:41:48 +00:00
  • a93529dad1 -removed commented code Mergul 2019-04-06 18:09:25 +00:00
  • 63d5839225 -changed naming style to match whole project Mergul 2019-04-06 18:07:08 +00:00
  • b0760228b1 -changed assertion infos Mergul 2019-04-06 18:03:14 +00:00
  • 71c7df2ab3 -added third mmcomando commit Mergul 2019-04-06 17:51:42 +00:00
  • eaf2d1581c -removed next two mixins: *catchFunc *catchEntityFunc Mergul 2019-04-06 16:28:59 +00:00
  • f39d5ab403 -removed next mixin genParamsChecking() Mergul 2019-04-06 15:30:49 +00:00
  • fd6e6c0355 -changed naming style to match whole project Mergul 2019-04-06 15:11:44 +00:00
  • bf8fac84cf -removed comments Mergul 2019-04-06 15:03:29 +00:00
  • e7d3d08feb -fixed mmcomando commit bug Mergul 2019-04-06 15:02:07 +00:00
  • be5de2ae9c -added second mmcommando commit -removed some stupid feature Mergul 2019-04-06 14:47:33 +00:00
  • dbdbdb35e1 -added assert message Mergul 2019-04-06 14:36:50 +00:00
  • 7e7658af3b -added first mmcommando commit Mergul 2019-04-06 14:24:31 +00:00
  • 77f67004dd -removed string_intern -removed unused traits Mergul 2019-04-06 14:15:02 +00:00
  • 201681e4ca -fixed small issue, now Template.getComponent should return null if component doesn't exist in template Mergul 2019-04-04 17:54:39 +02:00
  • 0608fe6e89 -added new listener callback: onChangeEntity. Callback is called when entity optional components are changed. There is no info about which components are changed (added/removed), but should be in the future).This is probably slowest callback. Mergul 2019-03-28 20:25:08 +01:00
  • 7a33e4f94f -renamed callbacks: *onAdd -> onAddEntity *onRemove -> onRemoveEntity *update -> onUpdate Mergul 2019-03-28 18:01:43 +01:00
  • d118adc028 -code foramtted with dfmt Mergul 2019-03-28 17:57:28 +01:00
  • 280d7b8ec4 -onAdd/onRemove order is determined by system priority -fixed many bug with onAdd/onRemove -onAdd/onRemove now works even when system haven't update callback Mergul 2019-03-28 12:19:30 +01:00
  • c64d621f0e -fixed critical bug with onAdd callback Mergul 2019-03-26 13:13:32 +00:00
  • 4ac80d7025 -onAdd/onRemove called when components are changed Mergul 2019-03-24 14:42:21 +00:00
  • e4be23ee96 -onRemove() called when entity is removed from EntityManager Mergul 2019-03-23 21:47:39 +00:00
  • 1841c9c244 -working onAdd listener when new Entity is added to EntityManager Mergul 2019-03-23 20:34:50 +00:00
  • 3aad89fc56 -fillInputData created as local function in register process -call onAdd (WIP) Mergul 2019-03-23 20:18:26 +00:00
  • 6bbc8b5152 -git now should ignore .dub/dub.json -added onAdd/onRemove to test -added onAdd/onRemove callbacks for system -generating onAdd/onRemove listeners Mergul 2019-03-23 19:48:24 +00:00
  • a82ca1e659 -some documentation changes -added Component onCreate callback which is called after allocating entity from template Mergul 2019-03-21 13:19:03 +01:00
  • b18440e9bc -fixed problems with new DMD Mergul 2019-01-16 13:51:28 +01:00
  • dec0582398 -removed some unittest and unused code Mergul 2018-11-07 19:53:33 +01:00
  • 204ce9dc79 -almost every funtion is marked as @nogc and nothrow (only problem with HashMap) Mergul 2018-11-02 16:36:38 +01:00
  • fef55bd790 -removed imports (temporarly) Mergul 2018-11-02 15:52:35 +01:00
  • 60f720151e -changed .gitignore -imports temporarly removed from repo Mergul 2018-11-02 15:47:50 +01:00
  • 3bc5ff2423 -changes in gitignore -changed "absent" to "excluded" everywhere -added Events support: *systems are scanned by handleEvent() function *generate system callers for events *event sending have (untested) multithreaded support *EventInput structure in System has input components for event Mergul 2018-11-02 15:39:46 +01:00
  • 16a5696840 -removed UpdateBySystems version switch (it's now default behaviour) -beginRegister() and endRegister() was added (every register functions must be called between this calls, update calls can't be called there) -SystemCallers and Systems dependecies is rebuild always in endRegister(); -beginRegister() clear all SystemCallers and Systems dependencies -possibility to get System ID and execution state -JobGroup has now pointer to it's parent (SystemCaller) -SystemCaller clean up destructor Mergul 2018-10-27 17:34:27 +02:00
  • f666dfd1d5 -onBegin() return type was changed from void to bool -disabling system execution in onBegin() funciton Mergul 2018-10-26 17:43:51 +02:00
  • d3f7593afc -BlockAllocator is no longer template -Multithreaded IDManager.getNewID() *use implementation with free IDs stack (instead of classic pool) -support for multiple UpdatePasses. Passes are added by name, and must be called between begin() end() functions. -removed mutex from addEntity() -commit() function added. Used to commit all changes made while update() call. Called automatically by begin() end() functions. Mergul 2018-10-25 11:46:08 +02:00
  • 430ce8074c -multithreading jobs dependencies: *system has arrays of read only and modified components *new attribute "readonly" usable for variables which should be visible as read only. Const can be used instead for enable checks by compiler. *JobGroup was added. JobGroup contain array of jobs and array of dependencies (JobGroups) *new function generateDependencies() generate exclusion between systems, and then generate dependencies for SystemCallers and JobGroups -fixed issue with jobs generating (empty blocks with only newly added entities was used, and led to crash) -fixed small typo mistake Mergul 2018-10-20 11:42:29 +02:00
  • 2824bdb55b -multithreaded addEntity(). Works good, but: *IDManager has mutex (no multithreaded support) *allocating blocks has mutex (probably it's possible to do diffrent mutex for diffrent EntityInfo) -addEntity() if slightly better optimized Mergul 2018-10-15 22:25:28 +02:00
  • 6e2c00f608 -formatted with dfmt -cleaned up code Mergul 2018-10-14 18:36:31 +02:00
  • 5dd24b6462 -Systems, Components and Events now must have proper mixin. Mixins are located in ecs.core module. (i.e. mixin ECS.Component) -Multithreading support: *multithreaded update - updateMT(), function generates jobs to execute *added dispatch callback function to dispatch generated jobs (setJobDispachFunc) *added getID callback for get thread ID by EntityManager -added Job structure. Job has one function "execute()". -calling partial info update (required to multithreading) -multithreaded removeEntity, addCompoenents, removeComponents. Every thread has own data and remove/change lists. -multithreaded addEntity (WIP) -fixed issue with duplicating components -simpler and faster "findBlockWithFreeSpace" function -CallDataAllocator, allocator for CallDatas (used for Jobs) -fixed some bugs/issues Mergul 2018-10-14 16:59:46 +02:00
  • 3a767babc0 -call update by Systems instead of EntityTypes (version UpdateBySystems) -memory packing (every block in EntityType except last one are always full) Mergul 2018-10-10 18:35:20 +02:00
  • fddfc78ec1 -removed system components sorting due to fact that it's make an issue -workaround for DMD phobos issues Mergul 2018-10-02 15:36:00 +02:00
  • 2004909642 -sorting components ids in systems -changed callUpdate() prototype Mergul 2018-10-01 22:11:27 +02:00
  • 437c672478 -documentation Mergul 2018-10-01 19:40:24 +02:00
  • 288ad4c6cd -removed unused CallData.deltas member Mergul 2018-10-01 17:29:43 +02:00
  • e4573f1ec7 -better compile time code generation -support for AbsenComponents. Absen components can't exist in entity which are used by system. There are three possibilities to add absen component. Add '@absen' property to EntitiesData mebmer, create AbsenComponents enum with fields names corresponding to components names, or create AbsenComponents AliasSeq with strings expressions corresponding to components names. Mergul 2018-10-01 17:17:40 +02:00
  • 125c9e7d40 -support for 'length' parameter in EntitiesData (for convenience) Mergul 2018-10-01 15:08:14 +02:00
  • 0e13fafefd -removed 'InputStruct' version switch (now it's default behaviour) -checking if System struct has valid update(EntitiesData) prototype Mergul 2018-10-01 13:17:31 +02:00
  • d5780a6252 -working update() with EntitiesData structure input -added support for 'const' components input (read only, future usage) Mergul 2018-09-30 23:12:20 +02:00
  • ed589bbd71 -added absen components list to system -added ECS uda attributes -added InputStruct version switch (gets update() input as structure of arrays) -initial (WIP) EntitiesData update() input structure compile time parsing Mergul 2018-09-29 23:10:31 +02:00
  • 8468335b50 Merge branch 'master' of https://Mergul@bitbucket.org/mmcomando/ecs.git Mergul 2018-09-29 20:54:15 +02:00
  • ef17f5595a Merged linear-layout into master Dawid Masiukiewicz 2018-09-29 20:51:15 +02:00
  • 275699da90 -removed unnecessary executable file linear-layout Mergul 2018-09-29 20:50:36 +02:00
  • bb3f07ac70 -removed LinearLayout switch (from now it's default behaviour) Mergul 2018-09-29 20:49:07 +02:00
  • 783ef72eae -fixed getSystem function Mergul 2018-09-29 20:34:47 +02:00
  • 41a7f22cb3 -fixed optional components issue Mergul 2018-09-29 11:53:22 +02:00
  • c0ac19b6f9 -fixed EntityTemplate.getComponent() -fxied issue with components string in systems HashMap Mergul 2018-09-27 22:45:23 +02:00
  • c915b1a8c7 -EntityTemplate.getComponent additional data check -LinearLayout proggress: *added alignment to data *fixed add/remove component functions Mergul 2018-09-26 12:50:51 +02:00
  • c18ac54265 -LinearLayout proggress: *EntityTemplate.getComponent *Adding/removing components for Entitites -better code for adding components Mergul 2018-09-26 10:57:42 +02:00
  • cb9bac5dde -LinearLayout implemntation: *Entity.getComponent works *adding/removing objects work *update work Mergul 2018-09-26 09:02:16 +02:00
  • 78647977f9 -little change Mergul 2018-09-25 11:31:09 +02:00
  • 535071ebb9 -added version to dub.json Mergul 2018-09-23 19:31:17 +02:00
  • 9511e1936e -fixed issue with optional components in systems Mergul 2018-09-21 16:44:40 +02:00
  • 8cb5d6ce62 -EntitesBlock freeing -IDManager now increment counter on ID releasing (previously while creating new ID) Mergul 2018-09-20 20:33:55 +02:00
  • 45110e236c -fixed removingComponents issue (object was transferred to another block, but count of entities in block doesn't increase) -functions to get System by ID or ECS System by Type -added system_id to system -fixed issue with registering systems without update() function Mergul 2018-09-20 19:12:53 +02:00
  • 4ad81fe116 -changes in EntityAlocator * renamed to BlockAllocator * now it's template with compile time assingable block_size and block_in_allocation variables -WIP Event management * probably working sendSelfEvent() * registerEvent() -added win_dll.d as Windows DLL require functionality Mergul 2018-09-19 17:50:05 +02:00
  • d0fcdba6cd -registering same system multiple times only replace pointer for callback -added export attributes (required by windows to make DLL library, not work at now due to DMD bugs) -interface D files to import Mergul 2018-09-18 13:28:04 +02:00
  • cb0f56b0fb -EntityAllocator fixed issue with not initialized block pointer -deffered adding entities -deffered adding and removeing components Mergul 2018-09-17 14:46:30 +02:00
  • b3dce6560a -suport system callback: onCreate, onDestroy, onBegin, onEnd -support for optional Components for System -Components IDs in Systems are now stored as ushorts Mergul 2018-09-16 22:40:55 +02:00
  • 8fdb56e840 -fixed crash on getComponent when component doesn't exist -fixed Components ids sorting -added deferred object removing -new EntityManager functions: begin(), end(). Mergul 2018-09-16 14:16:18 +02:00
  • a066a97f01 -added removeComponents() function (removing by ids array, or components types) -sorting IDs in addComponents() and removeComponents() Mergul 2018-09-14 12:03:27 +02:00
  • 5b2a6e9890 -added EntityBlocks allocating in blocks (no memory freeing, currently block contain 128 EntityBlocks) Mergul 2018-09-13 22:37:37 +02:00
  • 1aa1fbf36b -support for system priority -fixed callers system pointer update -fixed HashMap issue Mergul 2018-09-13 22:04:43 +02:00
  • 0eaff0adad -Components onDestroy() support (called when component is destoryed) -EntityCallers pointers to systems now are updated after adding new system (or in future system reloading) -fixed compilation issue referenced to filling components with default values Mergul 2018-09-13 21:32:13 +02:00
  • 624c899c8c -getComponent functions for Template and Entity -error information about adding system with non existing component (prints name of system and component) -fill components in template with default values Mergul 2018-09-13 20:53:34 +02:00
  • 4b19907c03 -formatted all files with dfmt -more messy tests -some documentation -some useful code moved to functions -adding components to existing entity -opportunity to get entity by ID -fixed calculating deltas -sorting IDs arrays for allocating Templates -fixed alignment caluclation -added compile-time checks for "component_id" member existing in component Mergul 2018-09-13 00:10:48 +02:00
  • d3222eefbb -some usefull functions for IDManager -added EntityManager.removeEntity(EntityID) -EntitiesBlock now has ID usefull for updating first_free_block in EntityInfo Mergul 2018-09-12 17:38:41 +02:00