package com.ninty.runtime.heap;

import com.ninty.runtime.LocalVars;

/**
 * Created by ninty on 2017/7/23.
 */
public class NiObject {
    private NiClass clz;
    private LocalVars slots;

    public NiObject(NiClass clz, int count) {
        this.clz = clz;
        slots = new LocalVars(count);
    }

    public NiClass getClz() {
        return clz;
    }

    public LocalVars getSlots() {
        return slots;
    }

    public boolean isInstanceOf(NiClass clz) {
        return clz.isAssignableFrom(this.clz);
    }

    @Override
    public String toString() {
        return "NiObject{" +
                clz.className +
                '}';
    }
}

@@ -176,20 +176,21 @@
 calVars 
-slot
+field
 s;%0A%0A    
@@ -263,20 +263,21 @@
         
-slot
+field
 s = new 
@@ -293,32 +293,137 @@
 (count);%0A    %7D%0A%0A
+    public NiObject(NiObject obj) %7B%0A        this.clz = obj.clz;%0A        this.fields = obj.fields;%0A    %7D%0A%0A
     public NiCla
@@ -491,12 +491,13 @@
  get
-Slot
+Field
 s() 
@@ -517,12 +517,13 @@
 urn 
-slot
+field
 s;%0A 

rename the localVars