Beispiel #1
0
        public static CSObject LocalVariableObject(CSNode node, System.Type type, string name, object val)
        {
            CSObject obj = new CSObject()
            {
                _node       = node,
                _object     = val,
                _type       = type,
                _objectType = ObjectType.LOCAL,
                _name       = name,
                _staticType = null,
                _arrayIndex = -1,
            };

            return(obj);
        }
Beispiel #2
0
        public static CSObject DictionaryVariableObject(CSNode node, System.Type type, object dictionary, string name)
        {
            CSObject obj = new CSObject()
            {
                _node       = node,
                _object     = dictionary,
                _type       = type,
                _objectType = ObjectType.DICTIONARY,
                _name       = name,
                _staticType = null,
                _arrayIndex = -1,
            };

            return(obj);
        }
Beispiel #3
0
        public static CSObject ArrayVariableObject(CSNode node, System.Type type, object array, int index)
        {
            CSObject obj = new CSObject()
            {
                _node       = node,
                _object     = array,
                _type       = type,
                _objectType = ObjectType.ARRAY,
                _name       = "array",
                _staticType = null,
                _arrayIndex = index,
            };

            return(obj);
        }
Beispiel #4
0
        public static CSObject StaticVariableObject(CSNode node, System.Type type, System.Type staticType, string name)
        {
            CSObject obj = new CSObject()
            {
                _node       = node,
                _object     = null,
                _type       = type,
                _objectType = ObjectType.STATIC,
                _name       = name,
                _staticType = staticType,
                _arrayIndex = -1,
            };

            return(obj);
        }
Beispiel #5
0
        public static CSObject TempVariableObject(CSNode node, System.Type type, object val)
        {
            CSObject obj = new CSObject()
            {
                _node       = node,
                _object     = val,
                _type       = type,
                _objectType = ObjectType.TEMP,
                _name       = "temp",
                _staticType = null,
                _arrayIndex = -1,
            };

            return(obj);
        }
Beispiel #6
0
        public static CSObject InstanceVariableObject(CSNode node, System.Type type, object parent, string name)
        {
            CSObject obj = new CSObject()
            {
                _node       = node,
                _object     = parent,
                _type       = type,
                _objectType = ObjectType.VARIABLE,
                _name       = name,
                _staticType = null,
                _arrayIndex = -1,
            };

            return(obj);
        }
Beispiel #7
0
        public static CSObject ImmediateObject(CSNode node, System.Type type, object val)
        {
            if (val == null)
            {
                CSLog.E(node, "val cannot be null");
                return(null);
            }
            CSObject obj = new CSObject()
            {
                _node       = node,
                _object     = val,
                _type       = val.GetType(),
                _objectType = ObjectType.IMMEDIATE,
                _name       = "immedidate",
                _staticType = null,
                _arrayIndex = -1,
            };

            return(obj);
        }
Beispiel #8
0
 public static void E(CSNode node, string msg)
 {
     Debug.LogError("[CSScript line: " + node._line + " col: " + node._column + "] " + msg);
 }