OSDN Git Service

ノードの同期はだいたいできた
[chnosproject/AI004.git] / aimemtag.js
index 5ba5bec..62240c4 100644 (file)
@@ -47,8 +47,30 @@ var AI_WordTag = function(str, uuid){
        },
 });
 
+var AI_DatabaseInfoTag = function(){
+       AI_DatabaseInfoTag.base.call(this, AI_DatabaseInfoTag.base.prototype.Type_DatabaseInfo);
+       this.readLineCount = 0;
+}.extend(AI_MemoryTag, {
+       parseToStringData: function(){
+               //uuid:type:str:wordCount:wordLevel
+               var d = new Object();
+               d.rlc = this.readLineCount;
+               return AI_DatabaseInfoTag.base.prototype.parseToStringData.call(this, d);
+       },
+       loadFromMemoryData: function(data){
+               this.readLineCount = data.rlc;
+       },
+       bindDatabaseInfo: function(aimemory){
+               //このインスタンスがもつ情報をAI_Memoryのデータに反映させる
+               aimemory.dbInfo.readLineCount = this.readLineCount;
+       },
+});
+
 var AI_PatternTag = function(pattern, uuid, func){
+       AI_PatternTag.base.call(this, AI_PatternTag.base.prototype.Type_Pattern);
        // p.func(this.env, separated, separated_UUID);
+       //patternには関数も指定できる。その場合、関数の形式は
+       //f(separated, separated_UUID)となる。戻り値がtrueの場合、パターンはマッチしたとみなされる
        if(pattern){
                this.pattern = pattern;
        }
@@ -60,11 +82,12 @@ var AI_PatternTag = function(pattern, uuid, func){
        }
 }.extend(AI_MemoryTag, {
        parseToStringData: function(){
-               
+               //Not implemented.
        },
 });
 
 var AI_MeaningTag = function(uuid, description){
+       AI_MeaningTag.base.call(this, AI_MeaningTag.base.prototype.Type_Meaning);
        if(description){
                this.description = description;
        }
@@ -73,6 +96,6 @@ var AI_MeaningTag = function(uuid, description){
        }
 }.extend(AI_MemoryTag, {
        parseToStringData: function(){
-               
+               //Not implemented.
        },
 });