summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2021-07-09 01:57:33 -0400
committerrealtradam <[email protected]>2021-07-09 01:57:33 -0400
commitbb30c1012fbef34e155558ad3008ce029670329e (patch)
tree354c00966ea67781bfc5fb0d63e3409301ba54f5
parent233b8aef4cdd1121c55dbf856e8cd0e66dae25a5 (diff)
downloadFelECS-bb30c1012fbef34e155558ad3008ce029670329e.tar.gz
FelECS-bb30c1012fbef34e155558ad3008ce029670329e.zip
readme rewrite
-rw-r--r--README.mdown493
-rw-r--r--component_manager.rb4
-rw-r--r--docs/FelFlame.html6
-rw-r--r--docs/FelFlame/ComponentManager.html150
-rw-r--r--docs/FelFlame/Components.html22
-rw-r--r--docs/FelFlame/Entities.html2
-rw-r--r--docs/FelFlame/Scenes.html2
-rw-r--r--docs/FelFlame/Stage.html2
-rw-r--r--docs/FelFlame/Systems.html2
-rw-r--r--docs/_index.html2
-rw-r--r--docs/file.README.html555
-rw-r--r--docs/index.html555
-rw-r--r--docs/top-level-namespace.html2
13 files changed, 1055 insertions, 742 deletions
diff --git a/README.mdown b/README.mdown
index 432b853..fa0fec6 100644
--- a/README.mdown
+++ b/README.mdown
@@ -4,315 +4,402 @@
[![Maintainability](https://api.codeclimate.com/v1/badges/56d425d9078e98efb74b/maintainability)](https://codeclimate.com/github/realtradam/FelFlame/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/56d425d9078e98efb74b/test_coverage)](https://codeclimate.com/github/realtradam/FelFlame/test_coverage)
[![Inline docs](http://inch-ci.org/github/realtradam/FelFlame.svg?branch=master)](http://inch-ci.org/github/realtradam/FelFlame)
-[![Documentation Coverage](https://img.shields.io/badge/Documentation-Click%20Here-blue)](https://felflame.tradam.fyi)
+[![MIT License](https://img.shields.io/github/license/realtradam/FelFlame?label=license&style=flat)](https://github.com/realtradam/FelFlame/blob/master/LICENSE)
+[![Ko-Fi](https://img.shields.io/static/v1?message=Buy%20me%20a%20coffee&logo=kofi&labelColor=ff5e5b&color=434B57&logoColor=white&label=%20)](https://ko-fi.com/tradam)
+
+
+<!-- vim-markdown-toc GFM -->
+
++ [What is FelFlame?](#what-is-felflame)
++ [What is ECS?](#what-is-ecs)
+ - [Components](#components)
+ - [Entities](#entities)
+ - [Systems](#systems)
+ - [Scenes](#scenes)
+ - [Stage](#stage)
++ [Usage](#usage)
+ * [Entities](#entities-1)
+ - [Creation](#creation)
+ - [Accessing](#accessing)
+ - [Get ID](#get-id)
+ - [Adding and Removing Components](#adding-and-removing-components)
+ - [Deletion](#deletion)
+ * [Components](#components-1)
+ - [Creating a Component Manager](#creating-a-component-manager)
+ - [Creating a Component from a Component Manager](#creating-a-component-from-a-component-manager)
+ - [Accessing and Getting ID](#accessing-and-getting-id)
+ - [Accessing Attributes and Changing Them](#accessing-attributes-and-changing-them)
+ - [Deleting Components](#deleting-components)
+ - [Iterating over Components](#iterating-over-components)
+ * [Systems](#systems-1)
+ - [Creation](#creation-1)
+ - [Execution](#execution)
+ - [Alternative Execution](#alternative-execution)
+ - [Clearing Alternative Executions](#clearing-alternative-executions)
+ - [Redefinition](#redefinition)
+ * [Scenes](#scenes-1)
+ - [Creation](#creation-2)
+ - [Accessing](#accessing-1)
+ - [Adding Systems](#adding-systems)
+ - [Removing Systems](#removing-systems)
+ - [Clearing](#clearing)
+ - [Execution](#execution-1)
+ * [Stage](#stage-1)
+ - [Adding Scenes](#adding-scenes)
+ - [Removing Scenes](#removing-scenes)
+ - [Executing](#executing)
+ * [Closing Notes](#closing-notes)
++ [Contribution](#contribution)
+
+<!-- vim-markdown-toc -->
+
+# What is FelFlame?
+
+FelFlame is an ECS framework for developing games in the Ruby language. FelFlame has been designed from the ground up with these three ideas in mind:
+
+1. **Engine Agnostic:** FelFlame has been designed to be rendering engine agnostic as long as the target rendering engine is written in Ruby. This means that this framework can be dropped into existing rendering engines such as [Ruby2D](http://www.ruby2d.com) or [DRGTK](https://dragonruby.org/toolkit/game) with little modifications.
+2. **Easily Extensible:** FelFlame has been designed such that extensions to its capabilities can be easily added. Extensions such as rendering engine wrappers, premade systems, premade components, etcetera can be easily coded and then distributed as gems.
+3. **Priciple of (My) Least Astonishment:** I want to develop games using a language and framework I love and makes sense to me, inspired by the [Philosophy of the creator of Ruby](https://en.wikipedia.org/wiki/Ruby_(programming_language)#Philosophy).
+
+# What is ECS?
+ECS is a software architectural pattern that is used in video game development. Traditionally games were programmed using an object oriented method, while ECS instead attempts to program games using a data oriented method instead.
+ECS stands for Entity, Component, and System.
-# What is this?
+---
-This is a Ruby ECS Framework for developing games. It is still a work in progress in the early stages, is not fit for use, and does not work.
-It is designed to be platform agnostic, this means it should be able to work by plugging it into any ruby game engine/library/toolkit with minimal modifications.
+### Components
+This is where the data or information of a given "object" is stored. There is no logic or code here.
-I wanted a reusable framework so I could quickly and effectively develop games. I also want it to be more complete, as opposed to barebones or boilerplate.
-I plan to eventually add functionality outside of just ECS such as loading tilesets, a camera system, etc. that are built into the framework to work seamlessly.
+### Entities
+Entities will contain one or more Components, but contains no logic or data otherwise
+### Systems
+Systems are where all the logic or code is kept. There is no data stored in here.
-# What is currently implemented?
+---
-Entities and Components are mostly implemented, with only a few non-critical functions missing.
+By using this pattern it allows programmers to easily control what an "object" or entity can do and how much data it needs to have. It avoids the issue of inhertance as no inhertance is ever required in this system. If you need a certain entity to have a certain functionality you just add the relevant component to it, and the systems that automatically go over specific components will give your entitiy the desired functionality.
-Systems, Scenes, and the Stage still needs to be implemented
+**"But your framework also has `Scenes` and a `Stage`, what is that about?"**
-You can view the [Documentation here](https://felflame.tradam.fyi)
+---
+### Scenes
+Scenes are simply a collection or subset of Systems. This allows for an easy way to activate and deactivate Systems.
-# Specification
+### Stage
+The Stage is Scenes which are activated. This means any Scenes on the Stage are executed each frame, while the rest of the Systems are not.
-Below are the specifications I have imagined for this framework and have been written out. They are subject to change as FelFlame is developed and used.
+---
-## Aliases:
-```ruby
-FF = FelFlame
-FF::Ent = FelFlame::Entities
-FF::Cmp = FelFlame::Components
-FF::Sys = FelFlame::Systems
-FF::Sce = FelFlame::Scenes
-FF::Stg = FelFlame::Stage
-```
+If all of this sounds very confusing, don't worry. A video tutorial series is in the works where I will build a game using this framework and explain every step of the way. You can also read some examples and explanations below.
-## Classes:
+# Usage
-### FF::Entities
-`WARNING: POTENTIALLY OUT OF DATE`
-```ruby
-FF::Ent.new(@component1, @component2)
-@entity = FF::Ent.get(entity_id)
-FF::Ent.delete(entity_id)
[email protected] # => unique entity id
+## Entities
[email protected] # => [:id, :scenes, :components]
-FF::Ent.load @entity_dump
-```
+### Creation
+Entities are essentially "objects" in the game world. To create a new Entity we do the following:
-### FF::Components
-`WARNING: POTENTIALLY OUT OF DATE`
```ruby
-FF::Cmp.new('Name', 'param1', param2: 'default')
-FF::Cmp::Name.new(param1: value1)
-@component = FF::Cmp::Name.get(component_id)
-FF::Cmp::Name.get_by_entity(entity_id) # gets array of components
[email protected](param2: 'not default')
[email protected] = 'different not default'
-FF::Cmp::Name.detach(entity_id: ent_id, component_id: cmp_id)
-FF::Cmp::Name.remove_entity(entity_id) # Removes entity from any components
-FF::Cmp::Name.delete_component(component_id) # deletes component and removes from all relevant entities
[email protected] # returns hash of all variables!(and the id)
-FF::Cmp::Name.load @component_dump
-
-FF::Cmp::Health.added # => returns values for sys to setup
-FF::Cmp::Health.removed # => returns values for sys to setup
-FF::Cmp::Health.is_set('var') # => returns values for sys to setup
+@entity = FelFlame::Entities.new
```
+or if we want to add (any number of)components to it:
-### FF::Systems
```ruby
-FF::Sys.new(name: 'Render', position: 5, frame: 1) do
- @component.each do
- # functionality
- end
-end
+@entity = FelFlame::Entites.new(FelFlame::Components::Health.new,
+ @component,
+ FelFlame::Components::Armour[7])
+```
-# for all components belonging to a certain component manager
-FF::Sys::Render.trigger_when_added FF::Cmp::Health
-FF::Sys::Render.trigger_when_removed FF::Cmp::Health
-FF::Sys::Render.trigger_when_is_set(FF::Cmp::Health, 'var')
-FF::Sys::Render.clear_triggers FF::Cmp::Health # clears all triggers
-FF::Sys::Render.clear_triggers (FF::Cmp::Health, :added)
-FF::Sys::Render.clear_triggers (FF::Cmp::Health, :removed)
-FF::Sys::Render.clear_triggers (FF::Cmp::Health, :is_set, 'var')
+### Accessing
+Once components are created we can access them using their ID like so:
-# for specific components
-FF::Sys::Render.trigger_when_added FF::Cmp::Health[3]
-FF::Sys::Render.trigger_when_removed FF::Cmp::Health[3]
-FF::Sys::Render.trigger_when_is_set(FF::Cmp::Health[3], 'var')
-FF::Sys::Render.clear_triggers FF::Cmp::Health[3] # clears all triggers
-FF::Sys::Render.clear_triggers (FF::Cmp::Health[3], :added)
-FF::Sys::Render.clear_triggers (FF::Cmp::Health[3], :removed)
-FF::Sys::Render.clear_triggers (FF::Cmp::Health[3], :is_set, 'var')
+```ruby
+@entity = FelFlame::Entities[2]
```
-### FF::Scenes
+### Get ID
+Entity ID's are generated starting from 0 and ascending, unless if there is a missing ID because of a deleted
+entity where a new entity will claim that ID. To get the ID of an Entity:
+
```ruby
-FF::Scn.new(name: 'Scene1', position: 1)
-FF::Scn::Scene1.add @entity
-FF::Scn::Scene1.add FF::Sys::Render
-FF::Scn::Scene1.entities # => [id_1, id_7, etc]
-FF::Scn::Scene1.systems # => [:Render, :Damage, etc]
-FF::Scn::Scene1.dump # => [:name, :entities, :systems]
-FF::Scn::Scene1.load @scene_dump
```
-### FF::Stage
+### Adding and Removing Components
+We can still add or remove Components from an Entity after it has been created. Here is how:
+
```ruby
-FF::Stg.add FF::Scn::Scene1
-FF::Stg.remove FF::Scn::Scene1
-FF::Stg.scene # => [:Scene1, :Scene2, etc]
-FF::Stg.dump # => [:Scene1, :Scene2, etc]
-FF::Stg.load @stage_dump
-FF::Stg.clear
```
-### FelFlame
+### Deletion
+To have all Components from an Entity removed and the Entity deleted we do the following:
+
```ruby
-FF.dump # => all data
-FF.load @felflame_dump
```
----
-![blank](https://filestorage.catgirls.rodeo/images/whitespace.png)
-![blank](https://filestorage.catgirls.rodeo/images/whitespace.png)
-![blank](https://filestorage.catgirls.rodeo/images/whitespace.png)
----
-# Ramblings:
-Was my originally written up specs. Rewrote it as what is written above to be more clear.
-The below are more verbose but not as helpful for me for implementation. Once the framework is
-complete I will use a more verbose explanation as below to help users of the framework.
----
+## Components
-Creating Entities:
+### Creating a Component Manager
+Components are where all the data is stored. The data is stored in variables or accessors in each component.
+These accessors and their defaults are configured when a component manager is created, like so:
```ruby
-# Plain:
-@my_entity = FF:Ent.new
-
-# With components:
-FF::Ent.new(FF::Cmp::Position.new(var1: 'val', var3: 'change_default'),
- FF::Cmp::Health.new(hp: 20),
- FF::Cmp::Poison.new(dps: 3),
- FF::Cmp::Poison.new(dps: 2), # This entity has 2 of the same component in it!
- FF::Cmp::Selection.get(component_id)) # Components can belong to multiple entities, this component already existed elsewhere!
+@component_manager = FelFlame::Components.new('Stats', :armour, hp: 100)
```
-Adding and Removing Components from Entities:
-```ruby
-@my_entity = FF::Ent.get(entity_id)
+In this example we created a component manager called "Stats".
+The name given to component managers must follow the same rules for naming constants in ruby for a reason you will shortly see.
+The parameters following are all creating the attributes we can set.
+We can set any number of parameters we wish, in this example we define two.
+The `:armour` parameter is being created without a default, it will equal to `nil` when a new component is created, while `hp` will be equal to 100 when a component is created.
+When defining attributes symbols should be used.
+
+### Creating a Component from a Component Manager
+Now that we have a component manager we can make components from it like so:
-@my_entity.remove(component_id)
-# Remove the specific component with that id
+```ruby
+@component = FelFlame::Components::Stats.new
+```
-@my_entity.remove(FF::Cmp::Poison)
-# Removes all components of that type
+Or we can even change the defaults:
-@my_entity.add(FF::Cmp::Selection.new)
-# Adds a new Component
+```ruby
+@component = FelFlame::Components::Stats.new(armour: 'steel')
```
-Creating Component Class:
+### Accessing and Getting ID
+Just like Entities, Components have IDs.
+These IDs are only unique within the scope of their respective Component Managers.
+Here is how we can get the ID, as well as how to access a Component from its Component Manager.
```ruby
-# Creating a component 'factory':
-FF::Cmp.new('Name', 'var1', 'var2', var3: 'default') # Name, *no_default, **with_default
+@component = FelFlame::Components::Stats[2]
```
-And then using those components:
+### Accessing Attributes and Changing Them
+There are a few different ways we can read or change the attributes of a component depending on what our needs are.
+Here are the ways to edit attrubutes, followed by the ways to read them.
+```ruby
[email protected] = 'Mythril'
[email protected]_attrs(armour: 'Leather', hp: 95)
+```
```ruby
-@new_cmp = FF::Cmp::Name.new(var1: 'oke') # var3 will be 'default', var2 will be nil
-@new_cmp.var2 = 3 # now var2 is set
-@new_cmp.set(var1: 'nope', var3: 'different') # var1 and var3 are now changed!
-@new_cmp.to_hash # returns the hash of all variables!
[email protected] # => {armour: 'Leather', hp: 95}
```
-Referencing Components:
+### Deleting Components
+Deleting a Component is the same format as deleting an Entity. When a Component is deleted referenced to it such as to entities are automatically cleared.
+
```ruby
-FF::Cmp::Name.get(component_id) # gets component by their unique id
-FF::Cmp::Name.get_by_entity(entity_id) # gets component that is attached to the entitry
-# will return array of components if there is multiple of same component
-# if it returns array, see the `dump` section. Need to add custom method to the array
```
-Creating Systems:
+### Iterating over Components
+When you make Systems you will want to be able to iterate over all Components of the same Component Manager(for example iterating over all sprites to render them). Here is how we do that:
```ruby
-FF::Sys.new(name: 'Render', position: 5, frame: 1) do
-# position is the order in which systems get executed, can be overlapping but then order is unexpected between same positions
-# frame is on which frame the system will be called. 0 is never, 1 is on each frame, 2 is every other frame, etc
- FF::Cmp::Position.each do
- #render your sprite
- end
+FelFlame::Components::Sprites.each do |component|
+ #do something with components
end
```
-Enabling Systems:
-```ruby
-# By default systems are not enabled. You need to add them to a scene
-FF::Scn::Scene1.add FF::Sys::Render
+## Systems
+
+### Creation
+We can create Systems like so:
-# They can also be disabled by removing them
-FF::Scn::Scene1.remove FF::Sys::Render
+```ruby
+FelFlame::Systems.new(name: 'Render', priority: 2) do
+ # Code and Logic
+end
```
-Custom Hooks:
+The name we assign is how we can access the System, like so:
+
```ruby
-# Systems can be configured to be called whenever a certain component is added, removed or set
-FF::Sys::Damage.trigger_when FF::Cmp::Health.added
-FF::Sys::Revive.trigger_when FF::Cmp::Health.removed
-FF::Sys::Healup.trigger_when FF::Cmp::Health.is_set
-
-# Systems can also be manually called so you can code custom hooks!
-FF::Sys::Restore.run
+FelFlame::Systems::Render
```
+Priority determines the order Systems should be executed, this is used for `Scenes` and the `Stage`.
+The lower the number, the earlier a given System will be executed.
+E.g priority 1 will go first, priority 2 will go second, etcetera.
+
+Often we will want to execute some logic on each Component in a given Component Manager so our code might look like this:
-Scenes contain Entities and Systems
```ruby
-FF::Scn.new(name: 'Scene1', position: 1)
-# Multiple scenes could be ran at once, if they do then they will run according
-# to their positions as explained above
+FelFlame::Systems.new(name: 'Render', priority: 2) do
+ FelFlame::Components::Sprites.each do |component|
+ # do something with these components
+ end
+end
+```
-FF::Scn::Scene1.add FF::Entity.get(entity_id)
-# You can also just pass the id on its own => FF::Scn::Scene1.add entity_id
-FF::Scn::Scene1.add FF::Entity.new
+### Execution
+After we create a System, it won't do anything on its own until we tell it to. Here is how:
-FF::Scn::Scene1.add FF::Sys::Render
+```ruby
+FelFlame::Systems::Render.call
```
-To List Systems and Enties
+Sometimes you might want to manually activate a System, but the more common way to have Systems be triggered is to use Scenes and the Stage or the alternative ways of execution.
+
+### Alternative Execution
+Sometimes you want a System to automatically trigger when a special even happens. FelFlame can keep track of when a Component is added, removed, or when an attribute is changed and then execute Systems linked to these events. Here is how to create these links:
+
```ruby
-FF::Scn::Scene1.get_entities # => [id_1, id_7, etc]
-FF::Scn::Scene1.get_systems # => [:Render, :Damage, etc]
+# When this Component is added to an Entity, this System will be called
+FelFlame::Systems::PassiveRegen.trigger_when_added(@component)
+
+# When this Component is removed from an Entity, this System will be called
+FelFlame::Systems::PassiveRegen.trigger_when_removed(@component)
+
+# When this Component's health attribute is changed, this System will be called
+FelFlame::Systems::PassiveRegen.trigger_when_is_set(@component, :health)
```
-To run a Scene it must be added to the Stage
+If we want these triggers to happen for all Components that belong to specific Component Manager then we can do that instead:
+
```ruby
-FF::Stg.add FF::Scn::Scene1
+# When a Component from this Component Manager is added to an Entity, this System will be called
+FelFlame::Systems::PassiveRegen.trigger_when_added(@component_manager)
+
+# When a Component from this Component Manager is removed from an Entity, this System will be called
+FelFlame::Systems::PassiveRegen.trigger_when_removed(@component_manager)
+
+# When this Component's health attribute from this Component Manager is changed, this System will be called
+FelFlame::Systems::PassiveRegen.trigger_when_is_set(@component_manager, :health)
```
-Or remove it:
+We can create any number of these links between Systems, Components, and Component Manangers as we like, simply call the method again with our other Components and Component Managers
+
+### Clearing Alternative Executions
+
+If we wish to remove these links that we created, we can do that using the follwing function in any of the following ways:
+
```ruby
-FF::Stg.remove FF::Scn::Scene1
+# clears ALL triggers with this system
+FelFlame::Systems::PassiveRegen.clear_triggers
+
+# clears ALL triggers with this Component Manager
+FelFlame::Systems::PassiveRegen.clear_triggers(@component)
+
+# clear the 'trigger_when_added' for this Component
+FelFlame::Systems::PassiveRegen.clear_triggers(@component, :added)
+
+# clear the 'trigger_when_removed' for this Component
+FelFlame::Systems::PassiveRegen.clear_triggers(@component, :removed)
+
+# clear the 'trigger_when_is_set' for this Component specifically for the health attribute
+FelFlame::Systems::PassiveRegen.clear_triggers(@component, :is_set, :health)
```
-Show all Scenes on the Stage:
+Likewise we can do the same with Component Managers:
+
```ruby
-FF::Stg.scenes # => [:Scene1, :Scene2, etc]
+# clears ALL triggers with this Component
+FelFlame::Systems::PassiveRegen.clear_triggers(@component_manager)
+
+# clear the 'trigger_when_added' for this Component Manager
+FelFlame::Systems::PassiveRegen.clear_triggers(@component_manager, :added)
+
+# clear the 'trigger_when_removed' for this Component Manager
+FelFlame::Systems::PassiveRegen.clear_triggers(@component_manager, :removed)
+
+# clear the 'trigger_when_is_set' for this Component Manager specifically for the health attribute
+FelFlame::Systems::PassiveRegen.clear_triggers(@component_manager, :is_set, :health)
```
-Remove all Scenes from the Stage:
+### Redefinition
+
+If we wanted to change what code or logic a given System executes, we could do that with:
+
```ruby
-FF::Stg.clear
+FelFlame::Systems::PassiveRegen.redefine do
+ # Some new logic or code
+end
```
-You can save the current game state:
+## Scenes
+
+### Creation
+Once we have all the core parts of ECS, we will want to organize our Systems. To do this we will use Scenes to group up Systems so they can quickly be enabled or disabled. Note that [Alternative Executions](#alternative-execution) will occur even if they are not part of a Scene. Here is how we make a new Scene:
+
```ruby
-@json_save_data = FF.dump
+@scene = FelFlame::Scenes.new('ExampleScene')
```
-You can also specifically choose what you want to save:
+### Accessing
+Just like other classes in FelFlame, the name we gave the Scene is how we access it:
+
```ruby
-@hash_entity = FF::Ent.get(entity_id).dump
-# to save all components related to a player
+@scene = FelFlame::Scenes::ExampleScene
+```
-@hash_component_single = FF::Cmp::Health.get(component_id).dump
-# save all data in the single component(needs to handle arrays of components)
+### Adding Systems
+Adding Systems is simple. We can add as many as we want. In this example we add 3 different systems:
-@hash_component = FF::Cmp::Health.dump
-# save all components of a certain component type
+```ruby
+FelFlame::Scenes::ExampleScene.add(FelFlame::Systems::Render, @system2, @system3)
+```
-@hash_components_all = FF::Cmp.dump
-# save all components
+### Removing Systems
+Removing Systems works simularly:
-@hash_scene = FF::Scn::Scene1.dump
-# save all entities, components, and activated systems in a given scene
+```ruby
+FelFlame::Scenes::ExampleScene.remove(FelFlame::Systems::Render, @system2, @system3)
```
-And then they can be loaded back in:
+### Clearing
+If you want to remove all Systems from a Scene here is how we do it:
+
```ruby
-FF::Ent.load(@hash_entity)
-FF::Cmp::Health.load(@hash_component)
-FF::Cmp.load(@hash_component)
-FF::Cmp.load(@hash_components_all)
-FF::Scn.load(@Hash_scene)
```
-### To Do List(old)
+### Execution
+To execute all Systems within a scene once we can just do:
----
+```ruby
+```
-* [ ] Some level of hierarchical support?
-* [ ] One Component to many entities.
-* [ ] Multiple of same component to one entity
-* [ ] State Machine?
-* [ ] Systems execute code on an event
- * [ ] Adding/removing/setting component is event
- * [ ] Frame is an event
-* [ ] System Execution Order
-* [ ] Save Dump/Load
+The Scene will make sure that the systems are executed in the correct order based on their given priorities
+## Stage
+### Adding Scenes
+Finally we have the Stage. There is only a single Stage and we do not have to create it as it exists by default. By adding a Scene to the Stage we are saying that the Scene is active. To add a Scene we do the following:
+
+```ruby
+FelFlame::Stage.add FelFlame::Scene::ExampleScene
+```
+### Removing Scenes
+Likewise we can remove Scenes:
+```ruby
+FelFlame::Stage.remove FelFlame::Scene::ExampleScene
+```
+### Executing
+On each frame of the game we want to execute the Stage once. When the Stage is executed it is progressing your game 1 frame forward. The Stage will make sure for you that all the Systems from all Scenes added will be executed in the correct order according to their priority. Here is how we do it:
+```ruby
+FelFlame::Stage.call
+```
+## Closing Notes
+There are some methods I haven't gone over in the overview. If you want to see everything and read in more detail check out the [Documentation](https://rubydoc.info/github/realtradam/FelFlame/master/frames)!
+# Contribution
+Contributors are welcome! I am always looking to impove the capabilities of game development in Ruby. Feel free to open an issue to discuss a proposed changed or fix. To code a change or fix first fork the project. Next write your changes or fixes. Make sure all your changes and fixes are properly documented using Yard(I will not merge if it is not 100% documented) and make sure everything has tests written for it with Rspec(I will also not merge if it does not have 100% test coverage). Once you have your changes made then simply make a pull request.
+If you need help writing documentation or tests feel free to ask!
+If you want to contribute to development with a thanks you can always [buy me a coffee ;^)](https://ko-fi.com/tradam)
diff --git a/component_manager.rb b/component_manager.rb
index 3ffdff3..1cfd76d 100644
--- a/component_manager.rb
+++ b/component_manager.rb
@@ -1,7 +1,3 @@
-#require 'app/ECS/base_component.rb'
-
-#require 'app/ECS/components/00_test_component.rb'
-#require 'app/ECS/components/01_based.rb'
class FelFlame
class Components
@component_map = []
diff --git a/docs/FelFlame.html b/docs/FelFlame.html
index 62ce5bb..2a8640b 100644
--- a/docs/FelFlame.html
+++ b/docs/FelFlame.html
@@ -94,8 +94,8 @@
<dl>
<dt>Defined in:</dt>
- <dd>component_manager.rb<span class="defines">,<br />
- system_manager.rb,<br /> entity_manager.rb,<br /> scene_manager.rb,<br /> stage_manager.rb,<br /> felflame.rb</span>
+ <dd>felflame.rb<span class="defines">,<br />
+ system_manager.rb,<br /> component_manager.rb,<br /> entity_manager.rb,<br /> scene_manager.rb,<br /> stage_manager.rb</span>
</dd>
</dl>
@@ -307,7 +307,7 @@
</div>
<div id="footer">
- Generated on Wed Jul 7 17:45:24 2021 by
+ Generated on Fri Jul 9 01:56:53 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.7.3).
</div>
diff --git a/docs/FelFlame/ComponentManager.html b/docs/FelFlame/ComponentManager.html
index ef75405..d75d01c 100644
--- a/docs/FelFlame/ComponentManager.html
+++ b/docs/FelFlame/ComponentManager.html
@@ -617,6 +617,10 @@
<pre class="lines">
+100
+101
+102
+103
104
105
106
@@ -631,14 +635,10 @@
115
116
117
-118
-119
-120
-121
-122</pre>
+118</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 104</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 100</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span>
<span class='comment'># Prepare the object
@@ -710,12 +710,12 @@
<pre class="lines">
-136
-137
-138</pre>
+132
+133
+134</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 136</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 132</span>
<span class='kw'>def</span> <span class='id identifier rubyid_addition_triggers'>addition_triggers</span>
<span class='ivar'>@addition_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -766,12 +766,12 @@
<pre class="lines">
-152
-153
-154</pre>
+148
+149
+150</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 152</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 148</span>
<span class='kw'>def</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span>
<span class='ivar'>@attr_triggers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
@@ -822,12 +822,12 @@
<pre class="lines">
-144
-145
-146</pre>
+140
+141
+142</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 144</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 140</span>
<span class='kw'>def</span> <span class='id identifier rubyid_removal_triggers'>removal_triggers</span>
<span class='ivar'>@removal_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -883,12 +883,12 @@
<pre class="lines">
-81
-82
-83</pre>
+77
+78
+79</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 81</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 77</span>
<span class='kw'>def</span> <span class='id identifier rubyid_addition_triggers'>addition_triggers</span>
<span class='ivar'>@addition_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -939,12 +939,12 @@
<pre class="lines">
-97
-98
-99</pre>
+93
+94
+95</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 97</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 93</span>
<span class='kw'>def</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span>
<span class='ivar'>@attr_triggers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
@@ -995,12 +995,12 @@
<pre class="lines">
-63
-64
-65</pre>
+59
+60
+61</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 63</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 59</span>
<span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span>
<span class='ivar'>@id</span>
@@ -1051,12 +1051,12 @@
<pre class="lines">
-89
-90
-91</pre>
+85
+86
+87</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 89</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 85</span>
<span class='kw'>def</span> <span class='id identifier rubyid_removal_triggers'>removal_triggers</span>
<span class='ivar'>@removal_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -1141,12 +1141,12 @@
<pre class="lines">
-169
-170
-171</pre>
+165
+166
+167</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 169</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 165</span>
<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span>
<span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rbracket'>]</span>
@@ -1195,12 +1195,12 @@
<pre class="lines">
-176
-177
-178</pre>
+172
+173
+174</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 176</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 172</span>
<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
@@ -1260,18 +1260,18 @@
<pre class="lines">
+199
+200
+201
+202
203
204
205
206
-207
-208
-209
-210
-211</pre>
+207</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 203</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 199</span>
<span class='kw'>def</span> <span class='id identifier rubyid_attr_changed_trigger_systems'>attr_changed_trigger_systems</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span>
<span class='id identifier rubyid_systems_to_execute'>systems_to_execute</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span>
@@ -1331,16 +1331,16 @@
<pre class="lines">
+230
+231
+232
+233
234
235
-236
-237
-238
-239
-240</pre>
+236</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 234</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 230</span>
<span class='kw'>def</span> <span class='id identifier rubyid_attrs'>attrs</span>
<span class='id identifier rubyid_return_hash'>return_hash</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_variables'>instance_variables</span><span class='period'>.</span><span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_final'>final</span><span class='op'>|</span>
@@ -1398,6 +1398,10 @@
<pre class="lines">
+211
+212
+213
+214
215
216
217
@@ -1410,14 +1414,10 @@
224
225
226
-227
-228
-229
-230
-231</pre>
+227</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 215</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 211</span>
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
<span class='id identifier rubyid_addition_triggers'>addition_triggers</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_system'>system</span><span class='op'>|</span>
@@ -1480,12 +1480,12 @@
<pre class="lines">
-189
-190
-191</pre>
+185
+186
+187</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 189</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 185</span>
<span class='kw'>def</span> <span class='id identifier rubyid_entities'>entities</span>
<span class='ivar'>@entities</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -1534,12 +1534,12 @@
<pre class="lines">
-183
-184
-185</pre>
+179
+180
+181</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 183</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 179</span>
<span class='kw'>def</span> <span class='id identifier rubyid_to_i'>to_i</span>
<span class='id identifier rubyid_id'>id</span>
@@ -1593,14 +1593,14 @@
<pre class="lines">
-195
-196
-197
-198
-199</pre>
+191
+192
+193
+194
+195</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 195</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 191</span>
<span class='kw'>def</span> <span class='id identifier rubyid_update_attrs'>update_attrs</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
<span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
@@ -1617,7 +1617,7 @@
</div>
<div id="footer">
- Generated on Wed Jul 7 17:45:24 2021 by
+ Generated on Fri Jul 9 01:56:54 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.7.3).
</div>
diff --git a/docs/FelFlame/Components.html b/docs/FelFlame/Components.html
index de48255..855d2bb 100644
--- a/docs/FelFlame/Components.html
+++ b/docs/FelFlame/Components.html
@@ -231,12 +231,12 @@
<pre class="lines">
-51
-52
-53</pre>
+47
+48
+49</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 51</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 47</span>
<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='id identifier rubyid_constants'>constants</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
@@ -349,6 +349,10 @@
<pre class="lines">
+19
+20
+21
+22
23
24
25
@@ -369,14 +373,10 @@
40
41
42
-43
-44
-45
-46
-47</pre>
+43</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'component_manager.rb', line 23</span>
+ <pre class="code"><span class="info file"># File 'component_manager.rb', line 19</span>
<span class='kw'>def</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_attrs'>attrs</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_attrs_with_defaults'>attrs_with_defaults</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="FelFlame::Components (class)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_const_defined?'>const_defined?</span><span class='lparen'>(</span><span class='id identifier rubyid_component_name'>component_name</span><span class='rparen'>)</span>
@@ -413,7 +413,7 @@
</div>
<div id="footer">
- Generated on Wed Jul 7 17:45:24 2021 by
+ Generated on Fri Jul 9 01:56:54 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.7.3).
</div>
diff --git a/docs/FelFlame/Entities.html b/docs/FelFlame/Entities.html
index f789cb3..9953edb 100644
--- a/docs/FelFlame/Entities.html
+++ b/docs/FelFlame/Entities.html
@@ -1044,7 +1044,7 @@
</div>
<div id="footer">
- Generated on Wed Jul 7 17:45:24 2021 by
+ Generated on Fri Jul 9 01:56:54 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.7.3).
</div>
diff --git a/docs/FelFlame/Scenes.html b/docs/FelFlame/Scenes.html
index 00252ed..569657f 100644
--- a/docs/FelFlame/Scenes.html
+++ b/docs/FelFlame/Scenes.html
@@ -751,7 +751,7 @@
</div>
<div id="footer">
- Generated on Wed Jul 7 17:45:24 2021 by
+ Generated on Fri Jul 9 01:56:54 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.7.3).
</div>
diff --git a/docs/FelFlame/Stage.html b/docs/FelFlame/Stage.html
index 1027477..e3c3853 100644
--- a/docs/FelFlame/Stage.html
+++ b/docs/FelFlame/Stage.html
@@ -588,7 +588,7 @@
</div>
<div id="footer">
- Generated on Wed Jul 7 17:45:24 2021 by
+ Generated on Fri Jul 9 01:56:54 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.7.3).
</div>
diff --git a/docs/FelFlame/Systems.html b/docs/FelFlame/Systems.html
index 3586974..10b7bf5 100644
--- a/docs/FelFlame/Systems.html
+++ b/docs/FelFlame/Systems.html
@@ -1531,7 +1531,7 @@
</div>
<div id="footer">
- Generated on Wed Jul 7 17:45:24 2021 by
+ Generated on Fri Jul 9 01:56:54 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.7.3).
</div>
diff --git a/docs/_index.html b/docs/_index.html
index 24ecfff..a4c9aa2 100644
--- a/docs/_index.html
+++ b/docs/_index.html
@@ -163,7 +163,7 @@
</div>
<div id="footer">
- Generated on Wed Jul 7 17:45:24 2021 by
+ Generated on Fri Jul 9 01:56:53 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.7.3).
</div>
diff --git a/docs/file.README.html b/docs/file.README.html
index ca7e97f..7066296 100644
--- a/docs/file.README.html
+++ b/docs/file.README.html
@@ -62,318 +62,433 @@
<p><a href="https://codeclimate.com/github/realtradam/FelFlame/maintainability"><img src="https://api.codeclimate.com/v1/badges/56d425d9078e98efb74b/maintainability" alt="Maintainability"></a>
<a href="https://codeclimate.com/github/realtradam/FelFlame/test_coverage"><img src="https://api.codeclimate.com/v1/badges/56d425d9078e98efb74b/test_coverage" alt="Test Coverage"></a>
<a href="http://inch-ci.org/github/realtradam/FelFlame"><img src="http://inch-ci.org/github/realtradam/FelFlame.svg?branch=master" alt="Inline docs"></a>
-<a href="https://felflame.tradam.fyi"><img src="https://img.shields.io/badge/Documentation-Click%20Here-blue" alt="Documentation Coverage"></a></p>
+<a href="https://github.com/realtradam/FelFlame/blob/master/LICENSE"><img src="https://img.shields.io/github/license/realtradam/FelFlame?label=license&style=flat" alt="MIT License"></a>
+<a href="https://ko-fi.com/tradam"><img src="https://img.shields.io/static/v1?message=Buy%20me%20a%20coffee&logo=kofi&labelColor=ff5e5b&color=434B57&logoColor=white&label=%20" alt="Ko-Fi"></a></p>
-<h1 id="what-is-this">What is this?</h1>
+<!-- vim-markdown-toc GFM -->
-<p>This is a Ruby ECS Framework for developing games. It is still a work in progress in the early stages, is not fit for use, and does not work.
-It is designed to be platform agnostic, this means it should be able to work by plugging it into any ruby game engine/library/toolkit with minimal modifications. </p>
+<ul>
+<li><a href="#what-is-felflame">What is FelFlame?</a></li>
+<li><a href="#what-is-ecs">What is ECS?</a>
+ - <a href="#components">Components</a>
+ - <a href="#entities">Entities</a>
+ - <a href="#systems">Systems</a>
+ - <a href="#scenes">Scenes</a>
+ - <a href="#stage">Stage</a></li>
+<li><a href="#usage">Usage</a>
+
+<ul>
+<li><a href="#entities-1">Entities</a>
+
+<ul>
+<li><a href="#creation">Creation</a></li>
+<li><a href="#accessing">Accessing</a></li>
+<li><a href="#get-id">Get ID</a></li>
+<li><a href="#adding-and-removing-components">Adding and Removing Components</a></li>
+<li><a href="#deletion">Deletion</a></li>
+</ul></li>
+<li><a href="#components-1">Components</a>
+
+<ul>
+<li><a href="#creating-a-component-manager">Creating a Component Manager</a></li>
+<li><a href="#creating-a-component-from-a-component-manager">Creating a Component from a Component Manager</a></li>
+<li><a href="#accessing-and-getting-id">Accessing and Getting ID</a></li>
+<li><a href="#accessing-attributes-and-changing-them">Accessing Attributes and Changing Them</a></li>
+<li><a href="#deleting-components">Deleting Components</a></li>
+<li><a href="#iterating-over-components">Iterating over Components</a></li>
+</ul></li>
+<li><a href="#systems-1">Systems</a>
+
+<ul>
+<li><a href="#creation-1">Creation</a></li>
+<li><a href="#execution">Execution</a></li>
+<li><a href="#alternative-execution">Alternative Execution</a></li>
+<li><a href="#clearing-alternative-executions">Clearing Alternative Executions</a></li>
+<li><a href="#redefinition">Redefinition</a></li>
+</ul></li>
+<li><a href="#scenes-1">Scenes</a>
+
+<ul>
+<li><a href="#creation-2">Creation</a></li>
+<li><a href="#accessing-1">Accessing</a></li>
+<li><a href="#adding-systems">Adding Systems</a></li>
+<li><a href="#removing-systems">Removing Systems</a></li>
+<li><a href="#clearing">Clearing</a></li>
+<li><a href="#execution-1">Execution</a></li>
+</ul></li>
+<li><a href="#stage-1">Stage</a>
+
+<ul>
+<li><a href="#adding-scenes">Adding Scenes</a></li>
+<li><a href="#removing-scenes">Removing Scenes</a></li>
+<li><a href="#executing">Executing</a></li>
+</ul></li>
+<li><a href="#closing-notes">Closing Notes</a></li>
+</ul></li>
+<li><a href="#contribution">Contribution</a></li>
+</ul>
+
+<!-- vim-markdown-toc -->
+
+<h1 id="what-is-felflame">What is FelFlame?</h1>
+
+<p>FelFlame is an ECS framework for developing games in the Ruby language. FelFlame has been designed from the ground up with these three ideas in mind:</p>
+
+<ol>
+<li><strong>Engine Agnostic:</strong> FelFlame has been designed to be rendering engine agnostic as long as the target rendering engine is written in Ruby. This means that this framework can be dropped into existing rendering engines such as <a href="http://www.ruby2d.com">Ruby2D</a> or <a href="https://dragonruby.org/toolkit/game">DRGTK</a> with little modifications.</li>
+<li><strong>Easily Extensible:</strong> FelFlame has been designed such that extensions to its capabilities can be easily added. Extensions such as rendering engine wrappers, premade systems, premade components, etcetera can be easily coded and then distributed as gems.</li>
+<li><strong>Priciple of (My) Least Astonishment:</strong> I want to develop games using a language and framework I love and makes sense to me, inspired by the <a href="https://en.wikipedia.org/wiki/Ruby_(programming_language)#Philosophy">Philosophy of the creator of Ruby</a>.</li>
+</ol>
-<p>I wanted a reusable framework so I could quickly and effectively develop games. I also want it to be more complete, as opposed to barebones or boilerplate.
-I plan to eventually add functionality outside of just ECS such as loading tilesets, a camera system, etc. that are built into the framework to work seamlessly.</p>
+<h1 id="what-is-ecs">What is ECS?</h1>
-<h1 id="what-is-currently-implemented">What is currently implemented?</h1>
+<p>ECS is a software architectural pattern that is used in video game development. Traditionally games were programmed using an object oriented method, while ECS instead attempts to program games using a data oriented method instead.<br>
+ECS stands for Entity, Component, and System.</p>
-<p>Entities and Components are mostly implemented, with only a few non-critical functions missing.</p>
+<hr>
+
+<h3 id="components">Components</h3>
+
+<p>This is where the data or information of a given &quot;object&quot; is stored. There is no logic or code here. </p>
+
+<h3 id="entities">Entities</h3>
-<p>Systems, Scenes, and the Stage still needs to be implemented</p>
+<p>Entities will contain one or more Components, but contains no logic or data otherwise</p>
-<p>You can view the <a href="https://felflame.tradam.fyi">Documentation here</a></p>
+<h3 id="systems">Systems</h3>
-<h1 id="specification">Specification</h1>
+<p>Systems are where all the logic or code is kept. There is no data stored in here.</p>
-<p>Below are the specifications I have imagined for this framework and have been written out. They are subject to change as FelFlame is developed and used.</p>
+<hr>
+
+<p>By using this pattern it allows programmers to easily control what an &quot;object&quot; or entity can do and how much data it needs to have. It avoids the issue of inhertance as no inhertance is ever required in this system. If you need a certain entity to have a certain functionality you just add the relevant component to it, and the systems that automatically go over specific components will give your entitiy the desired functionality. </p>
-<h2 id="aliases">Aliases:</h2>
+<p><strong>&quot;But your framework also has <code>Scenes</code> and a <code>Stage</code>, what is that about?&quot;</strong> </p>
+
+<hr>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sce</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span>
+<h3 id="scenes">Scenes</h3>
+
+<p>Scenes are simply a collection or subset of Systems. This allows for an easy way to activate and deactivate Systems.</p>
+
+<h3 id="stage">Stage</h3>
+
+<p>The Stage is Scenes which are activated. This means any Scenes on the Stage are executed each frame, while the rest of the Systems are not.</p>
+
+<hr>
+
+<p>If all of this sounds very confusing, don&#39;t worry. A video tutorial series is in the works where I will build a game using this framework and explain every step of the way. You can also read some examples and explanations below.</p>
+
+<h1 id="usage">Usage</h1>
+
+<h2 id="entities">Entities</h2>
+
+<h3 id="creation">Creation</h3>
+
+<p>Entities are essentially &quot;objects&quot; in the game world. To create a new Entity we do the following:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FelFlame/Entities.html#initialize-instance_method" title="FelFlame::Entities#initialize (method)">new</a></span></span>
</code></pre>
-<h2 id="classes">Classes:</h2>
+<p>or if we want to add (any number of)components to it:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'>Entites</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='comma'>,</span>
+ <span class='ivar'>@component</span><span class='comma'>,</span>
+ <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Armour</span><span class='lbracket'>[</span><span class='int'>7</span><span class='rbracket'>]</span><span class='rparen'>)</span>
+</code></pre>
-<h3 id="ff-entities">FF::Entities</h3>
+<h3 id="accessing">Accessing</h3>
-<p><code>WARNING: POTENTIALLY OUT OF DATE</code></p>
+<p>Once components are created we can access them using their ID like so:</p>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@component1</span><span class='comma'>,</span> <span class='ivar'>@component2</span><span class='rparen'>)</span>
-<span class='ivar'>@entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span>
-<span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='comment'># =&gt; unique entity id
-</span>
-<span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='ivar'>@component</span>
-<span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='ivar'>@component</span>
-<span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span> <span class='comment'># =&gt; [:id, :scenes, :components]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span> <span class='ivar'>@entity_dump</span>
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span>
</code></pre>
-<h3 id="ff-components">FF::Components</h3>
-
-<p><code>WARNING: POTENTIALLY OUT OF DATE</code></p>
-
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Name</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>param1</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>param2:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>default</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>param1:</span> <span class='id identifier rubyid_value1'>value1</span><span class='rparen'>)</span>
-<span class='ivar'>@component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_get_by_entity'>get_by_entity</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span> <span class='comment'># gets array of components
-</span><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_set'>set</span><span class='lparen'>(</span><span class='label'>param2:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>not default</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
-<span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_param2'>param2</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>different not default</span><span class='tstring_end'>&#39;</span></span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_detach'>detach</span><span class='lparen'>(</span><span class='label'>entity_id:</span> <span class='id identifier rubyid_ent_id'>ent_id</span><span class='comma'>,</span> <span class='label'>component_id:</span> <span class='id identifier rubyid_cmp_id'>cmp_id</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_remove_entity'>remove_entity</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span> <span class='comment'># Removes entity from any components
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_delete_component'>delete_component</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span> <span class='comment'># deletes component and removes from all relevant entities
-</span><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span> <span class='comment'># returns hash of all variables!(and the id)
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span> <span class='ivar'>@component_dump</span>
-
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_added'>added</span> <span class='comment'># =&gt; returns values for sys to setup
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_removed'>removed</span> <span class='comment'># =&gt; returns values for sys to setup
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_is_set'>is_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>var</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'># =&gt; returns values for sys to setup
-</span></code></pre>
+<h3 id="get-id">Get ID</h3>
+
+<p>Entity ID&#39;s are generated starting from 0 and ascending, unless if there is a missing ID because of a deleted
+entity where a new entity will claim that ID. To get the ID of an Entity:</p>
-<h3 id="ff-systems">FF::Systems</h3>
-
-<pre class="code ruby"><code class="ruby">FF::Sys.new(name: &#39;Render&#39;, position: 5, frame: 1) do
- @component.each do
- # functionality
- end
-end
-
-# for all components belonging to a certain component manager
-FF::Sys::Render.trigger_when_added FF::Cmp::Health
-FF::Sys::Render.trigger_when_removed FF::Cmp::Health
-FF::Sys::Render.trigger_when_is_set(FF::Cmp::Health, &#39;var&#39;)
-FF::Sys::Render.clear_triggers FF::Cmp::Health # clears all triggers
-FF::Sys::Render.clear_triggers (FF::Cmp::Health, :added)
-FF::Sys::Render.clear_triggers (FF::Cmp::Health, :removed)
-FF::Sys::Render.clear_triggers (FF::Cmp::Health, :is_set, &#39;var&#39;)
-
-# for specific components
-FF::Sys::Render.trigger_when_added FF::Cmp::Health[3]
-FF::Sys::Render.trigger_when_removed FF::Cmp::Health[3]
-FF::Sys::Render.trigger_when_is_set(FF::Cmp::Health[3], &#39;var&#39;)
-FF::Sys::Render.clear_triggers FF::Cmp::Health[3] # clears all triggers
-FF::Sys::Render.clear_triggers (FF::Cmp::Health[3], :added)
-FF::Sys::Render.clear_triggers (FF::Cmp::Health[3], :removed)
-FF::Sys::Render.clear_triggers (FF::Cmp::Health[3], :is_set, &#39;var&#39;)
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
</code></pre>
-<h3 id="ff-scenes">FF::Scenes</h3>
+<h3 id="adding-and-removing-components">Adding and Removing Components</h3>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Scene1</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>position:</span> <span class='int'>1</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='ivar'>@entity</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Render</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span> <span class='comment'># =&gt; [id_1, id_7, etc]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_systems'>systems</span> <span class='comment'># =&gt; [:Render, :Damage, etc]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span> <span class='comment'># =&gt; [:name, :entities, :systems]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span> <span class='ivar'>@scene_dump</span>
+<p>We can still add or remove Components from an Entity after it has been created. Here is how:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='ivar'>@component</span>
+<span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='ivar'>@component</span>
</code></pre>
-<h3 id="ff-stage">FF::Stage</h3>
+<h3 id="deletion">Deletion</h3>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_scene'>scene</span> <span class='comment'># =&gt; [:Scene1, :Scene2, etc]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span> <span class='comment'># =&gt; [:Scene1, :Scene2, etc]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span> <span class='ivar'>@stage_dump</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
+<p>To have all Components from an Entity removed and the Entity deleted we do the following:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span>
</code></pre>
-<h3 id="felflame">FelFlame</h3>
+<h2 id="components">Components</h2>
+
+<h3 id="creating-a-component-manager">Creating a Component Manager</h3>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span> <span class='comment'># =&gt; all data
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span> <span class='ivar'>@felflame_dump</span>
+<p>Components are where all the data is stored. The data is stored in variables or accessors in each component.
+These accessors and their defaults are configured when a component manager is created, like so:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component_manager</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FelFlame/Components.html#new-class_method" title="FelFlame::Components.new (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Stats</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='symbol'>:armour</span><span class='comma'>,</span> <span class='label'>hp:</span> <span class='int'>100</span><span class='rparen'>)</span>
</code></pre>
-<hr>
+<p>In this example we created a component manager called &quot;Stats&quot;.
+The name given to component managers must follow the same rules for naming constants in ruby for a reason you will shortly see.
+The parameters following are all creating the attributes we can set.
+We can set any number of parameters we wish, in this example we define two.
+The <code>:armour</code> parameter is being created without a default, it will equal to <code>nil</code> when a new component is created, while <code>hp</code> will be equal to 100 when a component is created.
+When defining attributes symbols should be used.</p>
-<p><img src="https://filestorage.catgirls.rodeo/images/whitespace.png" alt="blank"><br>
-<img src="https://filestorage.catgirls.rodeo/images/whitespace.png" alt="blank"> </p>
+<h3 id="creating-a-component-from-a-component-manager">Creating a Component from a Component Manager</h3>
-<h2 id="part-617b2bfdd646b891"><img src="https://filestorage.catgirls.rodeo/images/whitespace.png" alt="blank"> </h2>
+<p>Now that we have a component manager we can make components from it like so:</p>
-<h1 id="ramblings">Ramblings:</h1>
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Stats</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
+</code></pre>
-<p>Was my originally written up specs. Rewrote it as what is written above to be more clear.
-The below are more verbose but not as helpful for me for implementation. Once the framework is
-complete I will use a more verbose explanation as below to help users of the framework.</p>
+<p>Or we can even change the defaults:</p>
-<hr>
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Stats</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>armour:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>steel</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
+</code></pre>
-<p>Creating Entities:</p>
+<h3 id="accessing-and-getting-id">Accessing and Getting ID</h3>
-<pre class="code ruby"><code class="ruby"><span class='comment'># Plain:
-</span><span class='ivar'>@my_entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='symbol'>:Ent</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
+<p>Just like Entities, Components have IDs.
+These IDs are only unique within the scope of their respective Component Managers.
+Here is how we can get the ID, as well as how to access a Component from its Component Manager.</p>
-<span class='comment'># With components:
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Position</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>var1:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>val</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>var3:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>change_default</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='comma'>,</span>
- <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>hp:</span> <span class='int'>20</span><span class='rparen'>)</span><span class='comma'>,</span>
- <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Poison</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>dps:</span> <span class='int'>3</span><span class='rparen'>)</span><span class='comma'>,</span>
- <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Poison</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>dps:</span> <span class='int'>2</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='comment'># This entity has 2 of the same component in it!
-</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Selection</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='comment'># Components can belong to multiple entities, this component already existed elsewhere!
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Stats</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span>
+<span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='comment'># =&gt; 2
</span></code></pre>
-<p>Adding and Removing Components from Entities:</p>
+<h3 id="accessing-attributes-and-changing-them">Accessing Attributes and Changing Them</h3>
+
+<p>There are a few different ways we can read or change the attributes of a component depending on what our needs are.
+Here are the ways to edit attrubutes, followed by the ways to read them.</p>
-<pre class="code ruby"><code class="ruby"><span class='ivar'>@my_entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span>
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_armour'>armour</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Mythril</span><span class='tstring_end'>&#39;</span></span>
+<span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_update_attrs'>update_attrs</span><span class='lparen'>(</span><span class='label'>armour:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Leather</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>hp:</span> <span class='int'>95</span><span class='rparen'>)</span>
+</code></pre>
-<span class='ivar'>@my_entity</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span>
-<span class='comment'># Remove the specific component with that id
-</span>
-<span class='ivar'>@my_entity</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Poison</span><span class='rparen'>)</span>
-<span class='comment'># Removes all components of that type
-</span>
-<span class='ivar'>@my_entity</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Selection</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='rparen'>)</span>
-<span class='comment'># Adds a new Component
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_hp'>hp</span> <span class='comment'># =&gt; 95
+</span><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_attrs'>attrs</span> <span class='comment'># =&gt; {armour: &#39;Leather&#39;, hp: 95}
</span></code></pre>
-<p>Creating Component Class:</p>
+<h3 id="deleting-components">Deleting Components</h3>
-<pre class="code ruby"><code class="ruby"><span class='comment'># Creating a component &#39;factory&#39;:
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Name</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>var1</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>var2</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>var3:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>default</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'># Name, *no_default, **with_default
-</span></code></pre>
+<p>Deleting a Component is the same format as deleting an Entity. When a Component is deleted referenced to it such as to entities are automatically cleared.</p>
-<p>And then using those components:</p>
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span>
+</code></pre>
-<pre class="code ruby"><code class="ruby"><span class='ivar'>@new_cmp</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>var1:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>oke</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'># var3 will be &#39;default&#39;, var2 will be nil
-</span><span class='ivar'>@new_cmp</span><span class='period'>.</span><span class='id identifier rubyid_var2'>var2</span> <span class='op'>=</span> <span class='int'>3</span> <span class='comment'># now var2 is set
-</span><span class='ivar'>@new_cmp</span><span class='period'>.</span><span class='id identifier rubyid_set'>set</span><span class='lparen'>(</span><span class='label'>var1:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>nope</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>var3:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>different</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'># var1 and var3 are now changed!
-</span><span class='ivar'>@new_cmp</span><span class='period'>.</span><span class='id identifier rubyid_to_hash'>to_hash</span> <span class='comment'># returns the hash of all variables!
-</span></code></pre>
+<h3 id="iterating-over-components">Iterating over Components</h3>
-<p>Referencing Components:</p>
+<p>When you make Systems you will want to be able to iterate over all Components of the same Component Manager(for example iterating over all sprites to render them). Here is how we do that:</p>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span> <span class='comment'># gets component by their unique id
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_get_by_entity'>get_by_entity</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span> <span class='comment'># gets component that is attached to the entitry
-</span><span class='comment'># will return array of components if there is multiple of same component
-</span><span class='comment'># if it returns array, see the `dump` section. Need to add custom method to the array
-</span></code></pre>
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Sprites</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span>
+ <span class='comment'>#do something with components
+</span><span class='kw'>end</span>
+</code></pre>
+
+<h2 id="systems">Systems</h2>
+
+<h3 id="creation">Creation</h3>
+
+<p>We can create Systems like so:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FelFlame/Systems.html#initialize-instance_method" title="FelFlame::Systems#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Render</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>priority:</span> <span class='int'>2</span><span class='rparen'>)</span> <span class='kw'>do</span>
+ <span class='comment'># Code and Logic
+</span><span class='kw'>end</span>
+</code></pre>
+
+<p>The name we assign is how we can access the System, like so:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>Render</span>
+</code></pre>
+
+<p>Priority determines the order Systems should be executed, this is used for <code>Scenes</code> and the <code>Stage</code>.
+The lower the number, the earlier a given System will be executed.
+E.g priority 1 will go first, priority 2 will go second, etcetera. </p>
-<p>Creating Systems:</p>
+<p>Often we will want to execute some logic on each Component in a given Component Manager so our code might look like this:</p>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Render</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>position:</span> <span class='int'>5</span><span class='comma'>,</span> <span class='label'>frame:</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='kw'>do</span>
-<span class='comment'># position is the order in which systems get executed, can be overlapping but then order is unexpected between same positions
-</span><span class='comment'># frame is on which frame the system will be called. 0 is never, 1 is on each frame, 2 is every other frame, etc
-</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Position</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span>
- <span class='comment'>#render your sprite
-</span> <span class='kw'>end</span>
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FelFlame/Systems.html#initialize-instance_method" title="FelFlame::Systems#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Render</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>priority:</span> <span class='int'>2</span><span class='rparen'>)</span> <span class='kw'>do</span>
+ <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Sprites</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span>
+ <span class='comment'># do something with these components
+</span> <span class='kw'>end</span>
<span class='kw'>end</span>
</code></pre>
-<p>Enabling Systems:</p>
+<h3 id="execution">Execution</h3>
-<pre class="code ruby"><code class="ruby"><span class='comment'># By default systems are not enabled. You need to add them to a scene
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Render</span>
+<p>After we create a System, it won&#39;t do anything on its own until we tell it to. Here is how:</p>
-<span class='comment'># They can also be disabled by removing them
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Render</span>
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>Render</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
</code></pre>
-<p>Custom Hooks:</p>
+<p>Sometimes you might want to manually activate a System, but the more common way to have Systems be triggered is to use Scenes and the Stage or the alternative ways of execution.</p>
+
+<h3 id="alternative-execution">Alternative Execution</h3>
+
+<p>Sometimes you want a System to automatically trigger when a special even happens. FelFlame can keep track of when a Component is added, removed, or when an attribute is changed and then execute Systems linked to these events. Here is how to create these links:</p>
-<pre class="code ruby"><code class="ruby"><span class='comment'># Systems can be configured to be called whenever a certain component is added, removed or set
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Damage</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when'>trigger_when</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_added'>added</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Revive</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when'>trigger_when</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_removed'>removed</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Healup</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when'>trigger_when</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_is_set'>is_set</span>
+<pre class="code ruby"><code class="ruby"><span class='comment'># When this Component is added to an Entity, this System will be called
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when_added'>trigger_when_added</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='rparen'>)</span>
-<span class='comment'># Systems can also be manually called so you can code custom hooks!
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Restore</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span>
+<span class='comment'># When this Component is removed from an Entity, this System will be called
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when_removed'>trigger_when_removed</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='rparen'>)</span>
+
+<span class='comment'># When this Component&#39;s health attribute is changed, this System will be called
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when_is_set'>trigger_when_is_set</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='comma'>,</span> <span class='symbol'>:health</span><span class='rparen'>)</span>
</code></pre>
-<p>Scenes contain Entities and Systems</p>
+<p>If we want these triggers to happen for all Components that belong to specific Component Manager then we can do that instead:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='comment'># When a Component from this Component Manager is added to an Entity, this System will be called
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when_added'>trigger_when_added</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='rparen'>)</span>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Scene1</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>position:</span> <span class='int'>1</span><span class='rparen'>)</span>
-<span class='comment'># Multiple scenes could be ran at once, if they do then they will run according
-</span><span class='comment'># to their positions as explained above
-</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Entity</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span>
-<span class='comment'># You can also just pass the id on its own =&gt; FF::Scn::Scene1.add entity_id
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Entity</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
+<span class='comment'># When a Component from this Component Manager is removed from an Entity, this System will be called
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when_removed'>trigger_when_removed</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Render</span>
+<span class='comment'># When this Component&#39;s health attribute from this Component Manager is changed, this System will be called
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when_is_set'>trigger_when_is_set</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='comma'>,</span> <span class='symbol'>:health</span><span class='rparen'>)</span>
</code></pre>
-<p>To List Systems and Enties</p>
+<p>We can create any number of these links between Systems, Components, and Component Manangers as we like, simply call the method again with our other Components and Component Managers</p>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_get_entities'>get_entities</span> <span class='comment'># =&gt; [id_1, id_7, etc]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_get_systems'>get_systems</span> <span class='comment'># =&gt; [:Render, :Damage, etc]
-</span></code></pre>
+<h3 id="clearing-alternative-executions">Clearing Alternative Executions</h3>
+
+<p>If we wish to remove these links that we created, we can do that using the follwing function in any of the following ways:</p>
-<p>To run a Scene it must be added to the Stage</p>
+<pre class="code ruby"><code class="ruby"><span class='comment'># clears ALL triggers with this system
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span>
+<span class='comment'># clears ALL triggers with this Component Manager
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='rparen'>)</span>
+
+<span class='comment'># clear the &#39;trigger_when_added&#39; for this Component
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='comma'>,</span> <span class='symbol'>:added</span><span class='rparen'>)</span>
+
+<span class='comment'># clear the &#39;trigger_when_removed&#39; for this Component
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='comma'>,</span> <span class='symbol'>:removed</span><span class='rparen'>)</span>
+
+<span class='comment'># clear the &#39;trigger_when_is_set&#39; for this Component specifically for the health attribute
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='comma'>,</span> <span class='symbol'>:is_set</span><span class='comma'>,</span> <span class='symbol'>:health</span><span class='rparen'>)</span>
</code></pre>
-<p>Or remove it:</p>
+<p>Likewise we can do the same with Component Managers:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='comment'># clears ALL triggers with this Component
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='rparen'>)</span>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span>
+<span class='comment'># clear the &#39;trigger_when_added&#39; for this Component Manager
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='comma'>,</span> <span class='symbol'>:added</span><span class='rparen'>)</span>
+
+<span class='comment'># clear the &#39;trigger_when_removed&#39; for this Component Manager
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='comma'>,</span> <span class='symbol'>:removed</span><span class='rparen'>)</span>
+
+<span class='comment'># clear the &#39;trigger_when_is_set&#39; for this Component Manager specifically for the health attribute
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='comma'>,</span> <span class='symbol'>:is_set</span><span class='comma'>,</span> <span class='symbol'>:health</span><span class='rparen'>)</span>
</code></pre>
-<p>Show all Scenes on the Stage:</p>
+<h3 id="redefinition">Redefinition</h3>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_scenes'>scenes</span> <span class='comment'># =&gt; [:Scene1, :Scene2, etc]
-</span></code></pre>
+<p>If we wanted to change what code or logic a given System executes, we could do that with:</p>
-<p>Remove all Scenes from the Stage:</p>
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_redefine'>redefine</span> <span class='kw'>do</span>
+ <span class='comment'># Some new logic or code
+</span><span class='kw'>end</span>
+</code></pre>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
+<h2 id="scenes">Scenes</h2>
+
+<h3 id="creation">Creation</h3>
+
+<p>Once we have all the core parts of ECS, we will want to organize our Systems. To do this we will use Scenes to group up Systems so they can quickly be enabled or disabled. Note that <a href="#alternative-execution">Alternative Executions</a> will occur even if they are not part of a Scene. Here is how we make a new Scene:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@scene</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FelFlame/Scenes.html#initialize-instance_method" title="FelFlame::Scenes#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>ExampleScene</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
</code></pre>
-<p>You can save the current game state:</p>
+<h3 id="accessing">Accessing</h3>
+
+<p>Just like other classes in FelFlame, the name we gave the Scene is how we access it:</p>
-<pre class="code ruby"><code class="ruby"><span class='ivar'>@json_save_data</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span>
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@scene</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='op'>::</span><span class='const'>ExampleScene</span>
</code></pre>
-<p>You can also specifically choose what you want to save:</p>
-
-<pre class="code ruby"><code class="ruby"><span class='ivar'>@hash_entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span>
-<span class='comment'># to save all components related to a player
-</span>
-<span class='ivar'>@hash_component_single</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span>
-<span class='comment'># save all data in the single component(needs to handle arrays of components)
-</span>
-<span class='ivar'>@hash_component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span>
-<span class='comment'># save all components of a certain component type
-</span>
-<span class='ivar'>@hash_components_all</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span>
-<span class='comment'># save all components
-</span>
-<span class='ivar'>@hash_scene</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span>
-<span class='comment'># save all entities, components, and activated systems in a given scene
-</span></code></pre>
+<h3 id="adding-systems">Adding Systems</h3>
-<p>And then they can be loaded back in:</p>
+<p>Adding Systems is simple. We can add as many as we want. In this example we add 3 different systems:</p>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='ivar'>@hash_entity</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='ivar'>@hash_component</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='ivar'>@hash_component</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='ivar'>@hash_components_all</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='ivar'>@Hash_scene</span><span class='rparen'>)</span>
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='op'>::</span><span class='const'>ExampleScene</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>Render</span><span class='comma'>,</span> <span class='ivar'>@system2</span><span class='comma'>,</span> <span class='ivar'>@system3</span><span class='rparen'>)</span>
</code></pre>
-<h3 id="to-do-list-old">To Do List(old)</h3>
+<h3 id="removing-systems">Removing Systems</h3>
-<hr>
+<p>Removing Systems works simularly:</p>
-<ul>
-<li>[ ] Some level of hierarchical support?</li>
-<li>[ ] One Component to many entities.</li>
-<li>[ ] Multiple of same component to one entity</li>
-<li>[ ] State Machine?</li>
-<li>[ ] Systems execute code on an event
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='op'>::</span><span class='const'>ExampleScene</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>Render</span><span class='comma'>,</span> <span class='ivar'>@system2</span><span class='comma'>,</span> <span class='ivar'>@system3</span><span class='rparen'>)</span>
+</code></pre>
-<ul>
-<li>[ ] Adding/removing/setting component is event</li>
-<li>[ ] Frame is an event</li>
-</ul></li>
-<li>[ ] System Execution Order</li>
-<li>[ ] Save Dump/Load</li>
-</ul>
+<h3 id="clearing">Clearing</h3>
+
+<p>If you want to remove all Systems from a Scene here is how we do it:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@scene</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
+</code></pre>
+
+<h3 id="execution">Execution</h3>
+
+<p>To execute all Systems within a scene once we can just do:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@scene</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
+</code></pre>
+
+<p>The Scene will make sure that the systems are executed in the correct order based on their given priorities</p>
+
+<h2 id="stage">Stage</h2>
+
+<h3 id="adding-scenes">Adding Scenes</h3>
+
+<p>Finally we have the Stage. There is only a single Stage and we do not have to create it as it exists by default. By adding a Scene to the Stage we are saying that the Scene is active. To add a Scene we do the following:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_add'><span class='object_link'><a href="FelFlame/Stage.html#add-class_method" title="FelFlame::Stage.add (method)">add</a></span></span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'>Scene</span><span class='op'>::</span><span class='const'>ExampleScene</span>
+</code></pre>
+
+<h3 id="removing-scenes">Removing Scenes</h3>
+
+<p>Likewise we can remove Scenes:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_remove'><span class='object_link'><a href="FelFlame/Stage.html#remove-class_method" title="FelFlame::Stage.remove (method)">remove</a></span></span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'>Scene</span><span class='op'>::</span><span class='const'>ExampleScene</span>
+</code></pre>
+
+<h3 id="executing">Executing</h3>
+
+<p>On each frame of the game we want to execute the Stage once. When the Stage is executed it is progressing your game 1 frame forward. The Stage will make sure for you that all the Systems from all Scenes added will be executed in the correct order according to their priority. Here is how we do it:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_call'><span class='object_link'><a href="FelFlame/Stage.html#call-class_method" title="FelFlame::Stage.call (method)">call</a></span></span>
+</code></pre>
+
+<h2 id="closing-notes">Closing Notes</h2>
+
+<p>There are some methods I haven&#39;t gone over in the overview. If you want to see everything and read in more detail check out the <a href="https://rubydoc.info/github/realtradam/FelFlame/master/frames">Documentation</a>!</p>
+
+<h1 id="contribution">Contribution</h1>
+
+<p>Contributors are welcome! I am always looking to impove the capabilities of game development in Ruby. Feel free to open an issue to discuss a proposed changed or fix. To code a change or fix first fork the project. Next write your changes or fixes. Make sure all your changes and fixes are properly documented using Yard(I will not merge if it is not 100% documented) and make sure everything has tests written for it with Rspec(I will also not merge if it does not have 100% test coverage). Once you have your changes made then simply make a pull request. </p>
+
+<p>If you need help writing documentation or tests feel free to ask! </p>
+
+<p>If you want to contribute to development with a thanks you can always <a href="https://ko-fi.com/tradam">buy me a coffee ;^)</a></p>
</div></div>
<div id="footer">
- Generated on Wed Jul 7 17:45:24 2021 by
+ Generated on Fri Jul 9 01:56:53 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.7.3).
</div>
diff --git a/docs/index.html b/docs/index.html
index 1f59c82..0e56dcd 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -62,318 +62,433 @@
<p><a href="https://codeclimate.com/github/realtradam/FelFlame/maintainability"><img src="https://api.codeclimate.com/v1/badges/56d425d9078e98efb74b/maintainability" alt="Maintainability"></a>
<a href="https://codeclimate.com/github/realtradam/FelFlame/test_coverage"><img src="https://api.codeclimate.com/v1/badges/56d425d9078e98efb74b/test_coverage" alt="Test Coverage"></a>
<a href="http://inch-ci.org/github/realtradam/FelFlame"><img src="http://inch-ci.org/github/realtradam/FelFlame.svg?branch=master" alt="Inline docs"></a>
-<a href="https://felflame.tradam.fyi"><img src="https://img.shields.io/badge/Documentation-Click%20Here-blue" alt="Documentation Coverage"></a></p>
+<a href="https://github.com/realtradam/FelFlame/blob/master/LICENSE"><img src="https://img.shields.io/github/license/realtradam/FelFlame?label=license&style=flat" alt="MIT License"></a>
+<a href="https://ko-fi.com/tradam"><img src="https://img.shields.io/static/v1?message=Buy%20me%20a%20coffee&logo=kofi&labelColor=ff5e5b&color=434B57&logoColor=white&label=%20" alt="Ko-Fi"></a></p>
-<h1 id="what-is-this">What is this?</h1>
+<!-- vim-markdown-toc GFM -->
-<p>This is a Ruby ECS Framework for developing games. It is still a work in progress in the early stages, is not fit for use, and does not work.
-It is designed to be platform agnostic, this means it should be able to work by plugging it into any ruby game engine/library/toolkit with minimal modifications. </p>
+<ul>
+<li><a href="#what-is-felflame">What is FelFlame?</a></li>
+<li><a href="#what-is-ecs">What is ECS?</a>
+ - <a href="#components">Components</a>
+ - <a href="#entities">Entities</a>
+ - <a href="#systems">Systems</a>
+ - <a href="#scenes">Scenes</a>
+ - <a href="#stage">Stage</a></li>
+<li><a href="#usage">Usage</a>
+
+<ul>
+<li><a href="#entities-1">Entities</a>
+
+<ul>
+<li><a href="#creation">Creation</a></li>
+<li><a href="#accessing">Accessing</a></li>
+<li><a href="#get-id">Get ID</a></li>
+<li><a href="#adding-and-removing-components">Adding and Removing Components</a></li>
+<li><a href="#deletion">Deletion</a></li>
+</ul></li>
+<li><a href="#components-1">Components</a>
+
+<ul>
+<li><a href="#creating-a-component-manager">Creating a Component Manager</a></li>
+<li><a href="#creating-a-component-from-a-component-manager">Creating a Component from a Component Manager</a></li>
+<li><a href="#accessing-and-getting-id">Accessing and Getting ID</a></li>
+<li><a href="#accessing-attributes-and-changing-them">Accessing Attributes and Changing Them</a></li>
+<li><a href="#deleting-components">Deleting Components</a></li>
+<li><a href="#iterating-over-components">Iterating over Components</a></li>
+</ul></li>
+<li><a href="#systems-1">Systems</a>
+
+<ul>
+<li><a href="#creation-1">Creation</a></li>
+<li><a href="#execution">Execution</a></li>
+<li><a href="#alternative-execution">Alternative Execution</a></li>
+<li><a href="#clearing-alternative-executions">Clearing Alternative Executions</a></li>
+<li><a href="#redefinition">Redefinition</a></li>
+</ul></li>
+<li><a href="#scenes-1">Scenes</a>
+
+<ul>
+<li><a href="#creation-2">Creation</a></li>
+<li><a href="#accessing-1">Accessing</a></li>
+<li><a href="#adding-systems">Adding Systems</a></li>
+<li><a href="#removing-systems">Removing Systems</a></li>
+<li><a href="#clearing">Clearing</a></li>
+<li><a href="#execution-1">Execution</a></li>
+</ul></li>
+<li><a href="#stage-1">Stage</a>
+
+<ul>
+<li><a href="#adding-scenes">Adding Scenes</a></li>
+<li><a href="#removing-scenes">Removing Scenes</a></li>
+<li><a href="#executing">Executing</a></li>
+</ul></li>
+<li><a href="#closing-notes">Closing Notes</a></li>
+</ul></li>
+<li><a href="#contribution">Contribution</a></li>
+</ul>
+
+<!-- vim-markdown-toc -->
+
+<h1 id="what-is-felflame">What is FelFlame?</h1>
+
+<p>FelFlame is an ECS framework for developing games in the Ruby language. FelFlame has been designed from the ground up with these three ideas in mind:</p>
+
+<ol>
+<li><strong>Engine Agnostic:</strong> FelFlame has been designed to be rendering engine agnostic as long as the target rendering engine is written in Ruby. This means that this framework can be dropped into existing rendering engines such as <a href="http://www.ruby2d.com">Ruby2D</a> or <a href="https://dragonruby.org/toolkit/game">DRGTK</a> with little modifications.</li>
+<li><strong>Easily Extensible:</strong> FelFlame has been designed such that extensions to its capabilities can be easily added. Extensions such as rendering engine wrappers, premade systems, premade components, etcetera can be easily coded and then distributed as gems.</li>
+<li><strong>Priciple of (My) Least Astonishment:</strong> I want to develop games using a language and framework I love and makes sense to me, inspired by the <a href="https://en.wikipedia.org/wiki/Ruby_(programming_language)#Philosophy">Philosophy of the creator of Ruby</a>.</li>
+</ol>
-<p>I wanted a reusable framework so I could quickly and effectively develop games. I also want it to be more complete, as opposed to barebones or boilerplate.
-I plan to eventually add functionality outside of just ECS such as loading tilesets, a camera system, etc. that are built into the framework to work seamlessly.</p>
+<h1 id="what-is-ecs">What is ECS?</h1>
-<h1 id="what-is-currently-implemented">What is currently implemented?</h1>
+<p>ECS is a software architectural pattern that is used in video game development. Traditionally games were programmed using an object oriented method, while ECS instead attempts to program games using a data oriented method instead.<br>
+ECS stands for Entity, Component, and System.</p>
-<p>Entities and Components are mostly implemented, with only a few non-critical functions missing.</p>
+<hr>
+
+<h3 id="components">Components</h3>
+
+<p>This is where the data or information of a given &quot;object&quot; is stored. There is no logic or code here. </p>
+
+<h3 id="entities">Entities</h3>
-<p>Systems, Scenes, and the Stage still needs to be implemented</p>
+<p>Entities will contain one or more Components, but contains no logic or data otherwise</p>
-<p>You can view the <a href="https://felflame.tradam.fyi">Documentation here</a></p>
+<h3 id="systems">Systems</h3>
-<h1 id="specification">Specification</h1>
+<p>Systems are where all the logic or code is kept. There is no data stored in here.</p>
-<p>Below are the specifications I have imagined for this framework and have been written out. They are subject to change as FelFlame is developed and used.</p>
+<hr>
+
+<p>By using this pattern it allows programmers to easily control what an &quot;object&quot; or entity can do and how much data it needs to have. It avoids the issue of inhertance as no inhertance is ever required in this system. If you need a certain entity to have a certain functionality you just add the relevant component to it, and the systems that automatically go over specific components will give your entitiy the desired functionality. </p>
-<h2 id="aliases">Aliases:</h2>
+<p><strong>&quot;But your framework also has <code>Scenes</code> and a <code>Stage</code>, what is that about?&quot;</strong> </p>
+
+<hr>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sce</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span>
+<h3 id="scenes">Scenes</h3>
+
+<p>Scenes are simply a collection or subset of Systems. This allows for an easy way to activate and deactivate Systems.</p>
+
+<h3 id="stage">Stage</h3>
+
+<p>The Stage is Scenes which are activated. This means any Scenes on the Stage are executed each frame, while the rest of the Systems are not.</p>
+
+<hr>
+
+<p>If all of this sounds very confusing, don&#39;t worry. A video tutorial series is in the works where I will build a game using this framework and explain every step of the way. You can also read some examples and explanations below.</p>
+
+<h1 id="usage">Usage</h1>
+
+<h2 id="entities">Entities</h2>
+
+<h3 id="creation">Creation</h3>
+
+<p>Entities are essentially &quot;objects&quot; in the game world. To create a new Entity we do the following:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FelFlame/Entities.html#initialize-instance_method" title="FelFlame::Entities#initialize (method)">new</a></span></span>
</code></pre>
-<h2 id="classes">Classes:</h2>
+<p>or if we want to add (any number of)components to it:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'>Entites</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='comma'>,</span>
+ <span class='ivar'>@component</span><span class='comma'>,</span>
+ <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Armour</span><span class='lbracket'>[</span><span class='int'>7</span><span class='rbracket'>]</span><span class='rparen'>)</span>
+</code></pre>
-<h3 id="ff-entities">FF::Entities</h3>
+<h3 id="accessing">Accessing</h3>
-<p><code>WARNING: POTENTIALLY OUT OF DATE</code></p>
+<p>Once components are created we can access them using their ID like so:</p>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@component1</span><span class='comma'>,</span> <span class='ivar'>@component2</span><span class='rparen'>)</span>
-<span class='ivar'>@entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span>
-<span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='comment'># =&gt; unique entity id
-</span>
-<span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='ivar'>@component</span>
-<span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='ivar'>@component</span>
-<span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span> <span class='comment'># =&gt; [:id, :scenes, :components]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span> <span class='ivar'>@entity_dump</span>
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span>
</code></pre>
-<h3 id="ff-components">FF::Components</h3>
-
-<p><code>WARNING: POTENTIALLY OUT OF DATE</code></p>
-
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Name</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>param1</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>param2:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>default</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>param1:</span> <span class='id identifier rubyid_value1'>value1</span><span class='rparen'>)</span>
-<span class='ivar'>@component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_get_by_entity'>get_by_entity</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span> <span class='comment'># gets array of components
-</span><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_set'>set</span><span class='lparen'>(</span><span class='label'>param2:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>not default</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
-<span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_param2'>param2</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>different not default</span><span class='tstring_end'>&#39;</span></span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_detach'>detach</span><span class='lparen'>(</span><span class='label'>entity_id:</span> <span class='id identifier rubyid_ent_id'>ent_id</span><span class='comma'>,</span> <span class='label'>component_id:</span> <span class='id identifier rubyid_cmp_id'>cmp_id</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_remove_entity'>remove_entity</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span> <span class='comment'># Removes entity from any components
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_delete_component'>delete_component</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span> <span class='comment'># deletes component and removes from all relevant entities
-</span><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span> <span class='comment'># returns hash of all variables!(and the id)
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span> <span class='ivar'>@component_dump</span>
-
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_added'>added</span> <span class='comment'># =&gt; returns values for sys to setup
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_removed'>removed</span> <span class='comment'># =&gt; returns values for sys to setup
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_is_set'>is_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>var</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'># =&gt; returns values for sys to setup
-</span></code></pre>
+<h3 id="get-id">Get ID</h3>
+
+<p>Entity ID&#39;s are generated starting from 0 and ascending, unless if there is a missing ID because of a deleted
+entity where a new entity will claim that ID. To get the ID of an Entity:</p>
-<h3 id="ff-systems">FF::Systems</h3>
-
-<pre class="code ruby"><code class="ruby">FF::Sys.new(name: &#39;Render&#39;, position: 5, frame: 1) do
- @component.each do
- # functionality
- end
-end
-
-# for all components belonging to a certain component manager
-FF::Sys::Render.trigger_when_added FF::Cmp::Health
-FF::Sys::Render.trigger_when_removed FF::Cmp::Health
-FF::Sys::Render.trigger_when_is_set(FF::Cmp::Health, &#39;var&#39;)
-FF::Sys::Render.clear_triggers FF::Cmp::Health # clears all triggers
-FF::Sys::Render.clear_triggers (FF::Cmp::Health, :added)
-FF::Sys::Render.clear_triggers (FF::Cmp::Health, :removed)
-FF::Sys::Render.clear_triggers (FF::Cmp::Health, :is_set, &#39;var&#39;)
-
-# for specific components
-FF::Sys::Render.trigger_when_added FF::Cmp::Health[3]
-FF::Sys::Render.trigger_when_removed FF::Cmp::Health[3]
-FF::Sys::Render.trigger_when_is_set(FF::Cmp::Health[3], &#39;var&#39;)
-FF::Sys::Render.clear_triggers FF::Cmp::Health[3] # clears all triggers
-FF::Sys::Render.clear_triggers (FF::Cmp::Health[3], :added)
-FF::Sys::Render.clear_triggers (FF::Cmp::Health[3], :removed)
-FF::Sys::Render.clear_triggers (FF::Cmp::Health[3], :is_set, &#39;var&#39;)
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span>
</code></pre>
-<h3 id="ff-scenes">FF::Scenes</h3>
+<h3 id="adding-and-removing-components">Adding and Removing Components</h3>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Scene1</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>position:</span> <span class='int'>1</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='ivar'>@entity</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Render</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_entities'>entities</span> <span class='comment'># =&gt; [id_1, id_7, etc]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_systems'>systems</span> <span class='comment'># =&gt; [:Render, :Damage, etc]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span> <span class='comment'># =&gt; [:name, :entities, :systems]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span> <span class='ivar'>@scene_dump</span>
+<p>We can still add or remove Components from an Entity after it has been created. Here is how:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='ivar'>@component</span>
+<span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='ivar'>@component</span>
</code></pre>
-<h3 id="ff-stage">FF::Stage</h3>
+<h3 id="deletion">Deletion</h3>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_scene'>scene</span> <span class='comment'># =&gt; [:Scene1, :Scene2, etc]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span> <span class='comment'># =&gt; [:Scene1, :Scene2, etc]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span> <span class='ivar'>@stage_dump</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
+<p>To have all Components from an Entity removed and the Entity deleted we do the following:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@entity</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span>
</code></pre>
-<h3 id="felflame">FelFlame</h3>
+<h2 id="components">Components</h2>
+
+<h3 id="creating-a-component-manager">Creating a Component Manager</h3>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span> <span class='comment'># =&gt; all data
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span> <span class='ivar'>@felflame_dump</span>
+<p>Components are where all the data is stored. The data is stored in variables or accessors in each component.
+These accessors and their defaults are configured when a component manager is created, like so:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component_manager</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FelFlame/Components.html#new-class_method" title="FelFlame::Components.new (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Stats</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='symbol'>:armour</span><span class='comma'>,</span> <span class='label'>hp:</span> <span class='int'>100</span><span class='rparen'>)</span>
</code></pre>
-<hr>
+<p>In this example we created a component manager called &quot;Stats&quot;.
+The name given to component managers must follow the same rules for naming constants in ruby for a reason you will shortly see.
+The parameters following are all creating the attributes we can set.
+We can set any number of parameters we wish, in this example we define two.
+The <code>:armour</code> parameter is being created without a default, it will equal to <code>nil</code> when a new component is created, while <code>hp</code> will be equal to 100 when a component is created.
+When defining attributes symbols should be used.</p>
-<p><img src="https://filestorage.catgirls.rodeo/images/whitespace.png" alt="blank"><br>
-<img src="https://filestorage.catgirls.rodeo/images/whitespace.png" alt="blank"> </p>
+<h3 id="creating-a-component-from-a-component-manager">Creating a Component from a Component Manager</h3>
-<h2 id="part-617b2bfdd646b891"><img src="https://filestorage.catgirls.rodeo/images/whitespace.png" alt="blank"> </h2>
+<p>Now that we have a component manager we can make components from it like so:</p>
-<h1 id="ramblings">Ramblings:</h1>
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Stats</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
+</code></pre>
-<p>Was my originally written up specs. Rewrote it as what is written above to be more clear.
-The below are more verbose but not as helpful for me for implementation. Once the framework is
-complete I will use a more verbose explanation as below to help users of the framework.</p>
+<p>Or we can even change the defaults:</p>
-<hr>
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Stats</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>armour:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>steel</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
+</code></pre>
-<p>Creating Entities:</p>
+<h3 id="accessing-and-getting-id">Accessing and Getting ID</h3>
-<pre class="code ruby"><code class="ruby"><span class='comment'># Plain:
-</span><span class='ivar'>@my_entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='symbol'>:Ent</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
+<p>Just like Entities, Components have IDs.
+These IDs are only unique within the scope of their respective Component Managers.
+Here is how we can get the ID, as well as how to access a Component from its Component Manager.</p>
-<span class='comment'># With components:
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Position</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>var1:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>val</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>var3:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>change_default</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='comma'>,</span>
- <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>hp:</span> <span class='int'>20</span><span class='rparen'>)</span><span class='comma'>,</span>
- <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Poison</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>dps:</span> <span class='int'>3</span><span class='rparen'>)</span><span class='comma'>,</span>
- <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Poison</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>dps:</span> <span class='int'>2</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='comment'># This entity has 2 of the same component in it!
-</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Selection</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='comment'># Components can belong to multiple entities, this component already existed elsewhere!
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Stats</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span>
+<span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_id'>id</span> <span class='comment'># =&gt; 2
</span></code></pre>
-<p>Adding and Removing Components from Entities:</p>
+<h3 id="accessing-attributes-and-changing-them">Accessing Attributes and Changing Them</h3>
+
+<p>There are a few different ways we can read or change the attributes of a component depending on what our needs are.
+Here are the ways to edit attrubutes, followed by the ways to read them.</p>
-<pre class="code ruby"><code class="ruby"><span class='ivar'>@my_entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span>
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_armour'>armour</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Mythril</span><span class='tstring_end'>&#39;</span></span>
+<span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_update_attrs'>update_attrs</span><span class='lparen'>(</span><span class='label'>armour:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Leather</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>hp:</span> <span class='int'>95</span><span class='rparen'>)</span>
+</code></pre>
-<span class='ivar'>@my_entity</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span>
-<span class='comment'># Remove the specific component with that id
-</span>
-<span class='ivar'>@my_entity</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Poison</span><span class='rparen'>)</span>
-<span class='comment'># Removes all components of that type
-</span>
-<span class='ivar'>@my_entity</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Selection</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='rparen'>)</span>
-<span class='comment'># Adds a new Component
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_hp'>hp</span> <span class='comment'># =&gt; 95
+</span><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_attrs'>attrs</span> <span class='comment'># =&gt; {armour: &#39;Leather&#39;, hp: 95}
</span></code></pre>
-<p>Creating Component Class:</p>
+<h3 id="deleting-components">Deleting Components</h3>
-<pre class="code ruby"><code class="ruby"><span class='comment'># Creating a component &#39;factory&#39;:
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Name</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>var1</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>var2</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>var3:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>default</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'># Name, *no_default, **with_default
-</span></code></pre>
+<p>Deleting a Component is the same format as deleting an Entity. When a Component is deleted referenced to it such as to entities are automatically cleared.</p>
-<p>And then using those components:</p>
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@component</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span>
+</code></pre>
-<pre class="code ruby"><code class="ruby"><span class='ivar'>@new_cmp</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>var1:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>oke</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'># var3 will be &#39;default&#39;, var2 will be nil
-</span><span class='ivar'>@new_cmp</span><span class='period'>.</span><span class='id identifier rubyid_var2'>var2</span> <span class='op'>=</span> <span class='int'>3</span> <span class='comment'># now var2 is set
-</span><span class='ivar'>@new_cmp</span><span class='period'>.</span><span class='id identifier rubyid_set'>set</span><span class='lparen'>(</span><span class='label'>var1:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>nope</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>var3:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>different</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'># var1 and var3 are now changed!
-</span><span class='ivar'>@new_cmp</span><span class='period'>.</span><span class='id identifier rubyid_to_hash'>to_hash</span> <span class='comment'># returns the hash of all variables!
-</span></code></pre>
+<h3 id="iterating-over-components">Iterating over Components</h3>
-<p>Referencing Components:</p>
+<p>When you make Systems you will want to be able to iterate over all Components of the same Component Manager(for example iterating over all sprites to render them). Here is how we do that:</p>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span> <span class='comment'># gets component by their unique id
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_get_by_entity'>get_by_entity</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span> <span class='comment'># gets component that is attached to the entitry
-</span><span class='comment'># will return array of components if there is multiple of same component
-</span><span class='comment'># if it returns array, see the `dump` section. Need to add custom method to the array
-</span></code></pre>
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Sprites</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span>
+ <span class='comment'>#do something with components
+</span><span class='kw'>end</span>
+</code></pre>
+
+<h2 id="systems">Systems</h2>
+
+<h3 id="creation">Creation</h3>
+
+<p>We can create Systems like so:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FelFlame/Systems.html#initialize-instance_method" title="FelFlame::Systems#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Render</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>priority:</span> <span class='int'>2</span><span class='rparen'>)</span> <span class='kw'>do</span>
+ <span class='comment'># Code and Logic
+</span><span class='kw'>end</span>
+</code></pre>
+
+<p>The name we assign is how we can access the System, like so:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>Render</span>
+</code></pre>
+
+<p>Priority determines the order Systems should be executed, this is used for <code>Scenes</code> and the <code>Stage</code>.
+The lower the number, the earlier a given System will be executed.
+E.g priority 1 will go first, priority 2 will go second, etcetera. </p>
-<p>Creating Systems:</p>
+<p>Often we will want to execute some logic on each Component in a given Component Manager so our code might look like this:</p>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Render</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>position:</span> <span class='int'>5</span><span class='comma'>,</span> <span class='label'>frame:</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='kw'>do</span>
-<span class='comment'># position is the order in which systems get executed, can be overlapping but then order is unexpected between same positions
-</span><span class='comment'># frame is on which frame the system will be called. 0 is never, 1 is on each frame, 2 is every other frame, etc
-</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Position</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span>
- <span class='comment'>#render your sprite
-</span> <span class='kw'>end</span>
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FelFlame/Systems.html#initialize-instance_method" title="FelFlame::Systems#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Render</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>priority:</span> <span class='int'>2</span><span class='rparen'>)</span> <span class='kw'>do</span>
+ <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Sprites</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_component'>component</span><span class='op'>|</span>
+ <span class='comment'># do something with these components
+</span> <span class='kw'>end</span>
<span class='kw'>end</span>
</code></pre>
-<p>Enabling Systems:</p>
+<h3 id="execution">Execution</h3>
-<pre class="code ruby"><code class="ruby"><span class='comment'># By default systems are not enabled. You need to add them to a scene
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Render</span>
+<p>After we create a System, it won&#39;t do anything on its own until we tell it to. Here is how:</p>
-<span class='comment'># They can also be disabled by removing them
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Render</span>
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>Render</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
</code></pre>
-<p>Custom Hooks:</p>
+<p>Sometimes you might want to manually activate a System, but the more common way to have Systems be triggered is to use Scenes and the Stage or the alternative ways of execution.</p>
+
+<h3 id="alternative-execution">Alternative Execution</h3>
+
+<p>Sometimes you want a System to automatically trigger when a special even happens. FelFlame can keep track of when a Component is added, removed, or when an attribute is changed and then execute Systems linked to these events. Here is how to create these links:</p>
-<pre class="code ruby"><code class="ruby"><span class='comment'># Systems can be configured to be called whenever a certain component is added, removed or set
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Damage</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when'>trigger_when</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_added'>added</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Revive</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when'>trigger_when</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_removed'>removed</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Healup</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when'>trigger_when</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_is_set'>is_set</span>
+<pre class="code ruby"><code class="ruby"><span class='comment'># When this Component is added to an Entity, this System will be called
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when_added'>trigger_when_added</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='rparen'>)</span>
-<span class='comment'># Systems can also be manually called so you can code custom hooks!
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Restore</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span>
+<span class='comment'># When this Component is removed from an Entity, this System will be called
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when_removed'>trigger_when_removed</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='rparen'>)</span>
+
+<span class='comment'># When this Component&#39;s health attribute is changed, this System will be called
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when_is_set'>trigger_when_is_set</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='comma'>,</span> <span class='symbol'>:health</span><span class='rparen'>)</span>
</code></pre>
-<p>Scenes contain Entities and Systems</p>
+<p>If we want these triggers to happen for all Components that belong to specific Component Manager then we can do that instead:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='comment'># When a Component from this Component Manager is added to an Entity, this System will be called
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when_added'>trigger_when_added</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='rparen'>)</span>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>name:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Scene1</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>position:</span> <span class='int'>1</span><span class='rparen'>)</span>
-<span class='comment'># Multiple scenes could be ran at once, if they do then they will run according
-</span><span class='comment'># to their positions as explained above
-</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Entity</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span>
-<span class='comment'># You can also just pass the id on its own =&gt; FF::Scn::Scene1.add entity_id
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Entity</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
+<span class='comment'># When a Component from this Component Manager is removed from an Entity, this System will be called
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when_removed'>trigger_when_removed</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Sys</span><span class='op'>::</span><span class='const'>Render</span>
+<span class='comment'># When this Component&#39;s health attribute from this Component Manager is changed, this System will be called
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_trigger_when_is_set'>trigger_when_is_set</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='comma'>,</span> <span class='symbol'>:health</span><span class='rparen'>)</span>
</code></pre>
-<p>To List Systems and Enties</p>
+<p>We can create any number of these links between Systems, Components, and Component Manangers as we like, simply call the method again with our other Components and Component Managers</p>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_get_entities'>get_entities</span> <span class='comment'># =&gt; [id_1, id_7, etc]
-</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_get_systems'>get_systems</span> <span class='comment'># =&gt; [:Render, :Damage, etc]
-</span></code></pre>
+<h3 id="clearing-alternative-executions">Clearing Alternative Executions</h3>
+
+<p>If we wish to remove these links that we created, we can do that using the follwing function in any of the following ways:</p>
-<p>To run a Scene it must be added to the Stage</p>
+<pre class="code ruby"><code class="ruby"><span class='comment'># clears ALL triggers with this system
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span>
+<span class='comment'># clears ALL triggers with this Component Manager
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='rparen'>)</span>
+
+<span class='comment'># clear the &#39;trigger_when_added&#39; for this Component
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='comma'>,</span> <span class='symbol'>:added</span><span class='rparen'>)</span>
+
+<span class='comment'># clear the &#39;trigger_when_removed&#39; for this Component
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='comma'>,</span> <span class='symbol'>:removed</span><span class='rparen'>)</span>
+
+<span class='comment'># clear the &#39;trigger_when_is_set&#39; for this Component specifically for the health attribute
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component</span><span class='comma'>,</span> <span class='symbol'>:is_set</span><span class='comma'>,</span> <span class='symbol'>:health</span><span class='rparen'>)</span>
</code></pre>
-<p>Or remove it:</p>
+<p>Likewise we can do the same with Component Managers:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='comment'># clears ALL triggers with this Component
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='rparen'>)</span>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span>
+<span class='comment'># clear the &#39;trigger_when_added&#39; for this Component Manager
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='comma'>,</span> <span class='symbol'>:added</span><span class='rparen'>)</span>
+
+<span class='comment'># clear the &#39;trigger_when_removed&#39; for this Component Manager
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='comma'>,</span> <span class='symbol'>:removed</span><span class='rparen'>)</span>
+
+<span class='comment'># clear the &#39;trigger_when_is_set&#39; for this Component Manager specifically for the health attribute
+</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span><span class='lparen'>(</span><span class='ivar'>@component_manager</span><span class='comma'>,</span> <span class='symbol'>:is_set</span><span class='comma'>,</span> <span class='symbol'>:health</span><span class='rparen'>)</span>
</code></pre>
-<p>Show all Scenes on the Stage:</p>
+<h3 id="redefinition">Redefinition</h3>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_scenes'>scenes</span> <span class='comment'># =&gt; [:Scene1, :Scene2, etc]
-</span></code></pre>
+<p>If we wanted to change what code or logic a given System executes, we could do that with:</p>
-<p>Remove all Scenes from the Stage:</p>
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>PassiveRegen</span><span class='period'>.</span><span class='id identifier rubyid_redefine'>redefine</span> <span class='kw'>do</span>
+ <span class='comment'># Some new logic or code
+</span><span class='kw'>end</span>
+</code></pre>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Stg</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
+<h2 id="scenes">Scenes</h2>
+
+<h3 id="creation">Creation</h3>
+
+<p>Once we have all the core parts of ECS, we will want to organize our Systems. To do this we will use Scenes to group up Systems so they can quickly be enabled or disabled. Note that <a href="#alternative-execution">Alternative Executions</a> will occur even if they are not part of a Scene. Here is how we make a new Scene:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@scene</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="FelFlame/Scenes.html#initialize-instance_method" title="FelFlame::Scenes#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>ExampleScene</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
</code></pre>
-<p>You can save the current game state:</p>
+<h3 id="accessing">Accessing</h3>
+
+<p>Just like other classes in FelFlame, the name we gave the Scene is how we access it:</p>
-<pre class="code ruby"><code class="ruby"><span class='ivar'>@json_save_data</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span>
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@scene</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='op'>::</span><span class='const'>ExampleScene</span>
</code></pre>
-<p>You can also specifically choose what you want to save:</p>
-
-<pre class="code ruby"><code class="ruby"><span class='ivar'>@hash_entity</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span>
-<span class='comment'># to save all components related to a player
-</span>
-<span class='ivar'>@hash_component_single</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span>
-<span class='comment'># save all data in the single component(needs to handle arrays of components)
-</span>
-<span class='ivar'>@hash_component</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span>
-<span class='comment'># save all components of a certain component type
-</span>
-<span class='ivar'>@hash_components_all</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span>
-<span class='comment'># save all components
-</span>
-<span class='ivar'>@hash_scene</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='op'>::</span><span class='const'>Scene1</span><span class='period'>.</span><span class='id identifier rubyid_dump'>dump</span>
-<span class='comment'># save all entities, components, and activated systems in a given scene
-</span></code></pre>
+<h3 id="adding-systems">Adding Systems</h3>
-<p>And then they can be loaded back in:</p>
+<p>Adding Systems is simple. We can add as many as we want. In this example we add 3 different systems:</p>
-<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Ent</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='ivar'>@hash_entity</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='op'>::</span><span class='const'>Health</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='ivar'>@hash_component</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='ivar'>@hash_component</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Cmp</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='ivar'>@hash_components_all</span><span class='rparen'>)</span>
-<span class='const'><span class='object_link'><a href="top-level-namespace.html#FF-constant" title="FF (constant)">FF</a></span></span><span class='op'>::</span><span class='const'>Scn</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='ivar'>@Hash_scene</span><span class='rparen'>)</span>
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='op'>::</span><span class='const'>ExampleScene</span><span class='period'>.</span><span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>Render</span><span class='comma'>,</span> <span class='ivar'>@system2</span><span class='comma'>,</span> <span class='ivar'>@system3</span><span class='rparen'>)</span>
</code></pre>
-<h3 id="to-do-list-old">To Do List(old)</h3>
+<h3 id="removing-systems">Removing Systems</h3>
-<hr>
+<p>Removing Systems works simularly:</p>
-<ul>
-<li>[ ] Some level of hierarchical support?</li>
-<li>[ ] One Component to many entities.</li>
-<li>[ ] Multiple of same component to one entity</li>
-<li>[ ] State Machine?</li>
-<li>[ ] Systems execute code on an event
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span><span class='op'>::</span><span class='const'>ExampleScene</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span><span class='op'>::</span><span class='const'>Render</span><span class='comma'>,</span> <span class='ivar'>@system2</span><span class='comma'>,</span> <span class='ivar'>@system3</span><span class='rparen'>)</span>
+</code></pre>
-<ul>
-<li>[ ] Adding/removing/setting component is event</li>
-<li>[ ] Frame is an event</li>
-</ul></li>
-<li>[ ] System Execution Order</li>
-<li>[ ] Save Dump/Load</li>
-</ul>
+<h3 id="clearing">Clearing</h3>
+
+<p>If you want to remove all Systems from a Scene here is how we do it:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@scene</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
+</code></pre>
+
+<h3 id="execution">Execution</h3>
+
+<p>To execute all Systems within a scene once we can just do:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='ivar'>@scene</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
+</code></pre>
+
+<p>The Scene will make sure that the systems are executed in the correct order based on their given priorities</p>
+
+<h2 id="stage">Stage</h2>
+
+<h3 id="adding-scenes">Adding Scenes</h3>
+
+<p>Finally we have the Stage. There is only a single Stage and we do not have to create it as it exists by default. By adding a Scene to the Stage we are saying that the Scene is active. To add a Scene we do the following:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_add'><span class='object_link'><a href="FelFlame/Stage.html#add-class_method" title="FelFlame::Stage.add (method)">add</a></span></span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'>Scene</span><span class='op'>::</span><span class='const'>ExampleScene</span>
+</code></pre>
+
+<h3 id="removing-scenes">Removing Scenes</h3>
+
+<p>Likewise we can remove Scenes:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_remove'><span class='object_link'><a href="FelFlame/Stage.html#remove-class_method" title="FelFlame::Stage.remove (method)">remove</a></span></span> <span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'>Scene</span><span class='op'>::</span><span class='const'>ExampleScene</span>
+</code></pre>
+
+<h3 id="executing">Executing</h3>
+
+<p>On each frame of the game we want to execute the Stage once. When the Stage is executed it is progressing your game 1 frame forward. The Stage will make sure for you that all the Systems from all Scenes added will be executed in the correct order according to their priority. Here is how we do it:</p>
+
+<pre class="code ruby"><code class="ruby"><span class='const'><span class='object_link'><a href="FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_call'><span class='object_link'><a href="FelFlame/Stage.html#call-class_method" title="FelFlame::Stage.call (method)">call</a></span></span>
+</code></pre>
+
+<h2 id="closing-notes">Closing Notes</h2>
+
+<p>There are some methods I haven&#39;t gone over in the overview. If you want to see everything and read in more detail check out the <a href="https://rubydoc.info/github/realtradam/FelFlame/master/frames">Documentation</a>!</p>
+
+<h1 id="contribution">Contribution</h1>
+
+<p>Contributors are welcome! I am always looking to impove the capabilities of game development in Ruby. Feel free to open an issue to discuss a proposed changed or fix. To code a change or fix first fork the project. Next write your changes or fixes. Make sure all your changes and fixes are properly documented using Yard(I will not merge if it is not 100% documented) and make sure everything has tests written for it with Rspec(I will also not merge if it does not have 100% test coverage). Once you have your changes made then simply make a pull request. </p>
+
+<p>If you need help writing documentation or tests feel free to ask! </p>
+
+<p>If you want to contribute to development with a thanks you can always <a href="https://ko-fi.com/tradam">buy me a coffee ;^)</a></p>
</div></div>
<div id="footer">
- Generated on Wed Jul 7 17:45:24 2021 by
+ Generated on Fri Jul 9 01:56:53 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.7.3).
</div>
diff --git a/docs/top-level-namespace.html b/docs/top-level-namespace.html
index aeb94c7..3443369 100644
--- a/docs/top-level-namespace.html
+++ b/docs/top-level-namespace.html
@@ -127,7 +127,7 @@
</div>
<div id="footer">
- Generated on Wed Jul 7 17:45:24 2021 by
+ Generated on Fri Jul 9 01:56:53 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.7.3).
</div>