Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > TinyBrain | #1008882 - woodyLoadRules

JavaX fragment (include)

static void woodyLoadRules(WoodyBot bot) {
  bot.rules.clear();
  
  L<S> names = endingWithIC(".ctx", bot.fileNames());
  for ping (S name : names) {
    L<S> lines = lines(bot.getFile(name));
    for i, S s over lines: {
      if (javaTokC(s).contains("RULE")) pcall { 
        WoodyRule rule = getWoodyRuleFromSource(lines, i);
        rule.fullName = "Agent#" + dropAfterLastSlash(name).replace('/', '.') + "." + rule.nameInFile;
        bot.rules.put(rule.fullName, rule);
      }
    }
  }
}

download  show line numbers  debug dex   

Travelled to 2 computer(s): cfunsshuasjs, tvejysmllsmz

No comments. add comment

Snippet ID: #1008882
Snippet name: woodyLoadRules
Eternal ID of this version: #1008882/5
Text MD5: 8ec5bfeb9535f2aa94850705317c7dbf
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-16 12:21:52
Source code size: 511 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 23 / 26
Version history: 4 change(s)
Referenced in: [show]