public void Begin() { timeStamp = Time.time; animStage = Stages.PauseBeforeUnwrap; if (parentInstance != null) { parentInstance.SetActive(true); } if (wrappedRibbon != null) { wrappedRibbon.SetActive(true); } if (lid != null) { lid.SetActive(true); } if (box != null) { box.SetActive(true); } if (unwrappedRibbon != null) { unwrappedRibbon.SetActive(false); } }
/// <summary> /// Parses the releases feed for relevant information /// </summary> /// /// <returns>Success or Fail</returns> public bool Parse() { Stage = Stages.PARSE; try { string json = File.ReadAllText(tempReleases); dynamic stuff = JArray.Parse(json); dynamic latest = stuff[0]; dynamic assets = latest.assets[0]; downloadURL = assets.browser_download_url; date = latest.published_at; Debug.WriteLine("Download URL: " + downloadURL); Debug.WriteLine("Date: " + date); } catch (Exception e) { Debug.Write(e.StackTrace.ToString()); return(false); } return(true); }
/// <summary> /// Checks if the parsed info indicates that a newer version is available /// </summary> /// <returns>Newer version available for download</returns> public bool Check(string applicationPath) { Stage = Stages.CHECK; if (string.IsNullOrEmpty(applicationPath) || !Directory.Exists(applicationPath)) { return(false); } try { string exePath = Path.Combine(applicationPath, "ARK Smart Breeding.exe"); // if exe does not exist, an update is needed if (!File.Exists(exePath)) { return(true); } string installedVersion = FileVersionInfo.GetVersionInfo(exePath).FileVersion; Debug.WriteLine($"installed version: {installedVersion}"); Debug.WriteLine($"available version: {latestVersion}"); return(Version.TryParse(installedVersion, out Version installedVer) && Version.TryParse(latestVersion, out Version latestVer) && installedVer > new Version(0, 0) && installedVer < latestVer); } catch (Exception e) { Debug.Write("Exception while checking versions. " + e.Message); } return(false); }
protected override bool Validate() { var res = true; ValidationDetails.Clear(); if (Prioritet < 1) { res = false; ValidationDetails.Add("Приоритет процесса должен быть больше 0"); } if (Stages.Count < 3) { res = false; ValidationDetails.Add("Количество этапов должно быть 3 или больше"); } foreach (var stage in Stages) { if (!stage.IsValid) { res = false; foreach (var det in stage.ValidationDetails) { ValidationDetails.Add($"Стадия[{Stages.IndexOf(stage)}]: {det}"); } } } return(res); }
static void Logic() { int end = 3; Stages start = new Stages(); start.StartStage(); //как то создать два потока while (end == 3) { start.CyclicStage(); end = start.EndStage(); } switch (end) { case 0: Console.WriteLine("Первый победил"); break; case 1: Console.WriteLine("Второй победил"); break; case 2: Console.WriteLine("Ничья"); break; } client1.Close(); client2.Close(); Console.ReadLine(); }
public bool Add(Stages t) { t.CreateDate = DateTime.Now; var result = iStages_BLL.Add(t); return(result); }
protected void AddStep(Stages stage, Messages messageName, Modes mode, string entityName, string actionName, params string[] columns) { var list = _newRegisteredEvents; var step = new Step(this, messageName, stage, mode, entityName, actionName, columns); if (step.Method == null) { throw new InvalidPluginExecutionException($"The method {ChildClassName}.{actionName} used during {messageName} message does not exist or is private"); } else if (!step.Method.IsPublic || step.Method.IsStatic) { throw new InvalidPluginExecutionException($"The method {ChildClassName}.{actionName} used during {messageName} message should be public and not static"); } foreach (var param in step.Method.GetParameters()) { if (!param.ParameterType.IsInterface || (!typeof(IPluginContext).IsAssignableFrom(param.ParameterType) && (!typeof(IService).IsAssignableFrom(param.ParameterType)))) { throw new InvalidPluginExecutionException($"{ChildClassName}.{actionName} parameter : {param.Name}. Only IPluginContext and IService interfaces are allowed as parameters"); } } list.Add(step); }
/// <summary> /// Добавить этап после этапа с заданным порядковым номером /// </summary> /// <param name="stage">Этап</param> /// <param name="position">Порядковый номер этапа, после которого осуществляется вставка</param> public virtual void AddStage(ProductionOrderBatchLifeCycleTemplateStage stage, short position) { if (position < 1 || position > StageCount - 2) { throw new Exception("Невозможно вставить этап на заданную позицию."); } RecalculateOrdinalNumbers(); var stageList = new List <ProductionOrderBatchLifeCycleTemplateStage>(Stages.OrderBy(x => x.OrdinalNumber)); foreach (var productionOrderBatchLifeCycleTemplateStage in stageList) { if (productionOrderBatchLifeCycleTemplateStage.OrdinalNumber > position) { productionOrderBatchLifeCycleTemplateStage.OrdinalNumber++; } } stages.Add(stage); stage.Template = this; stage.OrdinalNumber = (short)(position + 1); CheckStageOrder(); }
//setups iniciais private void Start() { Diff = stg.GetComponent <Stages>(); ghostTotal = Diff.ghostActive[stage]; Debug.Log(ghostTotal); StartCoroutine(StartEnemyIA()); }
public override int GetHashCode() { unchecked { return(((Stages != null ? Stages.GetHashCode() : 0) * 397) ^ (StrikeRules != null ? StrikeRules.GetHashCode() : 0)); } }
public StageCode NewStage() { var stage = new StageCode(); Stages.Add(stage); return(stage); }
public void NextStage() { int numStages = Stages.Count(); if (numStages == 1) { return; } for (int i = 0; i < numStages; i++) { if (Stages[i].Order == SelectedStage.Order) { if (i == numStages) { SelectedStage = Stages[0]; } else { SelectedStage = Stages[(i + 1) % (numStages)]; } break; } } }
public PluginContextAttribute(Stages stage, Messages message, Modes mode, string entityName) { Message = message; Stage = stage; Mode = mode; EntityName = entityName; }
//CONSTRUCTORS public Player(Stages.Stage _stage) { Character = ATexture.Crow; stage = _stage; RepopPosX = 200; Hitbox = new Rectangle(RepopPosX, Game1.screenHeight - 60 - 172, 87, 170); staticHitbox = Hitbox; Spritebox = new Rectangle(RepopPosX, Game1.screenHeight - 60 - 172, 175, 175); this.FrameLine = 1; this.FrameCol = 1; this.IsGrounded = false; this.gravity = 15; // Vitesse de chute this.regard = 1; // Si regard = 1 les perso est tourné vers la droite sinon vers la gauche this.Timer = 0; // Intervalle entre 2 boucles d'animations this.AnimationSpeed = 7; // Vitesse d'animation this.direction = Direction.Non; //Position si aucun input //this.JumpCeiling = Hitbox.Y; airSpeed = 20; height = Spritebox.Height; crouchHeight = Spritebox.Height / 2; //jumpTimer = 0; bulletList = new List<Bullet>(); bulletDelay = 30; exists = true; color = Color.White; }
public virtual void ReadChildData(BinaryReader reader) { int x = 0; _lensFlare.ReadString(reader); for (x = 0; (x < _extraLayers.Count); x = (x + 1)) { ExtraLayers.Add(new ShaderTransparentLayerBlock()); ExtraLayers[x].Read(reader); } for (x = 0; (x < _extraLayers.Count); x = (x + 1)) { ExtraLayers[x].ReadChildData(reader); } for (x = 0; (x < _maps.Count); x = (x + 1)) { Maps.Add(new ShaderTransparentGenericMapBlock()); Maps[x].Read(reader); } for (x = 0; (x < _maps.Count); x = (x + 1)) { Maps[x].ReadChildData(reader); } for (x = 0; (x < _stages.Count); x = (x + 1)) { Stages.Add(new ShaderTransparentGenericStageBlock()); Stages[x].Read(reader); } for (x = 0; (x < _stages.Count); x = (x + 1)) { Stages[x].ReadChildData(reader); } }
/// <summary> /// Initializes a new instance of the <see cref="StageRunnerBase"/> class with the name /// of the plugin, priority and a generic logger. /// </summary> /// <param name="pluginName">The name of the plugin.</param> /// <param name="stage">The stage.</param> /// <param name="priority">The priority.</param> /// <param name="logger">A logger.</param> public StageRunnerBase(string pluginName, Stages stage, int priority, ILogger logger) { _name = pluginName ?? throw new ArgumentNullException(nameof(pluginName)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _stage = stage; _priority = priority; }
public void PreviousStage() { int numStages = Stages.Count(); if (numStages == 1) { return; } for (int i = 0; i < numStages; i++) { if (Stages[i].Order == SelectedStage.Order) { if (i == 0) { SelectedStage = Stages.Last(); } else { SelectedStage = Stages[(i - 1) % (numStages)]; } break; } } }
private void DetermineStage() { if (GetDistance(GetAreaHash(357, 659, 400, 695), 10000887605555998670) < distanceThresh) { currentStage = Stages.MainMenu; StageDisplay.Content = "Main Menu"; } else if (GetDistance(GetAreaHash(965, 599, 1027, 659), 2802059791646259758) < distanceThresh) { currentStage = Stages.PlayMode; StageDisplay.Content = "Play Mode"; } else if (GetDistance(GetAreaHash(641, 596, 732, 623), 2699223683689460834) < distanceThresh) { currentStage = Stages.StartingHand; StageDisplay.Content = "Starting Hand"; } else if (GetDistance(GetAreaHash(1072, 341, 1149, 363), 7540478887027917266) < distanceThresh || GetDistance(GetAreaHash(1071, 341, 1150, 359), 7918785258118000040) < distanceThresh || GetDistance(GetAreaHash(1065, 343, 1149, 364), 7301911271933560018) < distanceThresh) { currentStage = Stages.MyTurn; StageDisplay.Content = "My Turn"; } else if (GetDistance(GetAreaHash(1073, 344, 1151, 361), 2242749307094146982) < distanceThresh) { currentStage = Stages.OpponentTurn; StageDisplay.Content = "Opponent Turn"; } else { currentStage = Stages.Unknown; StageDisplay.Content = "Unknown"; } }
// Start is called before the first frame update void Start() { currentStage = Stages.WaitingForStart; rotationGesture = GameObject.Find("RotationGesture"); twistController = GameObject.Find("Controller").GetComponent <TwistController>(); rotationGesture.SetActive(false); }
/// Constructors of the MovePicker class. As arguments we pass information /// to help it to return the (presumably) good moves first, to decide which /// moves to return (in the quiescence search, for instance, we only want to /// search captures, promotions and some checks) and how important good move /// ordering is at the current node. internal MovePicker( Position p, MoveT ttm, Depth d, HistoryStats h, CounterMovesHistoryStats cmh, MoveT cm, StackArrayWrapper s) { endBadCaptures = new ExtMoveArrayWrapper(moves, _.MAX_MOVES - 1); cur = new ExtMoveArrayWrapper(moves); endMoves = new ExtMoveArrayWrapper(moves); pos = p; history = h; counterMovesHistory = cmh; ss = s; countermove = cm; depth = d; Debug.Assert(d > Depth.DEPTH_ZERO); stage = pos.checkers() != 0 ? Stages.EVASION : Stages.MAIN_SEARCH; ttMove = ttm != 0 && pos.pseudo_legal(ttm) ? ttm : Move.MOVE_NONE; endMoves += ttMove != Move.MOVE_NONE ? 1 : 0; }
/// <summary> /// Parses the releases feed for relevant information /// </summary> /// /// <returns>Success or Fail</returns> public bool Parse() { Stage = Stages.PARSE; try { string json = File.ReadAllText(tempReleasesPath); dynamic stuff = JArray.Parse(json); dynamic latest = stuff[0]; dynamic assets = latest.assets[0]; downloadURL = assets.browser_download_url; // get latest version number var match = System.Text.RegularExpressions.Regex.Match(downloadURL, @"([\d\.]+)\.zip"); latestVersion = match.Success ? match.Groups[1].Value : string.Empty; date = latest.published_at; Debug.WriteLine("Download URL: " + downloadURL); Debug.WriteLine("Date: " + date); } catch (Exception e) { Debug.Write(e.StackTrace.ToString()); return(false); } return(true); }
public static ClientEnvironmentConfiguration GetClientConfiguration( Clients client, Stages stage, TransactionMode transactionMode = TransactionMode.Normal) { return(new ClientEnvironmentConfiguration(client, stage, transactionMode)); }
/// <summary> /// Enables the ability to abort execution at the completion of a stage if any stage runner in that stage failed. /// </summary> /// <param name="stage">The stage at which to abort execution.</param> /// <returns>The builder.</returns> public IRunnerBuilder EnableFailStage(Stages stage) { // Switch on flag for a particular stage _config.FailStages |= stage; return(this); }
public void StartNextStep() { Action <Vector2> gestureNotificationHandler = (Vector2 delta) => { swipesController.UnsubscribeFromSwipe(gestureSubscriptionID); gestureSubscriptionID = swipesController.SubscribeToSwipe(SwipesController.Swipe.Ending, (Vector2 delta1) => { swipesController.UnsubscribeFromSwipe(gestureSubscriptionID); StartNextStep(); }); }; currentStage++; List <Tuple <TutorialScript.Actions, GameObject> > newPermittedActions = new List <Tuple <TutorialScript.Actions, GameObject> >(); switch (currentStage) { case Stages.WaitingForStart: break; case Stages.SwipeDown: newPermittedActions.Add(new Tuple <TutorialScript.Actions, GameObject>(TutorialScript.Actions.SwipeDown, null)); permitedActionSetter(newPermittedActions); tutorialSwipeDown.SetActive(true); gestureSubscriptionID = swipesController.SubscribeToSwipe(SwipesController.Swipe.Down, gestureNotificationHandler); break; case Stages.SwipeUp: tutorialSwipeDown.SetActive(false); newPermittedActions.Add(new Tuple <TutorialScript.Actions, GameObject>(TutorialScript.Actions.SwipeUp, null)); permitedActionSetter(newPermittedActions); tutorialSwipeUp.SetActive(true); gestureSubscriptionID = swipesController.SubscribeToSwipe(SwipesController.Swipe.Up, gestureNotificationHandler); break; case Stages.SwipeLeft: newPermittedActions.Add(new Tuple <TutorialScript.Actions, GameObject>(TutorialScript.Actions.SwipeLeft, null)); permitedActionSetter(newPermittedActions); tutorialSwipeUp.SetActive(false); tutorialSwipeLeft.SetActive(true); gestureSubscriptionID = swipesController.SubscribeToSwipe(SwipesController.Swipe.Left, gestureNotificationHandler); break; case Stages.SwipeRight: newPermittedActions.Add(new Tuple <TutorialScript.Actions, GameObject>(TutorialScript.Actions.SwipeRight, null)); permitedActionSetter(newPermittedActions); tutorialSwipeLeft.SetActive(false); tutorialSwipeRight.SetActive(true); gestureSubscriptionID = swipesController.SubscribeToSwipe(SwipesController.Swipe.Right, gestureNotificationHandler); break; case Stages.End: tutorialSwipeRight.SetActive(false); permitedActionSetter(newPermittedActions); actionOnComplete(); currentStage = Stages.WaitingForStart; break; } }
public ActionResult AddExtraTime(PassangerStageVM s, int id) { try { Stages addEx = context.Stages.Where(x => x.StageID == id).SingleOrDefault(); List <Passanger> pa = context.passangers.Where(x => x.PassangerStageId == id).ToList(); addEx.ExtraTime = s.stages.ExtraTime; addEx.EstimatedTime += Convert.ToInt32(addEx.ExtraTime); s.passanger = pa; s.stages = addEx; context.SaveChanges(); } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx) { Exception raise = dbEx; foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { string message = string.Format("{0}:{1}", validationErrors.Entry.Entity.ToString(), validationError.ErrorMessage); // raise a new exception nesting // the current instance as InnerException raise = new InvalidOperationException(message, raise); } } throw raise; } return(RedirectToAction("StageDetails", new { id = id })); }
public void Stages_SetEffects_SimpleTestAllToThrowOnNullStage() { //Too many asserts for one test, but all are very simple, so laziness prevails var renderStageManager = Substitute.For <IRenderStageManager>(); var viewportManager = Substitute.For <IViewportManager>(); var renderStageVisitor = Substitute.For <IRenderStageVisitor>(); IStages stages = new Stages(renderStageManager, viewportManager, renderStageVisitor); Assert.Throws <Yak2DException>(() => { stages.SetColourEffectsConfig(null, new ColourEffectConfiguration()); }); Assert.Throws <Yak2DException>(() => { stages.SetBloomConfig(null, new BloomEffectConfiguration()); }); Assert.Throws <Yak2DException>(() => { stages.SetBlurConfig(null, new BlurEffectConfiguration()); }); Assert.Throws <Yak2DException>(() => { stages.SetBlur1DConfig(null, new Blur1DEffectConfiguration()); }); Assert.Throws <Yak2DException>(() => { stages.SetStyleEffectsGroupConfig(null, new StyleEffectGroupConfiguration()); }); Assert.Throws <Yak2DException>(() => { stages.SetStyleEffectsPixellateConfig(null, new PixellateConfiguration()); }); Assert.Throws <Yak2DException>(() => { stages.SetStyleEffectsEdgeDetectionConfig(null, new EdgeDetectionConfiguration()); }); Assert.Throws <Yak2DException>(() => { stages.SetStyleEffectsStaticConfig(null, new StaticConfiguration()); }); Assert.Throws <Yak2DException>(() => { stages.SetStyleEffectsOldMovieConfig(null, new OldMovieConfiguration()); }); Assert.Throws <Yak2DException>(() => { stages.SetStyleEffectsCrtConfig(null, new CrtEffectConfiguration()); }); Assert.Throws <Yak2DException>(() => { stages.SetMeshRenderLightingProperties(null, new MeshRenderLightingPropertiesConfiguration()); }); Assert.Throws <Yak2DException>(() => { stages.SetMeshRenderLights(null, new MeshRenderLightConfiguration[1]); }); Assert.Throws <Yak2DException>(() => { stages.SetMeshRenderMesh(null, new Vertex3D[1]); }); Assert.Throws <Yak2DException>(() => { stages.SetDistortionConfig(null, new DistortionEffectConfiguration()); }); Assert.Throws <Yak2DException>(() => { stages.SetMixStageProperties(null, Vector4.One); }); Assert.Throws <Yak2DException>(() => { stages.SetCustomShaderUniformValues(null, "none", new Vertex2D()); }); Assert.Throws <Yak2DException>(() => { stages.SetCustomShaderUniformValues(null, "none", new Vertex2D[1]); }); }
// Use this for initialization void Start() { _Sensor = KinectSensor.GetDefault(); if (_Sensor != null) { _Reader = _Sensor.ColorFrameSource.OpenReader(); var frameDesc = _Sensor.ColorFrameSource.CreateFrameDescription(ColorImageFormat.Rgba); imageHeight = frameDesc.Height; imageWidth = frameDesc.Width; _RedData = new byte[frameDesc.BytesPerPixel * frameDesc.LengthInPixels]; _GreenData = new byte[frameDesc.BytesPerPixel * frameDesc.LengthInPixels]; _BlueData = new byte[frameDesc.BytesPerPixel * frameDesc.LengthInPixels]; if (!_Sensor.IsOpen) { _Sensor.Open(); } } GetComponent <SpriteRenderer>().color = Color.red; currentStage = Stages.RED_COLLECT; debugMode = true; }
public void ShowMessage(string message) { Visible = true; _stages = Stages.Build; Text = message; _timeLeft = 1.0f; }
public void StartNextStep() { Action <float> gestureNotificationHandler = (float angle) => { twistController.UnsubscribeFromTwist(twistSubscriptionID); twistSubscriptionID = twistController.SubscribeToTwist(TwistController.Twist.Ending, (float _) => { twistController.UnsubscribeFromTwist(twistSubscriptionID); StartNextStep(); }); }; currentStage++; List <Tuple <TutorialScript.Actions, GameObject> > newPermittedActions = new List <Tuple <TutorialScript.Actions, GameObject> >(); switch (currentStage) { case Stages.WaitingForStart: break; case Stages.Rotation: newPermittedActions.Add(new Tuple <TutorialScript.Actions, GameObject>(TutorialScript.Actions.Twist, null)); permitedActionSetter(newPermittedActions); rotationGesture.SetActive(true); twistSubscriptionID = twistController.SubscribeToTwist(TwistController.Twist.Twist, gestureNotificationHandler); break; case Stages.End: rotationGesture.SetActive(false); permitedActionSetter(newPermittedActions); actionOnComplete(); currentStage = Stages.WaitingForStart; break; } }
private static string GetHeaderName(ControllerContext context, Stages stage) { var contrAction = context.HttpContext.Items[CONTEXT_HEADER_KEY]; var ret = string.Format("Profiling:{0} ({1})", contrAction, stage); return(ret); }
public void DisableTutorial() { pinchController.UnsubscribeFromPinch(gestureSubscriptionID); tutorialZoomIn.SetActive(false); tutorialZoomOut.SetActive(false); currentStage = currentStage = Stages.WaitingForStart; }
/// <summary> /// Disables the specified stage. /// </summary> /// <param name="stage">The stage to disable.</param> /// <returns>The builder.</returns> public IRunnerBuilder DisableStage(Stages stage) { // Subtract flag value in configuration to disable stage _config.Stages -= stage; return(this); }
public PhotosystemWing(SystemHandler handler) : base(handler.Content.Load<Texture2D>("Textures/PhotosystemWing"), handler) { this.Stage = Stages.Text; this.Player = new Electron(this.Handler.Content.Load<Texture2D>("Textures/Electron"), this.Handler, new Vector2(300, 500)); this.PhGen = new PhotonGenerator(this, 12); this.HasStart = false; }
public Enemy(Texture2D tex, float x, float y, int hp, int dmg, float sp, Stages.Stage stage) : base(tex, x, y) { hitPoints = hp; damages = dmg; Speed = sp; IsGrounded = false; }
public PhotosystemETC(SystemHandler handler) : base(handler.Content.Load<Texture2D>("Textures/ETC"), handler) { this.Stage = Stages.Text; this.Player = new Electron(this.Handler.Content.Load<Texture2D>("Textures/Electron"), this.Handler, new Vector2(120, 300)); //this.WallGen = new WallGenerator(this, 6); this.HasStart = false; this.LastKey = false; }
/// <summary>���������� ����������</summary> public CollateLight(WMSClient MainProcess, string lightBarcode) : base(MainProcess, 1) { LightBarcode = lightBarcode; IsLoad = true; stage = Stages.Begin; DrawControls(); }
public static void Update(KeyboardState new_key, GameTime gameTime) { if (Game1.Variables.currentWindow != Game1.Variables.CurrentWindow.SelectStage) return; UpdatePosition(P1); if (!Other.Functions.PermiteKeyPressed(new_key)) return; if (new_key.IsKeyDown(Keys.S)) { Game1.Variables.Input.keyPressed = Keys.S; if (SelectedStage <= Stages.St02) { SelectedStage += 3; } } else if (new_key.IsKeyDown(Keys.W)) { Game1.Variables.Input.keyPressed = Keys.W; if (SelectedStage >= Stages.St03) { SelectedStage -= 3; } } else if (new_key.IsKeyDown(Keys.A)) { Game1.Variables.Input.keyPressed = Keys.A; if (SelectedStage != Stages.St00 && SelectedStage != Stages.St03) { SelectedStage -= 1; } } else if (new_key.IsKeyDown(Keys.D)) { Game1.Variables.Input.keyPressed = Keys.D; if (SelectedStage != Stages.St02 && SelectedStage != Stages.St05) { SelectedStage += 1; } } else if (new_key.IsKeyDown(Keys.Enter)) { Game1.Variables.Input.keyPressed = Keys.Enter; OtherScreens.LoadScreen_Manager.ShowLoadScreen(Content); //Players.Player_Manager.LoadGame(); //Game1.Variables.currentWindow = Game1.Variables.CurrentWindow.Game; } }
public Projectile(Texture2D tex, float _x, float _y, int dmg, bool dir, Stages.Stage sta, bool e) : base(tex, _x, _y) { direction = dir; damages = dmg; timer = 200; stage = sta; Speed = 1; enemy = e; }
public static void LoadSelectStageMenu(ContentManager content) { Content = content; SelectedStage = Stages.St00; P1 = Players.Player_Manager.Player_Array[0]; LoadAnimations(); }
private static void BuildUpSteps(IObjectBuildContext ctx, Stages stage) { try { for (int idx = 0; idx < ctx.Policies.Count; idx++) { if (ctx.Policies[idx].Stage == stage) ctx.Policies[idx].BuildUp(ctx); } } catch (Exception ex) { ExceptionHelper.ThrowBuildUpError(ex, stage); } }
public Roller(float x, float y, Stages.Stage _stage) : base(ATexture.RollerSprite, x, y, HpDifficult, 1, 1, _stage) { stage = _stage; this.FrameCol = 4; this.Timer = 0; // Intervalle entre 2 boucles d'animations this.AnimationSpeed = 5; // Vitesse d'animation Hitbox = new Rectangle((int)x, (int)y, 150, 150); Spritebox = new Rectangle((int)x, (int)y, 150, 150); damagebox = new Rectangle((int)x + 17, (int)y, 80, 15); Timing = 0; LoopTime = 256; Speed = 4; exists = true; }
public Shooter(float x, float y, Stages.Stage _stage) : base(ATexture.ShooterSheet, x, y, 1, 1, 1, _stage) { stage = _stage; this.FrameCol = 4; this.Timer = 0; // Intervalle entre 2 boucles d'animations this.AnimationSpeed = 5; // Vitesse d'animation prTimer = 0; Hitbox = new Rectangle((int)x, (int)y, 150, 150); Spritebox = new Rectangle((int)x, (int)y, 150, 150); damagebox = Rectangle.Empty; color = Color.White; Timing = 0; LoopTime = 256; Speed = 4; prSpeed = 15; exists = true; hit = false; }
protected void AddStep(Stages stage, Messages messageName, Modes mode, string entityName, string actionName, params string[] columns) { var list = _newRegisteredEvents; var step = new Step(this, messageName, stage, mode, entityName, actionName, columns); if (step.Method == null) { throw new InvalidPluginExecutionException(string.Format("The method {0}.{1} used during {2} message does not exist or is private", ChildClassName, actionName, messageName)); } else if (!step.Method.IsPublic || step.Method.IsStatic) { throw new InvalidPluginExecutionException(string.Format("The method {0}.{1} used during {2} message should be public and not static", ChildClassName, actionName, messageName)); } foreach (var param in step.Method.GetParameters()) { if (!param.ParameterType.IsInterface || (!typeof(IPluginContext).IsAssignableFrom(param.ParameterType) && (!typeof(IService).IsAssignableFrom(param.ParameterType)))) { throw new InvalidPluginExecutionException(string.Format("{0}.{1} parameter : {2}. Only IPluginContext and IService interfaces are allowed as parameters", ChildClassName, actionName, param.Name)); } } list.Add(step); }
private DeliverablePaths GetStageJournalPath(Stages stage) { var currStage = GetEnumDescription(stage); var filteredJC = from jc in JournalsPaths where ( jc["Stage"].ToString() == currStage && jc["Acronym"].ToString() == SelectedJournal) select jc; return new DeliverablePaths() { WebPDF = GetDeliverablePath(DeliverablePath.WebPDF, filteredJC), PrintPDF = GetDeliverablePath(DeliverablePath.PrintPDF, filteredJC), ProofPDF = GetDeliverablePath(DeliverablePath.ProofPDF, filteredJC), XPDF1 = GetDeliverablePath(DeliverablePath.XPDF1, filteredJC), XPDF2 = GetDeliverablePath(DeliverablePath.XPDF2, filteredJC), Metadata = GetDeliverablePath(DeliverablePath.Metadata, filteredJC), XML = GetDeliverablePath(DeliverablePath.XML, filteredJC), PS1 = GetDeliverablePath(DeliverablePath.PS1, filteredJC), PS2 = GetDeliverablePath(DeliverablePath.PS2, filteredJC), TK = GetDeliverablePath(DeliverablePath.TK, filteredJC), GraphicFiles1 = GetDeliverablePath(DeliverablePath.GraphicFiles1, filteredJC), GraphicFiles2 = GetDeliverablePath(DeliverablePath.GraphicFiles2, filteredJC), }; }
private Deliverables GetStageDeliverableDetails(Stages stage) { var currStage = GetEnumDescription(stage); var filteredJC = from jc in JournalsDetails where ( jc["Stage"].ToString() == currStage && jc["Acronym"].ToString() == SelectedJournal) select jc; return new Deliverables() { PDF = isChecked(DeliverableItem.PDF, filteredJC), Proof = isChecked(DeliverableItem.Proof, filteredJC), XPDF = isChecked(DeliverableItem.XPDF, filteredJC), Metadata = isChecked(DeliverableItem.Metadata, filteredJC), TK = isChecked(DeliverableItem.TK, filteredJC), XML = isChecked(DeliverableItem.XML, filteredJC), PS = isChecked(DeliverableItem.PS, filteredJC), GraphicFiles = isChecked(DeliverableItem.GraphicFiles, filteredJC) }; }
internal MovePicker(Position p, MoveT ttm, HistoryStats h, CounterMovesHistoryStats cmh, ValueT th) { endBadCaptures = new ExtMoveArrayWrapper(moves, _.MAX_MOVES - 1); cur = new ExtMoveArrayWrapper(moves); endMoves = new ExtMoveArrayWrapper(moves); pos = p; history = h; counterMovesHistory = cmh; threshold = th; Debug.Assert(pos.checkers() == 0); stage = Stages.PROBCUT; // In ProbCut we generate captures with SEE higher than the given threshold ttMove = ttm != 0 && pos.pseudo_legal(ttm) && pos.capture(ttm) && pos.see(ttm) > threshold ? ttm : Move.MOVE_NONE; endMoves += (ttMove != Move.MOVE_NONE) ? 1 : 0; }
private void SetTimer(Stages stage) { _currentStage = stage; PauseTimerPanel.Visibility = Visibility.Collapsed; // Set time left using the value from dictionary. _stageTimer.SetTimeLeft(_stagesValues[stage], true); _pauseTimer.Reset(); SetStartStopBtnAsStop(); TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Normal; }
private static void TearDownSteps(object instance, IObjectBuildContext ctx, Stages stage) { try { for (int idx = ctx.Policies.Count - 1; idx >= 0; idx--) { if (ctx.Policies[idx].Stage == stage) ctx.Policies[idx].TearDown(instance, ctx); } } catch (Exception ex) { ExceptionHelper.ThrowTearDownError(ex, stage); } }
/// generate_next_stage() generates, scores and sorts the next bunch of moves, /// when there are no more moves to try for the current stage. private void generate_next_stage() { Debug.Assert(stage != Stages.STOP); cur.set(moves); switch (++stage) { case Stages.GOOD_CAPTURES: case Stages.QCAPTURES_1: case Stages.QCAPTURES_2: case Stages.PROBCUT_CAPTURES: case Stages.RECAPTURES: { endMoves = Movegen.generate(GenType.CAPTURES, pos, new ExtMoveArrayWrapper(moves)); score(GenType.CAPTURES); } break; case Stages.KILLERS: killers[0] = new ExtMove(ss[ss.current].killers0, killers[0].Value); killers[1] = new ExtMove(ss[ss.current].killers1, killers[1].Value); killers[2] = new ExtMove(countermove, killers[2].Value); cur.set(killers); endMoves = new ExtMoveArrayWrapper(cur.table, cur.current + 2 + ((countermove != killers[0] && countermove != killers[1]) ? 1 : 0)); break; case Stages.GOOD_QUIETS: { endQuiets = Movegen.generate(GenType.QUIETS, pos, new ExtMoveArrayWrapper(moves)); endMoves = endQuiets; score(GenType.QUIETS); endMoves = ExtMoveArrayWrapper.Partition(cur, endMoves); ExtMoveArrayWrapper.insertion_sort(cur, endMoves); } break; case Stages.BAD_QUIETS: cur = new ExtMoveArrayWrapper(endMoves); endMoves = endQuiets; if (depth >= 3*Depth.ONE_PLY_C) { ExtMoveArrayWrapper.insertion_sort(cur, endMoves); } break; case Stages.BAD_CAPTURES: // Just pick them in reverse order to get correct ordering cur = new ExtMoveArrayWrapper(moves) + (_.MAX_MOVES - 1); endMoves = endBadCaptures; break; case Stages.ALL_EVASIONS: { endMoves = Movegen.generate(GenType.EVASIONS, pos, new ExtMoveArrayWrapper(moves)); if (endMoves.current > 1) { score(GenType.EVASIONS); } } break; case Stages.CHECKS: { endMoves = Movegen.generate( GenType.QUIET_CHECKS, pos, new ExtMoveArrayWrapper(moves)); } break; case Stages.EVASION: case Stages.QSEARCH_WITH_CHECKS: case Stages.QSEARCH_WITHOUT_CHECKS: case Stages.PROBCUT: case Stages.RECAPTURE: case Stages.STOP: stage = Stages.STOP; break; default: Debug.Assert(false); break; } }
public static void ThrowBuildUpError(Exception inner, Stages stage) { throw new ObjectBuilderException(string.Format("Exception occur on build up stage [{0}]", stage), inner); }
public void Draw(SpriteBatch spriteBatch, float progress, Stages stage) { if (current_shake == null || current_circle == null || current_trace == null) setState(myState); if (myType == Movement.Types.Shake) { spriteBatch.Draw(current_shake, shakePos, Color.White); } else if (myType == Movement.Types.Wave) { switch (stage) { case Stages.Show: // draw the start circle spriteBatch.Draw(circleTexture, new Vector2(startCoordinate.X, GameEngine.HEIGHT - startCoordinate.Y), null, Color.White, 0.0f, CircleOrigin, 1.0f, SpriteEffects.None, 0.0f); spriteBatch.Draw(ringTexture, new Vector2(startCoordinate.X, GameEngine.HEIGHT - startCoordinate.Y), null, Color.Lerp(Color.White, Color.Transparent, progress), 0.0f, RingOrigin, 1 - progress, SpriteEffects.None, 0.0f); float lastPx = -1; float lastPy = -1; int count = 1; foreach (Vector2 p in f.drawPositions){ float index = count / (float)(f.drawPositions.Length); if (index < progress) { Vector2 ori = new Vector2(p.X - traceTexture.Width / 2, p.Y - traceTexture.Height / 2); spriteBatch.Draw(traceTexture, ori, Color.White); lastPx = p.X; lastPy = p.Y; } count++; } break; case Stages.Ready: spriteBatch.Draw(circleTexture, new Vector2(startCoordinate.X, GameEngine.HEIGHT - startCoordinate.Y), null, Color.Lerp(Color.White, Color.Transparent, progress), 0.0f, CircleOrigin, 1.0f, SpriteEffects.None, 0.0f); float lPx = -1; float lPy = -1; int cnt = 1; foreach (Vector2 p in f.drawPositions) { float index = cnt / (float)(f.drawPositions.Length); Texture2D tempT = traceTexture; if (index < progress) tempT = current_trace; Vector2 ori = new Vector2(p.X - tempT.Width / 2, p.Y - tempT.Height / 2); spriteBatch.Draw(tempT, ori, Color.White); lPx = p.X; lPy = p.Y; cnt++; } spriteBatch.Draw(endTexture, new Vector2(endCoordinate.X, GameEngine.HEIGHT - endCoordinate.Y), null, Color.Lerp(Color.White, Color.Transparent, progress), 0.0f, CircleOrigin, 1.0f, SpriteEffects.None, 0.0f); break; case Stages.Fade: Color alpha = Color.Lerp(Color.White, Color.Transparent, progress); // spriteBatch.Draw(circleTexture, new Vector2(startCoordinate.X, GameEngine.HEIGHT - startCoordinate.Y), null, alpha, 0.0f, CircleOrigin, 1.0f, SpriteEffects.None, 0.0f); float lPx2 = -1; float lPy2 = -1; foreach (Vector2 p in f.drawPositions) { Vector2 ori = new Vector2(p.X - traceTexture.Width / 2, p.Y - traceTexture.Height / 2); spriteBatch.Draw(current_trace, ori, alpha); lPx2 = p.X; lPy2 = p.Y; } spriteBatch.Draw(endTexture, new Vector2(endCoordinate.X, GameEngine.HEIGHT - endCoordinate.Y), null, alpha, 0.0f, CircleOrigin, 1.0f, SpriteEffects.None, 0.0f); break; default: break; } } }
/// <summary>Выбрано "Ремонт"</summary> private void repair_Click() { Stage = Stages.Repair; DrawControls(); }
public static void ThrowTearDownError(Exception inner, Stages stage) { throw new ObjectBuilderException(string.Format("Exception occur on tear down stage [{0}]", stage), inner); }
/// <summary>Выбрано "Списание"</summary> private void writeoff_Click() { Stage = Stages.Writeoff; DrawControls(); }
public override void OnHotKey(KeyAction TypeOfAction) { switch (TypeOfAction) { case KeyAction.Esc: //Якщо знаходимось на першому кроці - Вихід if (Stage == Stages.First) { MainProcess.ClearControls(); MainProcess.Process = new SelectingLampProcess(MainProcess); } else { //Інакше - на перший крок Stage = Stages.First; DrawControls(); } break; } }
/// <summary>Выбрано "Приемка"</summary> private void acceptanceFrom_Click() { Stage = Stages.AcceptanceFrom; DrawControls(); }
public Boss(float x, float y, Stages.Stage _stage) : base(ATexture.Boss, x, y, HpBoss, 1, 1, _stage) { listCanon = new List<Rectangle>(); direction = new Vector2(-18, -18); if (Menu.lvl_selected == 1) { Pos = new Vector2(8000, 350); HitboxSalve1 = new Rectangle(7950, 500, 100, 100); HitboxSalve2 = new Rectangle(7950, 350, 100, 100); HitboxSalve3 = new Rectangle(7950, 200, 100, 100); HitboxCanon = new Rectangle(7950, 500, 100, 100); HitboxPilon1 = new Rectangle(7175, 0, 100, 100); HitboxPilon2 = new Rectangle(7450, 0, 100, 100); HitboxPilon3 = new Rectangle(7725, 0, 100, 100); } stage = _stage; this.FrameCol = 0; this.Timer = 0; // Intervalle entre 2 boucles d'animations //AnimationSpeed = 5; // Vitesse d'animation lockCamera = false; Effect = new SpriteEffects(); Hitbox = new Rectangle((int)x, (int)y, 350, 350); Spritebox = new Rectangle((int)x, (int)y, 350, 350); damagebox = new Rectangle((int)x + 17, (int)y, 300, 300); if (Menu.lvl_selected == 2) { Pos = new Vector2(8000+2500, 350); HitboxSalve1 = new Rectangle(7950+2500, 500, 100, 100); HitboxSalve2 = new Rectangle(7950+2500, 350, 100, 100); HitboxSalve3 = new Rectangle(7950+2500, 200, 100, 100); HitboxCanon = new Rectangle(7950+2500, 500, 100, 100); HitboxPilon1 = new Rectangle(7175+2500, 0, 100, 100); HitboxPilon2 = new Rectangle(7450+2500, 0, 100, 100); HitboxPilon3 = new Rectangle(7725+2500, 0, 100, 100); } //Sound MultiShot = ATexture.Attack1; MultiShotInst = MultiShot.CreateInstance(); MultiShotInst.Volume = Menu.VolumeSFX; BigShot = ATexture.Attack2; BigShotInst = BigShot.CreateInstance(); BigShotInst.Volume = Menu.VolumeSFX; Pilon = ATexture.Attack3; PilonInst = Pilon.CreateInstance(); PilonInst.Volume = Menu.VolumeSFX; //Attacks Initial Positions //listCanon.Add(HitboxSalve1); listCanon.Add(HitboxSalve2); listCanon.Add(HitboxSalve3); listCanon.Add(HitboxCanon); listCanon.Add(HitboxPilon1); listCanon.Add(HitboxPilon2); listCanon.Add(HitboxPilon3); //Timing = 0; //LoopTime = 256; Speed = 4; exists = true; Shooting1 = false; Shooting2 = false; Shooting3 = false; }
internal MovePicker(Position p, MoveT ttm, Depth d, HistoryStats h, CounterMovesHistoryStats cmh, SquareT s) { endBadCaptures = new ExtMoveArrayWrapper(moves, _.MAX_MOVES - 1); cur = new ExtMoveArrayWrapper(moves); endMoves = new ExtMoveArrayWrapper(moves); pos = p; history = h; counterMovesHistory = cmh; Debug.Assert(d <= Depth.DEPTH_ZERO_C); if (pos.checkers() != 0) { stage = Stages.EVASION; } else if (d > Depth.DEPTH_QS_NO_CHECKS) { stage = Stages.QSEARCH_WITH_CHECKS; } else if (d > Depth.DEPTH_QS_RECAPTURES) { stage = Stages.QSEARCH_WITHOUT_CHECKS; } else { stage = Stages.RECAPTURE; recaptureSquare = s; ttm = Move.MOVE_NONE; } ttMove = ttm != 0 && pos.pseudo_legal(ttm) ? ttm : Move.MOVE_NONE; endMoves += (ttMove != Move.MOVE_NONE) ? 1 : 0; }
/// <summary>Выбрано "Обмен"</summary> private void exchange_Click() { Stage = Stages.Exchange; DrawControls(); }
public static Channel Find(Stages.Stage stage) { lock (ObjectLock) return Channels.Find(c => c.StageExists(stage)); }