From 09fc5ef46b911f9d7e31cdedd240e7afc4c11c92 Mon Sep 17 00:00:00 2001 From: realtradam Date: Wed, 7 Jul 2021 17:49:00 -0400 Subject: completed functionality --- docs/FelFlame/Entities.html | 266 +++++++------------------------------------- 1 file changed, 42 insertions(+), 224 deletions(-) (limited to 'docs/FelFlame/Entities.html') diff --git a/docs/FelFlame/Entities.html b/docs/FelFlame/Entities.html index 0d7b483..f789cb3 100644 --- a/docs/FelFlame/Entities.html +++ b/docs/FelFlame/Entities.html @@ -109,9 +109,7 @@

Overview

-

Creates and manages Entities. Allows accessing Entities using their ID

- -

TODO: Improve Entity overview

+

Creates and manages Entities. Allows accessing Entities using their ID. Entities are just collections of Components.

@@ -213,30 +211,6 @@

Iterates over all entities.

- - - -
  • - - - .from_json(json_string, **opts) ⇒ Object - - - - - - - - - - - - - -
    -

    Creates a new entity using the data from a JSON string TODO: This function is not yet complete.

    -
    -
  • @@ -276,7 +250,7 @@
  • - #components ⇒ Hash + #components ⇒ Hash<Component_Manager, Array<Integer>> @@ -291,7 +265,7 @@
    -

    A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the IDs of the components attached to this entity.

    +

    A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the IDs of the components attached to this entity.

  • @@ -392,30 +366,6 @@

    An alias for the ID reader.

    - - - -
  • - - - #to_json ⇒ String - - - - - - - - - - - - - -
    -

    Export all data into a JSON String which can then be saved into a file TODO: This function is not yet complete.

    -
    -
  • @@ -482,10 +432,7 @@ 23 24 25 -26 -27 -28 -29 +26
    # File 'entity_manager.rb', line 16
    @@ -497,9 +444,6 @@
       self.id = new_id
     
       # Add each component
    -  #components.uniq.each do |component|
    -  #  add component
    -  #end
       add(*components)
     
       self.class.data[id] = self
    @@ -645,12 +589,12 @@
           
     
     
    -119
    -120
    -121
    +117 +118 +119
    -
    # File 'entity_manager.rb', line 119
    +      
    # File 'entity_manager.rb', line 117
     
     def [](entity_id)
       data[entity_id]
    @@ -699,12 +643,12 @@
           
     
     
    -126
    -127
    -128
    +124 +125 +126
    -
    # File 'entity_manager.rb', line 126
    +      
    # File 'entity_manager.rb', line 124
     
     def each(&block)
       data.compact.each(&block)
    @@ -712,79 +656,6 @@
         
       
     
    -
    -    
    -      
    -

    - - .from_json(json_string, **opts) ⇒ Object - - - - - -

    -
    - -

    Creates a new entity using the data from a JSON string TODO: This function is not yet complete

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - json_string - - - (String) - - - - — -
      -

      A string that was exported originally using the to_json function

      -
      - -
    • - -
    • - - opts - - - (Keywords) - - - - — -
      -

      What values(its ID or the component IDs) should be overwritten TODO: this might change

      -
      - -
    • - -
    - - -
    - - - - -
    -
    -
    -
    -134
    -
    -
    # File 'entity_manager.rb', line 134
    -
    -def from_json(json_string, **opts) end
    -
    @@ -844,7 +715,7 @@ —
    -

    true if component is added, false if it already is attached or no components given

    +

    true

    @@ -857,6 +728,9 @@
     
     
    +58
    +59
    +60
     61
     62
     63
    @@ -867,12 +741,10 @@
     68
     69
     70
    -71
    -72
    -73
    +71
    -
    # File 'entity_manager.rb', line 61
    +      
    # File 'entity_manager.rb', line 58
     
     def add(*components_to_add)
       components_to_add.each do |component|
    @@ -886,6 +758,7 @@
           check_systems component, :addition_triggers
         end
       end
    +  true
     end
    @@ -895,7 +768,7 @@

    - #componentsHash + #componentsHash<Component_Manager, Array<Integer>> @@ -904,7 +777,7 @@

    -

    A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the IDs of the components attached to this entity.

    +

    A hash that uses component manager constant names as keys, and where the values of those keys are arrays that contain the IDs of the components attached to this entity.

    @@ -917,7 +790,7 @@
  • - (Hash) + (Hash<Component_Manager, Array<Integer>>) @@ -931,12 +804,12 @@
     
     
    -33
    -34
    -35
    +30 +31 +32
  • -
    # File 'entity_manager.rb', line 33
    +      
    # File 'entity_manager.rb', line 30
     
     def components
       @components ||= {}
    @@ -977,7 +850,7 @@
           
             —
             
    -

    true.

    +

    true

    @@ -990,6 +863,9 @@
     
     
    +42
    +43
    +44
     45
     46
     47
    @@ -998,13 +874,10 @@
     50
     51
     52
    -53
    -54
    -55
    -56
    +53
    -
    # File 'entity_manager.rb', line 45
    +      
    # File 'entity_manager.rb', line 42
     
     def delete
       components.each do |component_manager, component_array|
    @@ -1074,7 +947,7 @@
           
             —
             
    -

    true if at least one component is removed, false if none of them were attached to the component

    +

    true

    @@ -1087,17 +960,17 @@
     
     
    +88
    +89
     90
     91
     92
     93
     94
    -95
    -96
    -97
    +95
    -
    # File 'entity_manager.rb', line 90
    +      
    # File 'entity_manager.rb', line 88
     
     def remove(*components_to_remove)
       components_to_remove.each do |component|
    @@ -1151,12 +1024,12 @@
           
     
     
    -39
    -40
    -41
    +36 +37 +38
    -
    # File 'entity_manager.rb', line 39
    +      
    # File 'entity_manager.rb', line 36
     
     def to_i
       id
    @@ -1164,61 +1037,6 @@
         
       
     
    -
    -    
    -      
    -

    - - #to_jsonString - - - - - -

    -
    - -

    Export all data into a JSON String which can then be saved into a file TODO: This function is not yet complete

    - - -
    -
    -
    - -

    Returns:

    -
      - -
    • - - - (String) - - - - — -
      -

      A JSON formatted String

      -
      - -
    • - -
    - -
    - - - - -
    -
    -
    -
    -102
    -
    -
    # File 'entity_manager.rb', line 102
    -
    -def to_json() end
    -
    @@ -1226,7 +1044,7 @@ -- cgit v1.2.3