Exemplo n.º 1
0
 public TransparentDxOverlay(GameWindow window, SettingsRoot settings, EventScheduler es)
 {
     Settings = settings;
     InitializeComponent();
     BackColor = Color.Black;
     this.window = window;
     base.ShowIcon = false;
     base.FormClosing += new FormClosingEventHandler(TransparentDXOverlay_FormClosing);
     string textForTitle = Settings.Global.WindowName;
     Text = String.IsNullOrWhiteSpace(textForTitle) ? "ExileHUD" : textForTitle;
     base.FormBorderStyle = FormBorderStyle.None;
     base.Load += TransparentDXOverlay_Load;
     overseer = es;
 }
Exemplo n.º 2
0
 public c64env(EventScheduler scheduler)
 {
     eventScheduler = scheduler;
 }
Exemplo n.º 3
0
 // only used for deserializing
 public ReSID(EventScheduler context, BinaryReader reader)
     : base()
 {
     m_context = context;
     LoadFromReader(context, reader);
 }
Exemplo n.º 4
0
        private void UpdateFurnace(EventScheduler scheduler, IWorld world, Coordinates3D coords,
                                   IItemRepository itemRepository)
        {
            if (TrackedFurnaces.ContainsKey(coords))
            {
                TrackedFurnaces.Remove(coords);
            }

            if (world.GetBlockId(coords) != BlockId && world.GetBlockId(coords) != LitFurnaceBlock.BlockId)
            {
                return;
            }

            var state = GetState(world, coords);

            var inputStack  = state.Items[FurnaceWindow.IngredientIndex];
            var outputStack = state.Items[FurnaceWindow.OutputIndex];

            var input = itemRepository.GetItemProvider(inputStack.Id) as ISmeltableItem;

            // Update burn time
            var burnTime = state.BurnTimeRemaining;

            if (state.BurnTimeRemaining > 0)
            {
                state.BurnTimeRemaining -= 20;                 // ticks
                if (state.BurnTimeRemaining <= 0)
                {
                    state.BurnTimeRemaining = 0;
                    state.BurnTimeTotal     = 0;
                    world.SetBlockId(coords, BlockId);
                }
            }

            // Update cook time
            if (state.CookTime < 200 && state.CookTime >= 0)
            {
                state.CookTime += 20;                 // ticks
                if (state.CookTime >= 200)
                {
                    state.CookTime = 200;
                }
            }

            // Are we done cooking?
            if (state.CookTime == 200 && burnTime > 0)
            {
                state.CookTime = -1;
                if (input != null && (outputStack.Empty || outputStack.CanMerge(input.SmeltingOutput)))
                {
                    if (outputStack.Empty)
                    {
                        outputStack = input.SmeltingOutput;
                    }
                    else if (outputStack.CanMerge(input.SmeltingOutput))
                    {
                        outputStack.Count += input.SmeltingOutput.Count;
                    }
                    state.Items[FurnaceWindow.OutputIndex] = outputStack;
                    state.Items[FurnaceWindow.IngredientIndex].Count--;
                }
            }

            SetState(world, coords, state);
            TryInitializeFurnace(state, scheduler, world, coords, itemRepository);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ar"></param>
        private void OnFTPActionComplete(IAsyncResult ar)
        {
            string processResultMessage = "";
            try
            {
                // Retrieve the delegate.
                DoFTPActionStartDelegate dlgt = (DoFTPActionStartDelegate)ar.AsyncState;

                TransferMainService transferMainService = new TransferMainService();

                TransferWorkService transferWorkService = new TransferWorkService();

                // Look up transfer record by ID
                TransferMain tm = transferMainService.GetByTransferRefId(mWorkRefId);

                lock (this)
                {

                    // Call EndInvoke to retrieve the results.
                    processResultMessage = dlgt.EndInvoke(out processResult, out destinationRefId, ar);

                    // display or process aync results
                    LogManager.GetLogger("SiteLogger").Info("Processing Complete: " + processResult + " with result: " + processResultMessage);
                    //logger.logEntry(this.ToString(), "Processing Complete: " + processResult + " with result: " + processResultMessage, LogMsgSeverity.Information, false);

                    // update transfer record
                    /// write transfer to work table

                    TransferWork tw = transferWorkService.GetByTransferRefIdDestinationRefId(tm.TransferRefId, destinationRefId);

                    if (tw == null)
                        throw new SystemException("Unable to find transfer records for destination " + destinationRefId);

                    tw.CompletionTime = DateTime.Now;

                    if (processResult)
                        tw.StatusTypeId = (short)StatusTypeList.Complete;
                    else
                    {
                        tw.StatusTypeId = (short)StatusTypeList.Error;
                        // reset the schedule to run in 2 hours on an error
                        EventScheduler eventScheduler = new EventScheduler();
                        eventScheduler.GetSchedule((Guid)tm.ScheduleRefId).NextInvokeTime = DateTime.Now.AddHours(2);
                    }

                    tw.Retires += 1;
                    if (tw.Results == null)
                        tw.Results = processResultMessage + "\n";
                    else
                        tw.Results += processResultMessage + "\n";

                    transferWorkService.Save(tw);

                    //TODO: figure this out
                    //clean things up
                    SetFileComplete(processResultMessage, destinationRefId);
                }

            }
            catch (Exception ex)
            {
                LogManager.GetLogger("SiteLogger").Fatal("Callback method  DoFTPActionComplete(): Failed.", ex);
                //logger.logEntry(this.ToString(), "Callback method  DoFTPActionComplete(): Failed." + ex.Message, LogMsgSeverity.Critical, false);
            }
        }
Exemplo n.º 6
0
 public void RaiseAsyncEvent(int value)
 {
     EventScheduler.RunAsync(() => { c = value; });
 }
Exemplo n.º 7
0
        public Game() : base()
        {
            _mapLayer = new LayerInfo("Map", 1,
                                      EngineConsts.SIDEBAR_WIDTH + 2, 1,
                                      EngineConsts.MAPVIEW_WIDTH, EngineConsts.MAPVIEW_HEIGHT);

            _infoLayer = new LayerInfo("Info", 1,
                                       1, 1, EngineConsts.SIDEBAR_WIDTH, EngineConsts.SCREEN_HEIGHT);

            _radarLayer = new LayerInfo("Radar", 1,
                                        EngineConsts.SIDEBAR_WIDTH + EngineConsts.MAPVIEW_WIDTH + 3, 1,
                                        EngineConsts.SIDEBAR_R_WIDTH,
                                        EngineConsts.SCREEN_HEIGHT - EngineConsts.SIDEBAR_R_WIDTH - 1);

            _objectiveLayer = new LayerInfo("Objective", 1,
                                            EngineConsts.SIDEBAR_WIDTH + EngineConsts.MAPVIEW_WIDTH + 3,
                                            EngineConsts.SCREEN_HEIGHT - EngineConsts.SIDEBAR_R_WIDTH + 1,
                                            EngineConsts.SIDEBAR_R_WIDTH, EngineConsts.SIDEBAR_R_WIDTH);

            _messageLayer = new LayerInfo("Message", 1,
                                          EngineConsts.SIDEBAR_WIDTH + 2, EngineConsts.MAPVIEW_HEIGHT + 2,
                                          EngineConsts.MAPVIEW_WIDTH, EngineConsts.MESSAGE_HEIGHT);
            _mainLayer = new LayerInfo("Main", 11, 0, 0,
                                       EngineConsts.SCREEN_WIDTH + 2, EngineConsts.SCREEN_HEIGHT + 2);

            StateHandler = new StateHandler(MenuState.Instance, new Dictionary <Type, LayerInfo>
            {
                [typeof(MissionEndState)]        = _mapLayer,
                [typeof(NormalState)]            = _mapLayer,
                [typeof(TargettingState)]        = _mapLayer,
                [typeof(MenuState)]              = _mainLayer,
                [typeof(IntermissionFrameState)] = _mainLayer,
            });

            AnimationHandler = new AnimationHandler();
            MessagePanel     = new MessagePanel(EngineConsts.MESSAGE_HISTORY_COUNT);
            EventScheduler   = new EventScheduler(typeof(Player));

            // attach event handlers
            EventScheduler.Subscribe <MoveCommand>(c => ((MoveCommand)c).Execute());
            EventScheduler.Subscribe <TurnCommand>(c => ((TurnCommand)c).Execute());
            EventScheduler.Subscribe <AttackCommand>(c => ((AttackCommand)c).Execute());
            EventScheduler.Subscribe <AttackCommand>(c =>
            {
                var ac = (AttackCommand)c;
                ac.Animation.MatchSome(anim => AnimationHandler.Add(ac.Source.Id, anim));
            });
            EventScheduler.Subscribe <DelayAttackCommand>(c =>
            {
                var dc = (DelayAttackCommand)c;
                EventScheduler.AddEvent(new DelayAttack(dc.Delay, dc.Attack), dc.Delay);
            });

            EventScheduler.Subscribe <MechDeathEvent>(c =>
            {
                var mde   = (MechDeathEvent)c;
                Mech mech = mde.Source;
                MapHandler.RemoveActor(mech);

                if (MapHandler.Field[mech.Pos].IsVisible)
                {
                    MessagePanel.Add($"[color=info]Info[/color]: {mech.Name} destroyed");
                    MapHandler.Refresh();
                }
            });

            Reset();
            ConfigureTerminal();
        }
 public PassengerArriveEvent(Stop stop, EventScheduler <WorldState> scheduler) : base(scheduler)
 {
     this.stop = stop;
 }
Exemplo n.º 9
0
 // only used for deserializing
 protected MOS656X(EventScheduler context, BinaryReader reader, int newid)
     : base(context, reader, newid)
 {
     event_context = context;
 }
Exemplo n.º 10
0
 protected void chkLocationList_SelectedIndexChanged(object sender, EventArgs e)
 {
     RoomDS.SelectCommand = Utility.FilterQuery(chkLocationList);
     RoomDS.DataBind();
     EventScheduler.Rebind();
 }