Esempio n. 1
0
        protected ScriptingObject(ScriptingEngine engine, ObjectDefinition definition)
        {
            Engine     = engine;
            Definition = definition;

            CheckConstructorSyntax();
            CheckDisplayModeSyntax();

            Trace.WriteLine(this.ToString(), definition.ObjectClass);
            Notes = new List <Note>();
            Notes.Add(new Note(this.ToString(), false));
        }
Esempio n. 2
0
        public static ScriptingObject Parse(ScriptingEngine engine, string line)
        {
            var definition = ObjectDefinition.Parse(line);

            if (definition != null)
            {
                return(definition.CreateObject(engine));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 3
0
            public static ScriptingObject Create(ScriptingEngine engine, ObjectDefinition definition)
            {
                var constructor = Constructors.FirstOrDefault(c => c.ObjectClass == definition.ObjectClass && c.ObjectType == definition.ObjectType);

                if (constructor == null)
                {
                    constructor = Constructors.FirstOrDefault(c => c.ObjectClass == definition.ObjectClass && c.ObjectType == "*");
                }
                if (constructor == null)
                {
                    throw new ArgumentException("Unrecognized object " + definition.ObjectClass + " " + definition.ObjectType);
                }

                return(constructor.CreateFunction(engine, definition));
            }
Esempio n. 4
0
 protected ScriptingMap(ScriptingEngine engine, ObjectDefinition definition)
     : base(engine, definition)
 {
 }
Esempio n. 5
0
 internal static ScriptingMap Create(ScriptingEngine engine, ObjectDefinition definition)
 {
     return(new ScriptingMap(engine, definition));
 }
Esempio n. 6
0
 protected ScriptingTask(ScriptingEngine engine, ObjectDefinition definition)
     : base(engine, definition)
 {
     Penalties   = new List <Penalty>();
     LoggerMarks = new List <string>();
 }
Esempio n. 7
0
 public ScriptingObject CreateObject(ScriptingEngine engine)
 {
     return(ObjectConstructor.Create(engine, this));
 }
Esempio n. 8
0
 protected ScriptingPenalty(ScriptingEngine engine, ObjectDefinition definition)
     : base(engine, definition)
 {
     Infringements = new List <Penalty>();
 }
Esempio n. 9
0
 protected ScriptingRestriction(ScriptingEngine engine, ObjectDefinition definition)
     : base(engine, definition)
 {
 }
Esempio n. 10
0
 internal static ScriptingRestriction Create(ScriptingEngine engine, ObjectDefinition definition)
 {
     return(new ScriptingRestriction(engine, definition));
 }