Update README for 0.5.1

This commit is contained in:
Christian Treffs 2018-12-04 08:18:04 +01:00
parent 72fdc6d119
commit d9a747fee4
1 changed files with 12 additions and 13 deletions

View File

@ -1,9 +1,9 @@
# Fireblade ECS (Entity-Component-System)
[![Build Status](https://travis-ci.com/fireblade-engine/ecs.svg?branch=master)](https://travis-ci.com/fireblade-engine/ecs)
[![version 0.5.0](https://img.shields.io/badge/version-0.5.0-brightgreen.svg)](releases/tag/v0.5.0)
[![version 0.5.1](https://img.shields.io/badge/version-0.5.1-brightgreen.svg)](releases/tag/v0.5.1)
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
[![swift version](https://img.shields.io/badge/swift-4.2-brightgreen.svg)](#)
[![platforms](https://img.shields.io/badge/platform-macOS%20|%20iOS%20|%20linux-brightgreen.svg)](#)
[![platforms](https://img.shields.io/badge/platforms-%20macOS%20|%20iOS%20|%20tvOS%20|%20watchOS%20|%20linux%20-brightgreen.svg)](#)
This is a **dependency free**, **lightweight**, **fast** and **easy to use** [Entity-Component-System](https://en.wikipedia.org/wiki/Entitycomponentsystem) implementation in Swift. It is developed and maintained as part of the [Fireblade Game Engine project](https://github.com/fireblade-engine).
@ -21,7 +21,7 @@ These instructions will get you a copy of the project up and running on your loc
### Installing
Fireblade ECS is available for all platforms that support [Swift 4](https://swift.org/) and the [Swift Package Manager (SPM)](https://github.com/apple/swift-package-manager).
Fireblade ECS is available for all platforms that support [Swift 4.2](https://swift.org/) and higher and the [Swift Package Manager (SPM)](https://github.com/apple/swift-package-manager).
Extend the following lines in your `Package.swift` file or use it to create a new project.
@ -33,7 +33,7 @@ import PackageDescription
let package = Package(
name: "YourPackageName",
dependencies: [
.package(url: "https://github.com/fireblade-engine/ecs.git", from: "0.5.0")
.package(url: "https://github.com/fireblade-engine/ecs.git", from: "0.5.1")
],
targets: [
.target(
@ -46,9 +46,7 @@ let package = Package(
## Code Example
<!--Show what the library does as concisely as possible, developers should be able to figure out **how** your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.-->
A core element in the Fireblade-ECS is the [Nexus](https://en.wiktionary.org/wiki/nexus#Noun).
The core element in the Fireblade-ECS is the [Nexus](https://en.wiktionary.org/wiki/nexus#Noun).
It acts as a centralized way to store, access and manage entities and their components.
A single `Nexus` may hold up to 4294967295 `Entities` at a time.
You may use more than one `Nexus`.
@ -79,9 +77,9 @@ and assign instances of them to an `Entity` with
myEntity.assign(Movement())
```
This ECS uses a grouping approach for entities with the same component types to optimize and ease up access to these.
Entities with the same component types may be accessed via a so called family.
A family has entities as members and component types as family traits.
This ECS uses a grouping approach for entities with the same component types to optimize and ease up access to them.
Entities with the same component types may be accessed via a so called `family`.
A `family` has entities as members and component types as family traits.
Create a family by calling `.family` with a set of traits on the nexus.
A family that containts only entities with a `Movement` and `PlayerInput` component, but no `Texture` component is created by
@ -92,8 +90,8 @@ let family = nexus.family(requiresAll: Movement.self, PlayerInput.self,
```
These entities are cached in the nexus for efficient access and iteration.
Families conform to the [LazySequenceProtocol](https://developer.apple.com/documentation/swift/lazysequenceprotocol) so that members (components)
may be iterated and accessed like any other sequence in Swift.
Families conform to the [Sequence](https://developer.apple.com/documentation/swift/sequence) so that members (components)
may be iterated and accessed like any other sequence in Swift.
Access a familiy's components directly on the family instance. To get each entity to the accessed components call `family.entityAndComponents`.
If you are only interested in a family's entities call `family.entities`.
@ -172,7 +170,8 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
## Acknowledgments
Inspired by
Inspired by
- [Ashley](https://github.com/libgdx/ashley)
- [Entitas](https://github.com/sschmid/Entitas-CSharp)
- [EntitasKit](https://github.com/mzaks/EntitasKit)