Пример #1
0
 public void set_script(String act_script)
 {
     script = VERGEGame.game.script<ZoneDelegate>(act_script);
     if (script == null && !String.IsNullOrEmpty(act_script))
         System.Diagnostics.Debug.WriteLine("DEBUG: Couldn't find a \"" + act_script + "\" ZoneDelegate for the " + name +
             " zone. Defaulting to a null script.");
 }
Пример #2
0
        public override void print(string line)
        {
            var          implementation = _print;
            ZoneDelegate parentDelegate = async_._parentDelegate(implementation.zone);
            PrintHandler handler        = implementation.function;

            handler(implementation.zone, parentDelegate, this, line);
        }
Пример #3
0
        public override Timer createPeriodicTimer(TimeSpan duration, ZoneUnaryCallback f)
        {
            var          implementation        = _createPeriodicTimer;
            ZoneDelegate parentDelegate        = async_._parentDelegate(implementation.zone);
            CreatePeriodicTimerHandler handler = implementation.function;

            return(handler(implementation.zone, parentDelegate, this, duration, f));
        }
Пример #4
0
        public override void scheduleMicrotask(ZoneCallback f)
        {
            var                      implementation = _scheduleMicrotask;
            ZoneDelegate             parentDelegate = async_._parentDelegate(implementation.zone);
            ScheduleMicrotaskHandler handler        = implementation.function;

            handler(implementation.zone, parentDelegate, this, f);
        }
Пример #5
0
        public override ZoneBinaryCallback registerBinaryCallback(ZoneBinaryCallback callback)
        {
            var          implementation           = _registerBinaryCallback;
            ZoneDelegate parentDelegate           = async_._parentDelegate(implementation.zone);
            RegisterBinaryCallbackHandler handler = implementation.function;

            return(handler(implementation.zone, parentDelegate, this, callback));
        }
Пример #6
0
        public override object runBinary(ZoneBinaryCallback f, object arg1, object arg2)
        {
            var              implementation = _runBinary;
            ZoneDelegate     parentDelegate = async_._parentDelegate(implementation.zone);
            RunBinaryHandler handler        = implementation.function;

            return(handler(implementation.zone, parentDelegate, this, f, arg1, arg2));
        }
Пример #7
0
        public override object run(ZoneCallback f)
        {
            var          implementation = _run;
            ZoneDelegate parentDelegate = async_._parentDelegate(implementation.zone);
            RunHandler   handler        = implementation.function;

            return(handler(implementation.zone, parentDelegate, this, f));
        }
Пример #8
0
        public override Zone fork(ZoneSpecification specification = null, Hashtable zoneValues = null)
        {
            var          implementation = _fork;
            ZoneDelegate parentDelegate = async_._parentDelegate(implementation.zone);
            ForkHandler  handler        = implementation.function;

            return(handler(implementation.zone, parentDelegate, this, specification, zoneValues));
        }
Пример #9
0
        public override void handleUncaughtError(Exception error)
        {
            var          implementation        = _handleUncaughtError;
            ZoneDelegate parentDelegate        = async_._parentDelegate(implementation.zone);
            HandleUncaughtErrorHandler handler = implementation.function;

            handler(implementation.zone, parentDelegate, this, error);
        }
Пример #10
0
        protected readonly String script_name; // default activation script assigned during creation

        #endregion Fields

        #region Constructors

        public Zone(String zone_name, String act_script, double act_chance, bool adj_act)
        {
            name = zone_name;
            script_name = act_script;
            chance = act_chance;
            adjacent = adj_act;
            script = null;
        }
Пример #11
0
        public override AsyncError errorCallback(Exception error)
        {
            if (error == null)
            {
                throw new ArgumentNullException(nameof(error));
            }
            var   implementation     = _errorCallback;
            _Zone implementationZone = implementation.zone;

            if (ReferenceEquals(implementationZone, async_._rootZone))
            {
                return(null);
            }
            ZoneDelegate         parentDelegate = async_._parentDelegate(implementationZone);
            ErrorCallbackHandler handler        = implementation.function;

            return(handler(implementationZone, parentDelegate, this, error));
        }