From d03ce21592062aed27a571fda60483fcb3fba764 Mon Sep 17 00:00:00 2001 From: realtradam Date: Thu, 30 Dec 2021 07:28:14 -0500 Subject: . --- docs/FelFlame/ComponentManager.html | 170 +++++++++++++++++++++++++++--------- 1 file changed, 129 insertions(+), 41 deletions(-) (limited to 'docs/FelFlame/ComponentManager.html') diff --git a/docs/FelFlame/ComponentManager.html b/docs/FelFlame/ComponentManager.html index 7e92b7b..599b547 100644 --- a/docs/FelFlame/ComponentManager.html +++ b/docs/FelFlame/ComponentManager.html @@ -360,7 +360,7 @@
  • - #entities ⇒ Array<Integer> + #entities ⇒ Array<Component> @@ -378,6 +378,30 @@

    Entities that have this component.

    +
  • + + +
  • + + + #entity ⇒ Component + + + + + + + + + + + + + +
    +

    A single entity.

    +
    +
  • @@ -941,18 +965,18 @@
     
     
    -202
    -203
    -204
    -205
    -206
    -207
    -208
    -209
    -210
    +213 +214 +215 +216 +217 +218 +219 +220 +221 -
    # File 'lib/felflame/component_manager.rb', line 202
    +      
    # File 'lib/felflame/component_manager.rb', line 213
     
     def attr_changed_trigger_systems(attr)
       systems_to_execute = self.class.attr_triggers[attr]
    @@ -1012,22 +1036,22 @@
           
     
     
    -213
    -214
    -215
    -216
    -217
    -218
    -219
    -220
    -221
    -222
    -223
     224
    -225
    +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236
    -
    # File 'lib/felflame/component_manager.rb', line 213
    +      
    # File 'lib/felflame/component_manager.rb', line 224
     
     def delete
       addition_triggers.each do |system|
    @@ -1050,7 +1074,7 @@
           

    - #entitiesArray<Integer> + #entitiesArray<Component> @@ -1072,7 +1096,7 @@
  • - (Array<Integer>) + (Array<Component>) @@ -1099,6 +1123,70 @@ +
  • + +
    +

    + + #entityComponent + + + + + +

    +
    + +

    A single entity. Use this if you expect the component to only belong to one entity and you want to access it.

    + + +
    +
    +
    + +

    Returns:

    +
      + +
    • + + + (Component) + + + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +
    +
    # File 'lib/felflame/component_manager.rb', line 194
    +
    +def entity
    +  if entities.empty?
    +    Warning.warn("This component belongs to NO entities but you called the method that is intended for components belonging to a single entity.\nYou may have a bug in your logic.")
    +  elsif entities.length > 1
    +    Warning.warn("This component belongs to MANY entities but you called the method that is intended for components belonging to a single entity.\nYou may have a bug in your logic.")
    +  end
    +  entities.first
    +end
    +
    @@ -1145,16 +1233,16 @@
     
     
    -228
    -229
    -230
    -231
    -232
    -233
    -234
    +239 +240 +241 +242 +243 +244 +245
    -
    # File 'lib/felflame/component_manager.rb', line 228
    +      
    # File 'lib/felflame/component_manager.rb', line 239
     
     def to_h
       return_hash = instance_variables.each_with_object({}) do |key, final|
    @@ -1212,14 +1300,14 @@
           
     
     
    -194
    -195
    -196
    -197
    -198
    +205 +206 +207 +208 +209
    -
    # File 'lib/felflame/component_manager.rb', line 194
    +      
    # File 'lib/felflame/component_manager.rb', line 205
     
     def update_attrs(**opts)
       opts.each do |key, value|
    @@ -1236,7 +1324,7 @@
     
     
           
    -- 
    cgit v1.2.3