Update README

This commit is contained in:
Christian Treffs 2019-08-20 22:44:30 +02:00
parent bef7415eae
commit 19dea0115e
1 changed files with 17 additions and 13 deletions

View File

@ -1,6 +1,6 @@
# 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.7.0](https://img.shields.io/badge/version-0.7.0-brightgreen.svg)](releases/tag/v0.7.0)
[![version 0.8.0](https://img.shields.io/badge/version-0.8.0-brightgreen.svg)](releases/tag/v0.8.0)
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
[![swift version](https://img.shields.io/badge/swift-5.0-brightgreen.svg)](#)
[![platforms](https://img.shields.io/badge/platforms-%20macOS%20|%20iOS%20|%20tvOS%20|%20watchOS%20|%20linux%20-brightgreen.svg)](#)
@ -9,17 +9,17 @@ This is a **dependency free**, **lightweight**, **fast** and **easy to use** [En
See the [Fireblade ECS Demo App](https://github.com/fireblade-engine/ecs-demo) to get started.
## Getting Started
## 🚀 Getting Started
These instructions will get you a copy of the project up and running on your local machine and provide a code example.
### Prerequisites
### 📋 Prerequisites
* [Swift Package Manager (SPM)](https://github.com/apple/swift-package-manager)
* [Swiftlint](https://github.com/realm/SwiftLint) for linting - (optional)
* [Jazzy](https://github.com/realm/jazzy) for documentation - (optional)
### Installing
### 💻 Installing
Fireblade ECS is available for all platforms that support [Swift 5.0](https://swift.org/) and higher and the [Swift Package Manager (SPM)](https://github.com/apple/swift-package-manager).
@ -33,7 +33,7 @@ import PackageDescription
let package = Package(
name: "YourPackageName",
dependencies: [
.package(url: "https://github.com/fireblade-engine/ecs.git", from: "0.7.0")
.package(url: "https://github.com/fireblade-engine/ecs.git", from: "0.8.0")
],
targets: [
.target(
@ -44,7 +44,9 @@ let package = Package(
```
## Code Example
## 📝 Code Example
### 🏛️ Nexus
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.
@ -57,10 +59,12 @@ Initialize a `Nexus` with
let nexus = Nexus()
```
### 👤 Entities
then create entities by letting the `Nexus` generate them.
```swift
let myEntity = nexus.create(entity: "myEntity")
let myEntity = nexus.createEntity()
```
You can define `Components` like this
@ -78,7 +82,7 @@ let movement = Movement()
myEntity.assign(movement)
```
### Families
### 👪 Families
This ECS uses a grouping approach for entities with the same component types to optimize cache locality and ease up access to them.
Entities with the __same component types__ may belong to one `Family`.
@ -154,7 +158,7 @@ class PlayerMovementSystem {
}
```
### Singles
### 🧑 Singles
A `Single` on the other hand is a special kind of family that holds exactly **one** entity with exactly **one** component for the entire lifetime of the Nexus. This may come in handy if you have components that have a [Singleton](https://en.wikipedia.org/wiki/Singleton_(mathematics)) character. Single components must conform to the `SingleComponent` protocol and will not be available through regular family iteration.
@ -180,7 +184,7 @@ class GameLogicSystem {
```
## Demo
## 🧪 Demo
See the [Fireblade ECS Demo App](https://github.com/fireblade-engine/ecs-demo) to get started.
@ -188,18 +192,18 @@ See the [Fireblade ECS Demo App](https://github.com/fireblade-engine/ecs-demo) t
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](tags).
## Authors
## ✍️ Authors
* [Christian Treffs](https://github.com/ctreffs) - *Initial work*
* [Manuel Weidmann](https://github.com/vyo)
See also the list of [contributors](https://github.com/fireblade-engine/ecs/blob/master/project/contributors) who participated in this project.
## License
## 🔏 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
## Acknowledgments
## 🙏 Acknowledgments
Inspired by