public GameController( Game game, ICollisionDetectionService collisionDetectionService, IPlayerService playerService, IEnemyService enemyService, IInputService inputService, IHeadUpDisplayService headUpDisplayService, ITerrainService terrainService, IAudioService audioService) : base(game) { this.game = game; this.collisionDetectionService = collisionDetectionService; this.playerService = playerService; this.enemyService = enemyService; this.inputService = inputService; this.headUpDisplayService = headUpDisplayService; this.terrainService = terrainService; this.audioService = audioService; this.inputService.AnalogPauseChanged += delegate { this.isGamePaused = !this.isGamePaused; }; this.inputService.PauseChanged += delegate { this.isGamePaused = !this.isGamePaused; }; this.fadeEffect = "FadeIn"; }
private void IsPGEmptyAfterResolution() { m_CollisionDetectionService = CurrentRequest.Resolver.Resolve <ICollisionDetectionService>(); AMSResult <bool> status = m_CollisionDetectionService.IsPGEmptyAfterResolution(1, Convert.ToInt32(lblOfferID.Text)); if (CurrentUser.UserPermissions.EditOffer == true && status.Result == true) { RegisterScript("OfferChangeStatus", "javascript:PGEmptyAfterResolution();"); hdnIsPGEmptyAfterResolution.Value = "true"; } else if (CurrentUser.UserPermissions.EditOffer == false && status.Result == true) { RegisterScript("OfferChangeStatus", "javascript:NoEditPermission();"); } }
private void CheckCDStatus() { MyCommon.AppName = "CollidingOffers-Report.aspx"; CurrentRequest.Resolver.AppName = MyCommon.AppName; m_CollisionDetectionService = CurrentRequest.Resolver.Resolve <ICollisionDetectionService>(); AMSResult <CMS.AMS.Models.OCD.QueueStatus> AwaitingDetectionResp = m_CollisionDetectionService.GetOfferQueueStatus(iOfferID_CDS); if ((AwaitingDetectionResp.ResultType == AMSResultType.Success && (AwaitingDetectionResp.Result == CMS.AMS.Models.OCD.QueueStatus.NotStarted || AwaitingDetectionResp.Result == CMS.AMS.Models.OCD.QueueStatus.InProgress))) { RegisterScript("reRunCD", "javascript:reRunCDStatus();"); } else { CheckOfferStatus(); } }
protected void deleteItems_click(object sender, EventArgs e) { try { Int32 removeType = 2; if (hdnProductList.Value == String.Empty) { removeType = 1; } Int64.TryParse(Request.QueryString["ID"], out iOfferID_CDS); var ajaxProcessingFunctions = new AjaxProcessingFunctions(); AMSResult <Boolean> response = ajaxProcessingFunctions.RemoveCollidingProducts(Convert.ToInt32(iOfferID_CDS), removeType); if (response.ResultType != AMSResultType.Success) { infobar.Attributes["style"] = ""; infobar.InnerText = response.MessageString; return; } m_CollisionDetectionService = CurrentRequest.Resolver.Resolve <ICollisionDetectionService>(); AMSResult <int> newcount = m_CollisionDetectionService.DetectOfferCollision(Convert.ToInt64(lblOfferID.Text), AdminUserID); if (newcount.ResultType == AMSResultType.Success) { if (newcount.Result == 0) { Response.Redirect("CollidingOffers-list.aspx"); } else { Response.Redirect("CollidingOffers-Report.aspx?ID=" + Convert.ToInt64(lblOfferID.Text)); } } } catch (Exception ex) { infobar.Attributes["style"] = ""; infobar.InnerText = ex.Message; } }
public AjaxProcessingFunctions() { CurrentRequest.Resolver.AppName = "AjaxProcessingFunctions.asmx"; m_collisionDetectionService = CurrentRequest.Resolver.Resolve <ICollisionDetectionService>(); m_dbAccess = CurrentRequest.Resolver.Resolve <IDBAccess>(); }
private void ComposeServices() { this.terrainService = new TerrainService( this); this.headUpDisplayService = new HeadUpDisplayService( this); this.audioService = new AudioService( this); this.enemyFactory = new EnemyFactory( this, terrainService); this.enemyService = new EnemyService( this, enemyFactory); this.playerFactory = new PlayerFactory( this); this.inputService = new InputService( this); this.playerService = new PlayerService( this, inputService, audioService, playerFactory, terrainService); this.collisionDetectionService = new CollisionDetectionService( this, playerService, enemyService, terrainService); this.gameController = new GameController( this, collisionDetectionService, playerService, enemyService, inputService, headUpDisplayService, terrainService, audioService); try { var consoleAssembly = Assembly.Load("SpaceFighter.Console"); var consoleServiceType = consoleAssembly.GetType("SpaceFighter.Console.ConsoleService"); var consoleService = Activator.CreateInstance(consoleServiceType, this); this.Components.Add(consoleService as IGameComponent); } catch(FileNotFoundException) { // No console support available } }