You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-22Lines changed: 20 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,47 +8,45 @@ AshleyCPP is a lightweight, cross-platform and easy to use Entity framework for
8
8
get started making a game using a pure, ECS-oriented style.
9
9
10
10
It prioritises speed and simplicity and mirrors the public API of the original where possible to make it easy to learn,
11
-
quick to run and simple to debug, doubly so for users of the Java original.
11
+
quick to run and simple to debug - and doubly so for users of the Java original.
12
12
13
-
The original is inspired by the [Ash](http://www.ashframework.org/) and
14
-
[Artemis](http://gamadu.com/artemis/) frameworks.
13
+
The original is inspired by the [Ash](http://www.ashframework.org/) and [Artemis](http://gamadu.com/artemis/) frameworks.
15
14
16
15
AshleyCPP is a personal project and while there are no guarantees that it will compile and work, the master branch
17
-
on GitHub should compile and function properly and should be usable for making projects right now.
16
+
on GitHub should compile and function properly and should be usable for making projects right now. There is currently no
17
+
guarantee of API stability between versions, or indeed any meaningful versioning.
18
18
19
19
### Building
20
-
21
-
AshleyCPP uses the CMake build system and comes with three build targets; the debug library, "AshleyCPP-d", the release library "AshleyCPP" and the imaginatively named executable "AshleyCPPTest". The test program has a hard dependency on Google Test.
20
+
AshleyCPP uses the CMake build system and comes with three build targets; the debug library, "AshleyCPP-d", the release library "AshleyCPP" and the (imaginatively named) executable "AshleyCPPTest". The test program uses GTest, which is bundled.
22
21
23
22
To build the library from source, install a relatively recent version of CMake, navigate to a copy of the source and
and proceed as normal for your environment. If you don't care about the tests, you can run `cmake -DEXCLUDE_TESTS=TRUE ..`and the dependency on GTest will be removed, just giving you the libraries.
29
+
and proceed as normal for your environment. If you don't care about the tests, you can run `cmake -DEXCLUDE_TESTS=TRUE ..`leaving you with just the library.
31
30
32
31
### Usage Notes and API Changes
33
32
While AshleyCPP strives to match the exported public API of the Java original, differences in the languages mean that
34
33
some differences exist. Such changes are listed in detail in APICHANGES.md, but a quickstart is given below.
35
34
36
-
Note: In situations where you'd use `.class` to get the type of a Java class, in C++ you can `#include <typeinfo>` and:
35
+
First in foremost: In situations where in Java you'd use `.class` to get a Java class, in C++ you can `#include <typeinfo>` and:
37
36
38
37
typeid(ComponentClass); // Equivalent to ComponentClass.class in Java.
39
38
40
39
// e.g. get a Family* that matches Entity having both ComponentA and ComponentB
- The whole library is enclosed in the `ashley` namespace. Use `using namespace ashley;` to save typing if you want.
45
-
- You can `#include` individual headers (organised similarly to the Java packages) or `#include "Ashley/AshleyCore.hpp"`
46
-
- Java generic functions that take vararg lists of `Class<? extends Component>` are replaced by
47
-
`std::initializer_list<std::type_index>`. Some functions also provide template overloads which may be easier and
48
-
faster to use; check the documentation for specific occurrences.
49
-
- The library enforces ownership using std::unique_ptr; the engine owns all entities and systems that are passed into
50
-
it and unless they're removed, all entities and systems die with the engine. Likewise, each Entity strictly owns
51
-
its attached components. This minimises the risk of leaking memory.
42
+
- The whole library is enclosed in the `ashley` namespace. Use `using namespace ashley;` to save typing if you want.
43
+
- You can `#include` individual headers (organised similarly to the Java packages) or `#include "Ashley/Ashley.hpp"`
44
+
- Java generic functions that take vararg lists of `Class<? extends Component>` are replaced by
45
+
`std::initializer_list<std::type_index>`. Some functions also provide template overloads which may be easier and
46
+
faster to use; check the documentation for specific occurrences.
47
+
- The library enforces ownership using `std::unique_ptr`; the engine owns all entities and systems that are passed into
48
+
it and unless they're removed, all entities and systems die with the engine. Likewise, each Entity strictly owns
49
+
its attached components. This minimises the risk of leaking memory.
52
50
53
51
For more specific changes, see the [APICHANGES.md](https://github.com/SgtCoDFish/AshleyCPP/blob/master/APICHANGES.md) file.
54
52
@@ -70,18 +68,18 @@ Ticked classes have both their implementation and tests complete.
70
68
-[x] IteratingSystem
71
69
-[x] IntervalSystem
72
70
-[x] IntervalIteratingSystem
73
-
-[] SortedIteratingSystem
71
+
-[x] SortedIteratingSystem
74
72
- Util
75
73
-[x] ObjectPool
76
74
-[x] Poolable
77
75
78
76
*NB:*
79
-
- Bag and ImmutableArray will not be implemented, there are better native C++ choices without me reinventing the wheel.
77
+
-`Bag` and `ImmutableArray` will probably not be implemented, there are better native C++ choices without reinventing the wheel.
80
78
- Currently implements as far as Ashley commit [#a276fe45](https://github.com/libgdx/ashley/commit/a276fe45c81d450f305ce1b5b0bd0fe837207a70).
81
79
82
-
Features to be implemented:
80
+
Nice to have features:
83
81
84
-
- Refactor entity ids, using a C++11 constexpr compile time hash and a templated Component class to prevent using a virtual method and vtable. Will lead to smaller components and better cache coherency.
82
+
- Refactor/rewrite handling of entity ids, using a C++11 constexpr compile time hash and a templated Component class to prevent using a virtual method and vtable. Will lead to smaller components and better cache coherency.
0 commit comments