Example #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));
        }
Example #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);
            }
        }
Example #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));
            }
Example #4
0
 protected ScriptingMap(ScriptingEngine engine, ObjectDefinition definition)
     : base(engine, definition)
 {
 }
Example #5
0
 internal static ScriptingMap Create(ScriptingEngine engine, ObjectDefinition definition)
 {
     return(new ScriptingMap(engine, definition));
 }
Example #6
0
 protected ScriptingTask(ScriptingEngine engine, ObjectDefinition definition)
     : base(engine, definition)
 {
     Penalties   = new List <Penalty>();
     LoggerMarks = new List <string>();
 }
Example #7
0
 public ScriptingObject CreateObject(ScriptingEngine engine)
 {
     return(ObjectConstructor.Create(engine, this));
 }
Example #8
0
 protected ScriptingPenalty(ScriptingEngine engine, ObjectDefinition definition)
     : base(engine, definition)
 {
     Infringements = new List <Penalty>();
 }
 protected ScriptingRestriction(ScriptingEngine engine, ObjectDefinition definition)
     : base(engine, definition)
 {
 }
Example #10
0
 internal static ScriptingRestriction Create(ScriptingEngine engine, ObjectDefinition definition)
 {
     return(new ScriptingRestriction(engine, definition));
 }