/*--------------------------------------------------------------*/ public ValueStore AddGlobalObject(string name) { ValueStore newGlobalObject = FindGlobalObject(name); if (newGlobalObject == null) { globals.Add(name, new ValueStore()); newGlobalObject = (ValueStore)globals[name]; } return(newGlobalObject); }
private void Init() { items = new ValueStore[size]; for (int i = 0; i < size; i++) { items[i] = new ValueStore(); } numItems = 0; top = -1; }
/*--------------------------------------------------------------*/ public IValue GetVal(IValue v) { // deref. value // get a valule from the table item // TYPE_TABLEDATAREF -> value if (v.TypeOf() == ValueTypeID.TYPE_TABLEDATAREF) { ValueTableItem dti = (ValueTableItem)v.GetObjectValue(); return(dti.Value); } // TYPE_STOREREF -> value else if (v.TypeOf() == ValueTypeID.TYPE_STOREREF) { ValueStore vstore = (ValueStore)v.GetObjectValue(); return((IValue)vstore.Value); } // all other types are passed throught unchanged return(v); }