/// <summary> /// Sets the inheritence parent. /// </summary> public void SetInherit(IPaletteTriple inherit) { Back.SetInherit(inherit.PaletteBack); Border.SetInherit(inherit.PaletteBorder); Content.SetInherit(inherit.PaletteContent); }
//DateTime startMonth = dt.AddDays(1 - dt.Day); //本月月初 //DateTime endMonth = startMonth.AddMonths(1).AddDays(-1); //本月月末// public string Get_DoctByDept(string json) { Back <Oudayschedule> back = new Back <Oudayschedule>(); string msg = ""; string xml = ""; try { int deptid = Convert.ToInt32(JsonHelper.GetVluesParentstr(json, "deptid")); DateTime today, subst, subend; today = DateTime.Now; subst = CommUtil.GetTimeStartByType("Week", today); subend = CommUtil.GetTimeEndByType("Week", today); DataTable doct = bll.QueryDoctByDept(deptid, today, subend); List <Oudayschedule> list = new List <Oudayschedule>(); if (doct == null || doct.Rows.Count == 0) { //提示无挂号医生 back.errcode = 0; back.errmsg = "暂无可挂号医生"; back.data = new List <Oudayschedule>(); } else { int mainNum = doct.Rows.Count; foreach (DataRow row in doct.Rows) { Oudayschedule days = new Oudayschedule(); BsUser user = new BsUser(); user.doctorid = Convert.ToInt32(row["id"]); user.name = row["docname"].ToString(); user.deptid = Convert.ToInt32(row["deptid"]); user.deptname = row["deptname"].ToString(); user.docgra = row["docgra"].ToString(); user.price = Convert.ToDouble(row["price"]); user.resume = row["resume"].ToString(); user.picture = row["picture"].ToString(); days.user = user; DataTable datalist = bll.QuerySchBydoct(user.doctorid, today, subend); List <Schdatecs> dates = new List <Schdatecs>(); foreach (DataRow rw in datalist.Rows) { Schdatecs sch = new Schdatecs(); //sch.id = Convert.ToInt32(rw["id"]); sch.scheduledate = Convert.ToDateTime(rw["scheduledate"]).ToString("MM-dd"); sch.week = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(Convert.ToDateTime(rw["scheduledate"]).DayOfWeek); dates.Add(sch); } days.list = dates; list.Add(days); } back.errcode = 0; back.errmsg = ""; xml = JsonHelper.getJsonByObject((Object)list); back.data = list; } }catch (Exception ex) { back.errcode = -1; back.errmsg = ex.Message; back.data = new List <Oudayschedule>(); } msg = JsonHelper.getJsonByObject((Object)back); return(msg); }
private void timer1_Tick(object sender, EventArgs e) { if (hardness == 1) { timer1.Interval = 100; hardmode = false; } if (hardness == 2) { timer1.Interval = 50; hardmode = false; } if (hardness == 3) { timer1.Interval = 50; hardmode = true; } for (int i = snake.li.Count() - 1; i >= 0; i--) { if (i == 0) { snake.GetSecondElement(); snake.GetTail(); snake.Move(); if (snake.path == 'U') { var temp1 = snake.li[0]; temp1.b = snake.SnakeHeadU; snake.li[0] = temp1; if (snake.li.Count() == 2) { var temp9 = snake.li[1]; temp9.b = snake.SnakeTailU; snake.li[1] = temp9; } } if (snake.path == 'D') { var temp1 = snake.li[0]; temp1.b = snake.SnakeHeadD; snake.li[0] = temp1; if (snake.li.Count() == 2) { var temp9 = snake.li[1]; temp9.b = snake.SnakeTailD; snake.li[1] = temp9; } } if (snake.path == 'L') { var temp1 = snake.li[0]; temp1.b = snake.SnakeHeadL; snake.li[0] = temp1; if (snake.li.Count() == 2) { var temp9 = snake.li[1]; temp9.b = snake.SnakeTailL; snake.li[1] = temp9; } } if (snake.path == 'R') { var temp1 = snake.li[0]; temp1.b = snake.SnakeHeadR; snake.li[0] = temp1; if (snake.li.Count() == 2) { var temp9 = snake.li[1]; temp9.b = snake.SnakeTailR; snake.li[1] = temp9; } } } else { var temp = snake.li[i]; temp.x = snake.li[i - 1].x; temp.y = snake.li[i - 1].y; if (i == 1) { if (snake.li.Count() != 2) { snake.GetSecondElement(); } } if (i == snake.li.Count() - 1 && snake.li.Count() != 2) { snake.GetTail(); temp = snake.li[i]; temp.x = snake.li[i - 1].x; temp.y = snake.li[i - 1].y; } if (i != 0 && i != 1 && i != snake.li.Count() - 1 && snake.li.Count() != 2) { temp.b = snake.li[i - 1].b; } snake.li[i] = temp; } } if ((snake.li[0].x == Berry.x) && (snake.li[0].y == Berry.y)) { count += 100; Score.Text = "Счёт:" + count.ToString(); Berry.ChangeThere(); var temp1 = snake.li.Last(); snake.li.Add(new Coordinate() { x = temp1.x, y = temp1.y, b = temp1.b }); } snake.GetTail(); Graphics g = Graphics.FromImage(bi); g.Clear(Color.LightBlue); for (int i = 0; i < snake.li.Count(); i++) { g.DrawImage(snake.li[i].b, snake.li[i].x * width, snake.li[i].y * height, width, height); } g.DrawImage(Berry.texture, Berry.x * width, Berry.y * height, 25, 25); for (int i = 1; i < snake.li.Count(); i++) { if ((snake.li[0].x == snake.li[i].x) && (snake.li[0].y == snake.li[i].y)) { gameover = true; break; } } if (hardmode && (snake.li[0].x < 0 || snake.li[0].y < 0 || snake.li[0].x >= 20 || snake.li[0].y >= 20)) { gameover = true; } if (hardmode == false) { if (snake.li[0].x < 0) { var temp = snake.li[0]; temp.x = 19; snake.li[0] = temp; } if (snake.li[0].x >= 20) { var temp = snake.li[0]; temp.x = 0; snake.li[0] = temp; } if (snake.li[0].y >= 20) { var temp = snake.li[0]; temp.y = 0; snake.li[0] = temp; } if (snake.li[0].y < 0) { var temp = snake.li[0]; temp.y = 19; snake.li[0] = temp; } } if (gameover) { gamestarted = false; timer1.Stop(); timer2.Stop(); youLose.Show(); button1.Show(); youLoseText.Show(); Back.Show(); ScoreWas.Text = "Счёт:" + count.ToString(); ScoreWas.Show(); } gameover = false; Monitor.Image = bi; }
private void BackvardButton_Click(object sender, RoutedEventArgs e) => Back?.Invoke(this, new RoutedEventArgs());
private void OnButtonCancelDeliveryClick(object o, EventArgs e) { Back?.Invoke(); }
//remove handle that has transition to this state public void RemoveBack(Handle endHandle) { Back.Remove(endHandle); }
void updateEquipmentList() { Head.disable(); LArm.disable(); RArm.disable(); Chest.disable(); Leg.disable(); Feet.disable(); Necklace.disable(); Ring.disable(); Back.disable(); //public Button Head, LArm, RArm, Chest, //Leg, Feet, Necklace, Ring, Back; foreach (Equipment equip in actor.getEquipment()) { //Debug.Log(equip.name + " BEING ADDED"); if (equip.getEquipmentPosition().Equals("Head")) { //Debug.Log ("HAT"); Head.setItem(equip); } if (equip.getEquipmentPosition().Equals("Necklace")) { Necklace.setItem(equip); } if (equip.getEquipmentPosition().Equals("LArm")) { LArm.setItem(equip); } if (equip.getEquipmentPosition().Equals("RArm")) { RArm.setItem(equip); } if (equip.getEquipmentPosition().Equals("Chest")) { Chest.setItem(equip); } if (equip.getEquipmentPosition().Equals("Leg")) { Leg.setItem(equip); } if (equip.getEquipmentPosition().Equals("Feet")) { Feet.setItem(equip); } if (equip.getEquipmentPosition().Equals("Ring")) { Ring.setItem(equip); } if (equip.getEquipmentPosition().Equals("Back")) { Back.setItem(equip); } } Head.updateIcon(); Necklace.updateIcon(); LArm.updateIcon(); RArm.updateIcon(); Chest.updateIcon(); Leg.updateIcon(); Feet.updateIcon(); Ring.updateIcon(); Back.updateIcon(); }
} //save changes //Add and remove methods for Next and Back elements protected virtual void AddBack(SMElementEditor e) { Back.Add(e); }
public virtual void Update(float elapsed) { sinceCheckedConnected += elapsed; if (sinceCheckedConnected >= ConnectedCheckFrequency) { sinceCheckedConnected -= ConnectedCheckFrequency; Connected = GamePad.GetState(PlayerIndex).IsConnected; } if (!Connected) { return; } GamePadState gamepadState; try { gamepadState = GamePad.GetState(PlayerIndex, GamePadDeadZone.None); } catch { return; } // Vibration if (leftMotor.Active) { leftMotor = UpdateMotor(leftMotor, elapsed); } if (rightMotor.Active) { rightMotor = UpdateMotor(rightMotor, elapsed); } if (leftMotor.LastAmount != leftMotor.CurrentAmount || rightMotor.LastAmount != rightMotor.CurrentAmount) { GamePad.SetVibration(PlayerIndex, leftMotor.CurrentAmount, rightMotor.CurrentAmount); } // Shoulders LeftShoulder = LeftShoulder.NextState(gamepadState.Buttons.LeftShoulder == ButtonState.Pressed, elapsed); RightShoulder = RightShoulder.NextState(gamepadState.Buttons.RightShoulder == ButtonState.Pressed, elapsed); // Triggers LeftTrigger = LeftTrigger.NextState(gamepadState.Triggers.Left, elapsed); RightTrigger = RightTrigger.NextState(gamepadState.Triggers.Right, elapsed); // Buttons Start = Start.NextState(gamepadState.Buttons.Start == ButtonState.Pressed); Back = Back.NextState(gamepadState.Buttons.Back == ButtonState.Pressed); A = A.NextState(gamepadState.Buttons.A == ButtonState.Pressed, elapsed); B = B.NextState(gamepadState.Buttons.B == ButtonState.Pressed, elapsed); X = X.NextState(gamepadState.Buttons.X == ButtonState.Pressed, elapsed); Y = Y.NextState(gamepadState.Buttons.Y == ButtonState.Pressed, elapsed); // D-Pad DPad = DPad.NextState(gamepadState.DPad.Up == ButtonState.Pressed, gamepadState.DPad.Down == ButtonState.Pressed, gamepadState.DPad.Left == ButtonState.Pressed, gamepadState.DPad.Right == ButtonState.Pressed, elapsed); // Deadzone that shit const float DeadZone = 0.2f; var left = new Vector2(gamepadState.ThumbSticks.Left.X, gamepadState.ThumbSticks.Left.Y); var right = new Vector2(gamepadState.ThumbSticks.Right.X, gamepadState.ThumbSticks.Right.Y); if (Math.Abs(left.x) < DeadZone) { left.x = 0; } else { left.x = (left.x - DeadZone * Math.Sign(left.x)) / (1 - DeadZone); } if (Math.Abs(left.y) < DeadZone) { left.y = 0; } else { left.y = (left.y - DeadZone * Math.Sign(left.y)) / (1 - DeadZone); } if (Math.Abs(right.x) < DeadZone) { right.x = 0; } else { right.x = (right.x - DeadZone * Math.Sign(right.x)) / (1 - DeadZone); } if (Math.Abs(right.y) < DeadZone) { right.y = 0; } else { right.y = (right.y - DeadZone * Math.Sign(right.y)) / (1 - DeadZone); } // Thumbsticks LeftStick = LeftStick.NextState(left, gamepadState.Buttons.LeftStick == ButtonState.Pressed, elapsed); RightStick = LeftStick.NextState(right, gamepadState.Buttons.RightStick == ButtonState.Pressed, elapsed); }
public void Update(TimeSpan elapsed) { if (!Connected) { return; } State state = Controller.GetState(); var gamepadState = state.Gamepad; // Sadly we can't really use the packet information because everything is temporal // Even if everything stayed the same, that's valid data (elapsed time goes up, etc.) // Vibration if (leftMotor.Active) { leftMotor = UpdateMotor(leftMotor, elapsed); } if (rightMotor.Active) { rightMotor = UpdateMotor(rightMotor, elapsed); } if (leftMotor.LastAmount != leftMotor.CurrentAmount || rightMotor.LastAmount != rightMotor.CurrentAmount) { Controller.SetVibration(new Vibration { LeftMotorSpeed = (ushort)(leftMotor.CurrentAmount * ushort.MaxValue), RightMotorSpeed = (ushort)(rightMotor.CurrentAmount * ushort.MaxValue) }); } // Shoulders LeftShoulder = LeftShoulder.NextState((gamepadState.Buttons & GamepadButtonFlags.LeftShoulder) != 0, elapsed); RightShoulder = RightShoulder.NextState((gamepadState.Buttons & GamepadButtonFlags.RightShoulder) != 0, elapsed); // Triggers LeftTrigger = LeftTrigger.NextState(gamepadState.LeftTrigger / (float)byte.MaxValue, elapsed); RightTrigger = RightTrigger.NextState(gamepadState.RightTrigger / (float)byte.MaxValue, elapsed); // Buttons Start = Start.NextState((gamepadState.Buttons & GamepadButtonFlags.Start) != 0); Back = Back.NextState((gamepadState.Buttons & GamepadButtonFlags.Back) != 0); A = A.NextState((gamepadState.Buttons & GamepadButtonFlags.A) != 0, elapsed); B = B.NextState((gamepadState.Buttons & GamepadButtonFlags.B) != 0, elapsed); X = X.NextState((gamepadState.Buttons & GamepadButtonFlags.X) != 0, elapsed); Y = Y.NextState((gamepadState.Buttons & GamepadButtonFlags.Y) != 0, elapsed); // D-Pad DPad = DPad.NextState((gamepadState.Buttons & GamepadButtonFlags.DPadUp) != 0, (gamepadState.Buttons & GamepadButtonFlags.DPadDown) != 0, (gamepadState.Buttons & GamepadButtonFlags.DPadLeft) != 0, (gamepadState.Buttons & GamepadButtonFlags.DPadRight) != 0, elapsed); // Thumb sticks LeftStick = LeftStick.NextState( Normalize(gamepadState.LeftThumbX, gamepadState.LeftThumbY, Gamepad.GamepadLeftThumbDeadZone), (gamepadState.Buttons & GamepadButtonFlags.LeftThumb) != 0, elapsed); RightStick = RightStick.NextState( Normalize(gamepadState.RightThumbX, gamepadState.RightThumbY, Gamepad.GamepadRightThumbDeadZone), (gamepadState.Buttons & GamepadButtonFlags.RightThumb) != 0, elapsed); }
public void Initialize(string title, string detail, string subDetail) { Front.GetComponentInChildren <Text>().text = title; Back.GetComponentsInChildren <Text>()[0].text = subDetail; Back.GetComponentsInChildren <Text>()[1].text = detail; }
public void Draw(GameTime gameTime, SpriteBatch spriteBatch) { if (gameState == GameState.Playing) { // if the video is supposed to be on (the user hasn't set it to false in the options menu) play the video, otherwise use // an alternative background if (videoison) { Texture2D videoframe = videoplayer.GetTexture(); spriteBatch.Draw(videoframe, display, Color.White); } else { spriteBatch.Draw(alternativebackground, Vector2.Zero, Color.White); } // Draw the main playing grid, the HUD and the current block grid.Draw(gameTime, spriteBatch, block); // draw the bomb sprite if the block is indeed a bbomb if (newblock is BlockBOOM) { newblock.Draw(gameTime, spriteBatch, bombblock); } else { newblock.Draw(gameTime, spriteBatch, block); } hud.MainDraw(gameTime, spriteBatch, nextblock); } if (gameState == GameState.GameOver) { // if the game is over draw the HUD's gameover screen and the back button hud.GameOverScreen(gameTime, spriteBatch); Back.Draw(gameTime, spriteBatch); } if (gameState == GameState.Help) { // draw the help method and the back button hud.Help(gameTime, spriteBatch); Back.Draw(gameTime, spriteBatch); } if (gameState == GameState.Options) { // draw the background for the options menu hud.Options(gameTime, spriteBatch); // draw a button for the videoison button, which will be green if the video is on and red if it isn' t if (videoison) { Videobutton = new Button(videobuttonON, new Vector2(155, 250)); Videobutton.Draw(gameTime, spriteBatch); } else { Videobutton = new Button(videobuttonOFF, new Vector2(155, 250)); Videobutton.Draw(gameTime, spriteBatch); } // same for music, green if on, red if off. if (music) { Musicbutton = new Button(musicbuttonON, new Vector2(155, 130)); Musicbutton.Draw(gameTime, spriteBatch); } else { Musicbutton = new Button(musicbuttonOFF, new Vector2(155, 130)); Musicbutton.Draw(gameTime, spriteBatch); } // Draw the back button Back.Draw(gameTime, spriteBatch); } if (gameState == GameState.Menu) { // Draw the menu and the menu buttons hud.MenuScreen(gameTime, spriteBatch); Play.Draw(gameTime, spriteBatch); Options.Draw(gameTime, spriteBatch); Help.Draw(gameTime, spriteBatch); Back.Draw(gameTime, spriteBatch); } }
// InputHandler for the various game states public void HandleInput(GameTime gameTime, InputHelper inputHelper) { if (gameState == GameState.Menu) { // Check if the mousebutton is pressed, and if so if it was inside one of the boundingboxes of the buttons if (inputHelper.MouseLeftButtonPressed()) { if (Play.IsClicked(inputHelper)) { // stop the Mediaplayer (so that the game song can be played) and make the mouse invisible MediaPlayer.Stop(); TetrisGame.showmouse = false; // Reset the game Reset(); // Only play music in the main game if the user has it set to true in the options menu if (music) { MediaPlayer.Play(playing); Console.WriteLine(MediaPlayer.State); } if (videoison) { videoplayer.Play(backgroundvideo); videoplayer.IsLooped = true; } gameState = GameState.Playing; } // Switch to other menus depending on which button was clicked if (Help.IsClicked(inputHelper)) { TetrisGame.showmouse = true; gameState = GameState.Help; } if (Options.IsClicked(inputHelper)) { TetrisGame.showmouse = true; gameState = GameState.Options; } if (Back.IsClicked(inputHelper)) { // set a boolean in the main game clas to true so that it exits the game TetrisGame.exitgame = true; } } } if (gameState == GameState.Playing) { // Check if the current block even exists (this will never be the case but it is a failsafe) if (newblock != null) { // Rotate the block left, check if its new position is valid, and if not rotate it back to it's previous position if (inputHelper.KeyPressed(Keys.A, false)) { newblock.RotateLeft(); if (!grid.IsValid(newblock)) { newblock.RotateRight(); } } // Rotate the block right, check if its new position is valid, and if not rotate it back to it's previous position if (inputHelper.KeyPressed(Keys.D, false)) { newblock.RotateRight(); if (!grid.IsValid(newblock)) { newblock.RotateLeft(); } } if (inputHelper.KeyPressed(Keys.W, false)) { // Moves the current block down instantly, uses an optional boolean inside the TryMoveDown method to check if the block was placed // (otherwise the next block would go down a bit because the loop didn't exit yet) for (int i = 0; i < TetrisGrid.GridHeight; i++) { TryMoveDown(true); if (placed) { // break the loop if Trymovedown communicates that it placed a block placed = false; break; } } } // Try to move the block down (same kind of strategy as the rotate method, but a seperate method handles all 3 commands plus // a few additional extras) if (inputHelper.KeyPressed(Keys.S, true)) { TryMoveDown(); } // Same as with the rotate method, try to move left and if it is not valid do the reverse operation if (inputHelper.KeyPressed(Keys.Left, true)) { newblock.MoveLeft(); if (!grid.IsValid(newblock)) { newblock.MoveRight(); } } // Now the same but with moving right if (inputHelper.KeyPressed(Keys.Right, true)) { newblock.MoveRight(); if (!grid.IsValid(newblock)) { newblock.MoveLeft(); } } } } if (gameState == GameState.Options) { // options menu to turn music and the video background off if (inputHelper.MouseLeftButtonPressed()) { // Go back to the main menu if the back button is clicked if (Back.IsClicked(inputHelper)) { gameState = GameState.Loading; } // if the music button is clicked, change to boolean to its reverse (true to false or false to true) and stop the music // currently playing if it is set to false if (Musicbutton.IsClicked(inputHelper)) { music = !music; if (!music) { MediaPlayer.Stop(); } } // Change the boolean for the videobackground if the button is clicked if (Videobutton.IsClicked(inputHelper)) { videoison = !videoison; } } } // Check if the player has pressed the back button in the help or gameover screen (it is the same button in the same position) if (gameState == GameState.Help || gameState == GameState.GameOver) { if (inputHelper.MouseLeftButtonPressed()) { if (Back.IsClicked(inputHelper)) { gameState = GameState.Loading; } } } }
public override string ToString() { return(Containers.Count.ToString() + ", " + Front.ToString() + ", " + Back.ToString()); }
public static Back sInstance; //单例模式 /// <summary> /// 唤醒的时候 /// </summary> private void Awake() { sInstance = this; }
internal static float Ease(Type ease, float t, float duration) { switch (ease) { case Type.Linear: return(Linear.EaseNone(t, duration)); case Type.BackIn: return(Back.EaseIn(t, duration)); case Type.BackOut: return(Back.EaseOut(t, duration)); case Type.BackInOut: return(Back.EaseInOut(t, duration)); case Type.BounceIn: return(Bounce.EaseIn(t, duration)); case Type.BounceOut: return(Bounce.EaseOut(t, duration)); case Type.BounceInOut: return(Bounce.EaseInOut(t, duration)); case Type.CircIn: return(Circular.EaseIn(t, duration)); case Type.CircOut: return(Circular.EaseOut(t, duration)); case Type.CircInOut: return(Circular.EaseInOut(t, duration)); case Type.CubicIn: return(Cubic.EaseIn(t, duration)); case Type.CubicOut: return(Cubic.EaseOut(t, duration)); case Type.CubicInOut: return(Cubic.EaseInOut(t, duration)); case Type.ElasticIn: return(Elastic.EaseIn(t, duration)); case Type.ElasticOut: return(Elastic.EaseOut(t, duration)); case Type.ElasticInOut: return(Elastic.EaseInOut(t, duration)); case Type.Punch: return(Elastic.Punch(t, duration)); case Type.ExpoIn: return(Exponential.EaseIn(t, duration)); case Type.ExpoOut: return(Exponential.EaseOut(t, duration)); case Type.ExpoInOut: return(Exponential.EaseInOut(t, duration)); case Type.QuadIn: return(Quadratic.EaseIn(t, duration)); case Type.QuadOut: return(Quadratic.EaseOut(t, duration)); case Type.QuadInOut: return(Quadratic.EaseInOut(t, duration)); case Type.QuartIn: return(Quartic.EaseIn(t, duration)); case Type.QuartOut: return(Quartic.EaseOut(t, duration)); case Type.QuartInOut: return(Quartic.EaseInOut(t, duration)); case Type.QuintIn: return(Quintic.EaseIn(t, duration)); case Type.QuintOut: return(Quintic.EaseOut(t, duration)); case Type.QuintInOut: return(Quintic.EaseInOut(t, duration)); case Type.SineIn: return(Sinusoidal.EaseIn(t, duration)); case Type.SineOut: return(Sinusoidal.EaseOut(t, duration)); case Type.SineInOut: return(Sinusoidal.EaseInOut(t, duration)); default: return(Linear.EaseNone(t, duration)); } }
void OnGUI() { bool noob = playerData.CurrentPlayer.progress.Level[0].puzzle[0].puzzleRuns.Count == 0; if (GUI.Button(NewGame.AnchoredRect(), NewGame.content, NewGame.style)) { audio.Play(); if (!noob) { if (EditorUtility.DisplayDialog( "Warning!", "This will erase ALL your progress! This cannot be undone!", "Confirm", "Cancel") ) { playerData.ResetLevels(); puzzleParser.currentPuzzle = puzzleParser.allPuzzles.levels[0].puzzles[0]; Application.LoadLevel("Convo"); } } else { puzzleParser.currentPuzzle = puzzleParser.allPuzzles.levels[0].puzzles[0]; Application.LoadLevel("Convo"); } } GUI.enabled = !noob; if (GUI.Button(Resume.AnchoredRect(), Resume.content, Resume.style)) { audio.Play(); puzzleParser.currentPuzzle = NextPuzzle(); Application.LoadLevel("Game"); } GUI.enabled = true; if (GUI.Button(Back.AnchoredRect(), Back.content, Back.style)) { audio.Play(); MenuController.ChangeMenu(Back.menuObject, this.gameObject); } if (GUI.Button(BeginnerLevels.AnchoredRect(), BeginnerLevels.content, BeginnerLevels.style)) { audio.Play(); levelMenuGUI.level = 0; MenuController.ChangeMenu(LevelMenuObject, this.gameObject); } GUI.enabled = playerData.CurrentPlayer.progress.Level[2].puzzle[9].puzzleRuns.Count > 0; if (GUI.Button(IntermediateLevels.AnchoredRect(), IntermediateLevels.content, IntermediateLevels.style)) { audio.Play(); levelMenuGUI.level = 1; MenuController.ChangeMenu(LevelMenuObject, this.gameObject); } GUI.enabled = playerData.CurrentPlayer.progress.Level[5].puzzle[11].puzzleRuns.Count > 0; if (GUI.Button(AdvancedLevels.AnchoredRect(), AdvancedLevels.content, AdvancedLevels.style)) { audio.Play(); levelMenuGUI.level = 2; MenuController.ChangeMenu(LevelMenuObject, this.gameObject); } }
protected virtual void RemoveBack(SMElementEditor e) { Back.Remove(e); }
/** * Kotroler do wyswietlania i edycji aktywnosci **/ public ActivitiesController(List <Activity> activities) { Back.Clear(); Activities = activities; var stringactivitiesList = new List <string>(); while (true) { /** * Tutaj, bo przy edycji musi sie zaktualizowac, * wiec za kazdym razem trzeba czyscic i tworzyc liste stringow na nowo **/ stringactivitiesList.Clear(); stringactivitiesList.Add("Back"); foreach (var activity in Activities) { stringactivitiesList.Add(activity.ToString()); } /** END **/ var mainView = new MainView(stringactivitiesList); if (mainView.Selected == 0) //back { Back.Clear(); return; } var info = new Info(); var currentactivity = Activities[mainView.Selected - 1]; info.ShowValue(currentactivity); //wyswietl dane o wybranej aktywnosci switch (info.Selected) { case 0: //edit switch (Edit.Choose()) { case 0: //back Back.Clear(); break; case 1: //type if (SaveDB.SaveEditType(currentactivity, GetFromUser.GetTypeFromUser())) { Edit.Done(); } else { Edit.Error(); } break; case 2: //distance if (SaveDB.SaveEditDistance(currentactivity, GetFromUser.GetDistanceFromUser())) { Edit.Done(); } else { Edit.Error(); } break; case 3: //date if (SaveDB.SaveEditDate(currentactivity, GetFromUser.GetDateFromUser())) { Edit.Done(); } else { Edit.Error(); } break; case 4: //note if (SaveDB.SaveEditNote(currentactivity, GetFromUser.GetNoteFromUser())) { Edit.Done(); } else { Edit.Error(); } break; } break; case 1: //delete if (SaveDB.DeleteActivity(currentactivity, Activities)) { Delete.Deleted(); currentactivity = null; } else { Delete.Error(); } break; case 2: //back Back.Clear(); break; } } }
//add handle that has transition to this state public void AddBack(Handle h) { Back.Add(h); }
public static float Ease(EasingType easingFunction, float k) { switch (easingFunction) { case EasingType.Linear: return(Linear(k)); case EasingType.QuadraticIn: return(Quadratic.In(k)); case EasingType.QuadraticOut: return(Quadratic.Out(k)); case EasingType.QuadraticInOut: return(Quadratic.InOut(k)); case EasingType.CubicIn: return(Cubic.In(k)); case EasingType.CubicOut: return(Cubic.Out(k)); case EasingType.CubicInOut: return(Cubic.InOut(k)); case EasingType.QuarticIn: return(Quartic.In(k)); case EasingType.QuarticOut: return(Quartic.Out(k)); case EasingType.QuarticInOut: return(Quartic.InOut(k)); case EasingType.QuinticIn: return(Quintic.In(k)); case EasingType.QuinticOut: return(Quintic.Out(k)); case EasingType.QuinticInOut: return(Quintic.InOut(k)); case EasingType.SinusoidalIn: return(Sinusoidal.In(k)); case EasingType.SinusoidalOut: return(Sinusoidal.Out(k)); case EasingType.SinusoidalInOut: return(Sinusoidal.InOut(k)); case EasingType.ExponentialIn: return(Exponential.In(k)); case EasingType.ExponentialOut: return(Exponential.Out(k)); case EasingType.ExponentialInOut: return(Exponential.InOut(k)); case EasingType.CircularIn: return(Circular.In(k)); case EasingType.CircularOut: return(Circular.Out(k)); case EasingType.CircularInOut: return(Circular.InOut(k)); case EasingType.ElasticIn: return(Elastic.In(k)); case EasingType.ElasticOut: return(Elastic.Out(k)); case EasingType.ElasticInOut: return(Elastic.InOut(k)); case EasingType.BackIn: return(Back.In(k)); case EasingType.BackOut: return(Back.Out(k)); case EasingType.BackInOut: return(Back.InOut(k)); case EasingType.BounceIn: return(Bounce.In(k)); case EasingType.BounceOut: return(Bounce.Out(k)); case EasingType.BounceInOut: return(Bounce.InOut(k)); default: return(Linear(k)); } }
private void btn_Back_Click(object o, EventArgs e) { Back?.Invoke(); }
public override void Update() { if (active != null) { Visual.Update(); if (Globals.nextBlock.p >= Globals.wave.get_data_p() + Globals.wave.get_data_size()) { Globals.wave.reset(); } } if (focused) { //SCROLL UPDATE songbar.Update(); int Offset = songbar.ScaledMove(); //BUTTON UPDATE foreach (SongButton song in Songs) { song.Move(new Vector2(-Offset, 0)); song.Update(); } Point pos = Globals.currentMouseState.Position; foreach (SongButton s in Songs) { //Checks for mouse hovering over songbuttons if (s.Collide(pos))//check collision { if (Globals.currentMouseState.LeftButton == ButtonState.Released && clicked == s &&//THIS METHOD MAKES SURE YOU CANNOT RESELECT THE SAME SONG Math.Pow((pressedpoint - Globals.currentMouseState.Position).X, 2) + Math.Pow((pressedpoint - Globals.currentMouseState.Position).Y, 2) < 10000) { if (active != s) { active = s; bg = s.texture; if (Globals.wave != null) { Globals.wave.reset(); //reset previous song } Globals.wave = active.music; //new song Globals.waveAudio = new Audio(Globals.wave, 0); Visual = new Visualizer(Globals.wave); } } if (Globals.currentMouseState.LeftButton == ButtonState.Pressed && Globals.previousMouseState.LeftButton == ButtonState.Released) { clicked = s; pressedpoint = Globals.currentMouseState.Position; } if (Globals.currentMouseState.LeftButton == ButtonState.Released) { clicked = null; } s.Glow();//applies a glow effect } } //DRAGGING SCREEN move the screen with mouse/touchscreen if (Globals.currentMouseState.LeftButton == ButtonState.Pressed && 0 < Globals.currentMouseState.Position.Y && Globals.currentMouseState.Position.Y < Options.Resolutions.Y * 4 / 5 && !songbar.pressed) { if (Globals.currentMouseState.Position.X - Globals.previousMouseState.Position.X > 250)//added to avoid bug when click, release,click { dragspeed = 1; } else if (Globals.currentMouseState.Position.X - Globals.previousMouseState.Position.X < -250) { dragspeed = -1; } else { dragspeed = (Globals.currentMouseState.Position.X - Globals.previousMouseState.Position.X) / 4; } } if (Globals.currentMouseState.LeftButton == ButtonState.Released) { if (dragspeed > 0) { dragspeed -= .4; if (dragspeed < .3) { dragspeed = 0; } } else if (dragspeed < 0) { dragspeed += .4; if (dragspeed > -.3) { dragspeed = 0; } } } songbar.bar.X -= (int)dragspeed; songbar.Update(); //Button update-check for collisions if (Globals.previousMouseState.LeftButton == ButtonState.Pressed && Globals.currentMouseState.LeftButton == ButtonState.Released) { if (Play.Collide(pos)) { //this.manager.RegisterScene("Play", new LevelScene()); this.manager.AlmostCurrentScenes.Add("Background"); this.manager.AlmostCurrentScenes.Add("Level"); Globals.pathToCurrentMap = active.dmlfile; Globals.songname = active.title; this.manager.transitioningScenes = true; this.manager.FocusOn("Level"); } if (Back.Collide(pos)) { this.manager.AlmostCurrentScenes.Add("Background"); this.manager.AlmostCurrentScenes.Add("Main Menu"); this.manager.FocusOn("Main Menu"); this.manager.transitioningScenes = true; } } } }
/** * Kontroler do drugiego menu, po zalogowaniu **/ public CalendarController(User user) { this.user = user; while (true) { var mainView = new MainView(); mainView.user = user; mainView.score = GetFromDB.GetScore(user); mainView.Show(); switch (mainView.Selected) { case 0: //add if (AddActivity()) { Back.Clear(); string s = "Activity added"; int middle = (Console.WindowWidth - s.Length) / 2; Console.SetCursorPosition(middle, Console.CursorTop); Console.WriteLine(s); } else { Back.Clear(); string s = "Something goes wrong, activity not added"; int middle = (Console.WindowWidth - s.Length) / 2; Console.SetCursorPosition(middle, Console.CursorTop); Console.WriteLine(s); } break; case 1: //search var search = Search.Choose(); if (search == 0) { Back.Clear(); break; } var searchlist = GetSearchList(search); if ((searchlist == null) || (searchlist.Count == 0)) { Search.Empty(); } else { var searchactivitiesController = new ActivitiesController(searchlist); } break; case 2: //show var activitiesController = new ActivitiesController(GetFromDB.LoadList(user)); break; case 3: //logout user = null; Logout.Done(); return; case 4: //changegoal Goal.GetValues(); if (Check.CheckGoal(user, Goal.Newgoal)) { Goal.Done(); } else { Goal.BadValue(); } break; case 5: //setdivider var whichdivider = Divider.WhichDivider(); if (whichdivider == 0) { Back.Clear(); break; } Divider.GetValues(); switch (whichdivider) { case 1: if (Check.CheckBikeDivider(user, Divider.Divide)) { Divider.Done(); } else { Divider.BadValue(); } break; case 2: if (Check.CheckSwimDivider(user, Divider.Divide)) { Divider.Done(); } else { Divider.BadValue(); } break; } break; case 6: //changepassword ChangePassword.Change(); if (Check.CheckPassword(user, ChangePassword.Password, ChangePassword.Repassword)) { ChangePassword.Done(); } else { ChangePassword.WrongData(); } break; case 7: //Show values Values.ShowValues(user, GetFromDB.GetScore(user), GetFromDB.GetNumberOfActivities(user), GetFromDB.GetLastDate(user)); Back.Clear(); break; case 8: //exit Environment.Exit(0); break; default: break; } } }
void ReleaseDesignerOutlets() { if (Back != null) { Back.Dispose(); Back = null; } if (Dashboard != null) { Dashboard.Dispose(); Dashboard = null; } if (Front != null) { Front.Dispose(); Front = null; } if (Left != null) { Left.Dispose(); Left = null; } if (Odometer != null) { Odometer.Dispose(); Odometer = null; } if (Right != null) { Right.Dispose(); Right = null; } if (Rim != null) { Rim.Dispose(); Rim = null; } if (Seat != null) { Seat.Dispose(); Seat = null; } if (Seats != null) { Seats.Dispose(); Seats = null; } if (VIN != null) { VIN.Dispose(); VIN = null; } }
/* * protected IEnumerator CoFadeImageAlpha(float iterator, float time, float startA, float endA, Image image) * { * while (iterator < time) * { * iterator += Time.deltaTime; * if (iterator > time) iterator = time; * * float val = JoniUtility.Easing.GetTerpedPosition(iterator, time, JoniUtility.Easing.Function.Sinusoidal, JoniUtility.Easing.Direction.Out); * * float newA = Mathf.Lerp(startA, endA, val); * * Color col = image.color; * * image.color = new Color(col.r, col.g, col.b, newA); * yield return 0; * } * } */ public static float GetTerpedPosition(float time, float totalTime, Function function, Direction direction) { switch (function) { case Function.Quadratic: switch (direction) { case Direction.In: return(Quadratic.In(time / totalTime)); case Direction.Out: return(Quadratic.Out(time / totalTime)); default: return(Quadratic.InOut(time / totalTime)); } case Function.Cubic: switch (direction) { case Direction.In: return(Cubic.In(time / totalTime)); case Direction.Out: return(Cubic.Out(time / totalTime)); default: return(Cubic.InOut(time / totalTime)); } case Function.Quartic: switch (direction) { case Direction.In: return(Quartic.In(time / totalTime)); case Direction.Out: return(Quartic.Out(time / totalTime)); default: return(Quartic.InOut(time / totalTime)); } case Function.Quintic: switch (direction) { case Direction.In: return(Quintic.In(time / totalTime)); case Direction.Out: return(Quintic.Out(time / totalTime)); default: return(Quintic.InOut(time / totalTime)); } case Function.Sinusoidal: switch (direction) { case Direction.In: return(Sinusoidal.In(time / totalTime)); case Direction.Out: return(Sinusoidal.Out(time / totalTime)); default: return(Sinusoidal.InOut(time / totalTime)); } case Function.Exponential: switch (direction) { case Direction.In: return(Exponential.In(time / totalTime)); case Direction.Out: return(Exponential.Out(time / totalTime)); default: return(Exponential.InOut(time / totalTime)); } case Function.Circular: switch (direction) { case Direction.In: return(Circular.In(time / totalTime)); case Direction.Out: return(Circular.Out(time / totalTime)); default: return(Circular.InOut(time / totalTime)); } case Function.Elastic: switch (direction) { case Direction.In: return(Elastic.In(time / totalTime)); case Direction.Out: return(Elastic.Out(time / totalTime)); default: return(Elastic.InOut(time / totalTime)); } case Function.Back: switch (direction) { case Direction.In: return(Back.In(time / totalTime)); case Direction.Out: return(Back.Out(time / totalTime)); default: return(Back.InOut(time / totalTime)); } default: //Function.Bounce: switch (direction) { case Direction.In: return(Bounce.In(time / totalTime)); case Direction.Out: return(Bounce.Out(time / totalTime)); default: return(Bounce.InOut(time / totalTime)); } } }
private void OnButtonAddProductsClick(object o, EventArgs e) { Back?.Invoke(); }
/// <summary> /// Populate values from the base palette. /// </summary> /// <param name="state">Palette state to use when populating.</param> public void PopulateFromBase(PaletteState state) { Back.PopulateFromBase(state); Border.PopulateFromBase(state); Content.PopulateFromBase(state); }
private void OnButtonBackClick(object o, EventArgs e) { Back?.Invoke(); }
private int LCSMC(ref string[] list1,ref string[] list2) { int m=list1.Length ; int n=list2.Length ; int[ , ] lcs=new int[m+1, n+1]; Back[ , ] backTracer=new Back[m+1, n+1]; int[ , ] w=new int[m+1, n+1]; int i, j; for(i=0; i <= m; ++i) { lcs[i,0]=0; backTracer[i,0]=Back.UP; } for(j= 0; j <= n; ++j) { lcs[0,j]=0; backTracer[0,j]=Back.LEFT; } for(i =0; i < m; i++) { for(j=0; j < n; j++) { if( list1[i] == list2[j] ) { int k=0; int prev=0; if (i > 0 && j > 0 ) { k= w[i-1, j-1]; prev=lcs[i-1,j-1]; } lcs[i,j]=prev + ConsecutiveScore(k+1) - ConsecutiveScore(k) ; backTracer[i,j]=Back.UP_AND_LEFT; w[i,j] = k+1; }; { if (i > 0 && (lcs[i - 1, j] > lcs[i, j] || (lcs[i,j] == 0 && lcs[i - 1, j] > 0))) { lcs[i, j]=lcs[i - 1, j]; backTracer[i, j]=Back.UP; w[i, j]=0; }; if (j > 0 && (lcs[i, j - 1] > lcs[i, j] || (lcs[i,j] == 0 && lcs[i , j-1] > 0))) { lcs[i, j]=lcs[i, j - 1]; backTracer[i, j]=Back.LEFT; w[i, j]=0; } } } } i=m-1; j=n-1; string subseq=""; int score=lcs[i,j]; //trace the backtracking matrix. while( i >= 0 && j >= 0 ) { if (backTracer[i,j] == Back.NEITHER) break; if( backTracer[i,j] == Back.UP_AND_LEFT ) { subseq = list1[i] + subseq; Trace.WriteLine(i + " " + list1[i] + " " + j) ; ++_num; Trace.WriteLine(list1[i]) ; list1[i]="T" + _num; ++_num; list2[j]="T" + _num; i--; j--; } else if( backTracer[i,j] == Back.UP ) { i--; } else if( backTracer[i,j] == Back.LEFT ) { j--; } } return score; }
protected override void OnCreate() { Back.SetBackTexture("STATUS_BACK.TGA"); stat = new GUCVisual(pos[0], pos[1], 640, 480); //for small fonts Back.AddChild(stat); // left side const int dist = GUCView.FontsizeDefault; GUCVisualText title = stat.CreateText("CHARAKTERPROFIL", 152, 59); title.Format = GUCVisualText.TextFormat.Center; const int cpyoffset = 84; const int cpx1 = 39; const int cpx2 = 180; guild = stat.CreateText("Gildenlos", cpx1, cpyoffset); stat.CreateText("Stufe", cpx2, cpyoffset); level = stat.CreateText("0", cpx2 + 55, cpyoffset); stat.CreateText("Erfahrung", cpx1, cpyoffset + dist); exp = stat.CreateText("0", cpx2, cpyoffset + dist); stat.CreateText("Nächste Stufe", cpx1, cpyoffset + dist * 2); nextExp = stat.CreateText("500", cpx2, cpyoffset + dist * 2); stat.CreateText("Lernpunkte", cpx1, cpyoffset + dist * 3); LP = stat.CreateText("0", cpx2, cpyoffset + dist * 3); stat.CreateText("Talentpunkte", cpx1, cpyoffset + dist * 4); TP = stat.CreateText("0", cpx2, cpyoffset + dist * 4); title = stat.CreateText("ATTRIBUTE", 152, 190); title.Format = GUCVisualText.TextFormat.Center; const int atyoffset = 215; stat.CreateText("Stärke", cpx1, atyoffset); str = stat.CreateText("10/10", cpx2, atyoffset); stat.CreateText("Geschick", cpx1, atyoffset + dist); dex = stat.CreateText("10/10", cpx2, atyoffset + dist); stat.CreateText("Weisheit", cpx1, atyoffset + dist * 2); wis = stat.CreateText("10/10", cpx2, atyoffset + dist * 2); const int trimdist = 4; stat.CreateText("Lebensenergie", cpx1, trimdist + atyoffset + dist * 3); hp = stat.CreateText("100/100", cpx2, trimdist + atyoffset + dist * 3); stat.CreateText("Mana", cpx1, trimdist + atyoffset + dist * 4); mp = stat.CreateText("10/10", cpx2, trimdist + atyoffset + dist * 4); stat.CreateText("Ausdauer", cpx1, trimdist + atyoffset + dist * 5); ap = stat.CreateText("100/100", cpx2, trimdist + atyoffset + dist * 5); title = stat.CreateText("RÜSTUNGSSCHUTZ", 152, 347); title.Format = GUCVisualText.TextFormat.Center; const int rsyoffset = 371; const int rsx2 = 230; stat.CreateText("vor Waffen", cpx1, rsyoffset); protW = stat.CreateText("0", rsx2, rsyoffset); stat.CreateText("vor Geschossen", cpx1, rsyoffset + dist); protR = stat.CreateText("0", rsx2, rsyoffset + dist); stat.CreateText("vor Drachenfeuer", cpx1, rsyoffset + dist * 2); protF = stat.CreateText("0", rsx2, rsyoffset + dist * 2); stat.CreateText("vor Magie", cpx1, rsyoffset + dist * 3); protM = stat.CreateText("0", rsx2, rsyoffset + dist * 3); // right side const int dist2 = GUCView.FontsizeMenu; const int tx = 450; const int ty1 = 80; title = stat.CreateText("TALENTE", tx, 59); title.Format = GUCVisualText.TextFormat.Center; AddButton("Kampf", "", tx, ty1, null); AddButton("Magie", "", tx, ty1 + dist2, null); AddButton("Diebeskunst", "", tx, ty1 + 2 * dist2, null); title = stat.CreateText("FERTIGKEITEN", tx, 191); title.Format = GUCVisualText.TextFormat.Center; const int ty2 = 217; AddButton("Handwerker", "", tx, ty2, null); AddButton("Waffenschmied", "", tx, ty2 + dist2, null); AddButton("Schmied", "", tx, ty2 + 2 * dist2, null); AddButton("Jäger & Sammler", "", tx, ty2 + 3 * dist2, null); AddButton("Verpfleger", "", tx, ty2 + 4 * dist2, null); AddButton("Alchemist", "", tx, ty2 + 5 * dist2, null); AddButton("Gelehrter", "", tx, ty2 + 6 * dist2, null); }