Changes have been pushed for the repository "fawkesrobotics/fawkes".

Clone:  https://github.com/fawkesrobotics/fawkes.git
Gitweb: https://github.com/fawkesrobotics/fawkes

The branch, neltester/arg_check_in_skill_jumpstate has been updated
        to  0da7f030018ef8b648994217d4d2cc317ff7caf8 (commit)
      from  ea2b3595a410da5a96d237b3519003f949a64c61 (commit)

https://github.com/fawkesrobotics/fawkes/tree/neltester/arg_check_in_skill_jumpstate

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- *Log* ---------------------------------------------------------------
commit 0da7f030018ef8b648994217d4d2cc317ff7caf8
Author:     Niklas Sebastian Eltester <eltes...@fh-aachen.de>
AuthorDate: Wed Apr 8 12:43:21 2020 +0200
Commit:     Niklas Sebastian Eltester <eltes...@fh-aachen.de>
CommitDate: Wed Apr 8 12:43:21 2020 +0200

    skiller/subskill_jumpstate.lua: compare exp. skillnames with act. skillnames
    
    Now comparing actual skillnames given in self.args to determine
    unexpected skillnames rather than just size

https://github.com/fawkesrobotics/fawkes/commit/0da7f0300

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------
 src/lua/skiller/subskill_jumpstate.lua | 37 ++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)


- *Diffs* -------------------------------------------------------------

- *commit* 0da7f030018ef8b648994217d4d2cc317ff7caf8 - - - - - - - - - -
Author:  Niklas Sebastian Eltester <eltes...@fh-aachen.de>
Date:    Wed Apr 8 12:43:21 2020 +0200
Subject: skiller/subskill_jumpstate.lua: compare exp. skillnames with act. 
skillnames

 src/lua/skiller/subskill_jumpstate.lua | 37 ++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)

_Diff for modified files_:
diff --git a/src/lua/skiller/subskill_jumpstate.lua 
b/src/lua/skiller/subskill_jumpstate.lua
index 83ee0555a..dfb51a2bc 100644
--- a/src/lua/skiller/subskill_jumpstate.lua
+++ b/src/lua/skiller/subskill_jumpstate.lua
@@ -232,8 +232,10 @@ function SubSkillJumpState:do_init()
    self.args = {}
 
    -- store expected size of arguments table to compare after run of init()
-   local exp_sizeof_args = 0
-   local act_sizeof_args = 0
+   -- local exp_sizeof_args = 0
+   -- local act_sizeof_args = 0
+   
+   local exp_args = {}
 
    for _, s in ipairs(self.skills) do
       if s[1] ~= nil then
@@ -244,17 +246,36 @@ function SubSkillJumpState:do_init()
             sname = s[1].name
          end
          self.args[sname] = {}
-         exp_sizeof_args = exp_sizeof_args + 1
+         --  exp_sizeof_args = exp_sizeof_args + 1
       end
    end
+   -- copy expexted arguments table for later comparison
+   exp_args = table.deepcopy(self.args)
+
    self:init()
+   
+   -- copy actual arguments table for comparison
+   act_args = table.deepcopy(self.args)
+
    -- compare size of expected argument table with actual argument table
-   for skillname, skill in pairs(self.args) do
-      act_sizeof_args = act_sizeof_args + 1
+   -- for skillname, skill in pairs(self.args) do
+   --   act_sizeof_args = act_sizeof_args + 1
+   -- end
+   -- if exp_sizeof_args ~= act_sizeof_args then 
+   --   print_warn("Expected size of self.args: " .. tostring(exp_sizeof_args) 
.. ", actual size of self.args: "
+   --   .. tostring(act_sizeof_args) .. ". Make sure you set the correct key 
in self.args[key]")
+   -- end
+
+   -- compare keys of copies to determine unexpected key names
+   for act_args_key,act_args_val in pairs(act_args) do
+      for exp_args_key,act_args_val in pairs(exp_args) do 
+         if act_args_key == exp_args_key then
+            act_args[act_args_key] = nil
+         end
+      end
    end
-   if exp_sizeof_args ~= act_sizeof_args then 
-      print_warn("Expected size of self.args: " .. tostring(exp_sizeof_args) 
.. ", actual size of self.args: "
-      .. tostring(act_sizeof_args) .. ". Make sure you set the correct key in 
self.args[key]")
+   for unexp_skillname,_ in pairs(act_args) do
+      print_warn("Unexpected skillname: " .. unexp_skillname .. " in 
self.args")
    end
 
    for _, s in ipairs(self.skills) do



_______________________________________________
fawkes-commits mailing list
fawkes-commits@lists.kbsg.rwth-aachen.de
https://lists.kbsg.rwth-aachen.de/listinfo/fawkes-commits

Reply via email to