void MapNameMenuEntryFocus(object sender, PlayerIndexEventArgs e) { Clavier.Get().GetText = true; Clavier.Get().Text = _mapName; Clavier.Get().TextEntered = SetMenuEntryText; SetMenuEntryText(); }
//Fonction d'un menu d'entre de caractère public static string MenuChaine(string question, int taille = 0, int nbcharmax = 0) { //Variable if (taille == 0 || taille < question.Length) { taille = question.Length; } string choix = ""; //Fonction LigneSimple("┌", '─', taille, "┐"); Console.Write("│" + question); RepChar(' ', taille - question.Length); Console.WriteLine("│"); LigneSimple("├", '─', taille, "┤"); Console.WriteLine(""); LigneSimple("└", '─', taille, "┘"); Console.SetCursorPosition(Console.CursorLeft, Console.CursorTop - 2); do { LigneSimple("│", ' ', taille, "│"); Console.SetCursorPosition(Console.CursorLeft + 1, Console.CursorTop - 1); Console.CursorVisible = true; choix = Clavier.LireChaine(); Console.CursorVisible = false; Console.SetCursorPosition(Console.CursorLeft, Console.CursorTop - 1); } while (nbcharmax != 0 && choix.Length > nbcharmax); return(choix); }
public ActionResult DeleteConfirmed(int id) { Clavier clavier = db.Claviers.Find(id); db.Claviers.Remove(clavier); db.SaveChanges(); return(RedirectToAction("Index")); }
/// <summary> /// Allows each screen to run logic. /// </summary> public override void Update(GameTime gameTime) { // Read the keyboard and gamepad. _input.Update(); Souris.Get().Update(Mouse.GetState()); Clavier.Get().Update(Keyboard.GetState()); // Make a copy of the master screen list, to avoid confusion if // the process of updating one screen adds or removes others. _screensToUpdate.Clear(); foreach (GameScreen screen in _screens) { _screensToUpdate.Add(screen); } bool otherScreenHasFocus = !Game.IsActive; bool coveredByOtherScreen = false; // Loop as long as there are screens waiting to be updated. while (_screensToUpdate.Count > 0) { // Pop the topmost screen off the waiting list. GameScreen screen = _screensToUpdate[_screensToUpdate.Count - 1]; _screensToUpdate.RemoveAt(_screensToUpdate.Count - 1); // Update the screen. screen.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); if (screen.ScreenState == ScreenState.TransitionOn || screen.ScreenState == ScreenState.Active) { // If this is the first active screen we came across, // give it a chance to handle input. if (!otherScreenHasFocus) { screen.HandleInput(_input); otherScreenHasFocus = true; } // If this is an active non-popup, inform any subsequent // screens that they are covered by it. if (!screen.IsPopup) { coveredByOtherScreen = true; } } } // Print debug trace? if (_traceEnabled) { TraceScreens(); } }
public ActionResult Edit([Bind(Include = "Id,TypeCatego,Type,Prix,Nom,Description")] Clavier clavier) { if (ModelState.IsValid) { db.Entry(clavier).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(clavier)); }
void SetMenuEntryText(object sender = null, PlayerIndexEventArgs e = null) { if (Clavier.Get().GetText) { _mapName = Clavier.Get().Text; } _mapNameMenuEntry.Text = "Name: " + _mapName; _mapWidthMenuEntry.Text = "Width: " + _mapWidth; _mapHeightMenuEntry.Text = "Height: " + _mapHeight; }
public ActionResult Create([Bind(Include = "Id,Type,Prix,Nom,Description")] Clavier clavier) { if (ModelState.IsValid) { db.Claviers.Add(clavier); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(clavier)); }
public Window(int width, int height, GameManager manager) : base(width, height) { Gestionnaire = manager; manager.Attach(this); tableau = Gestionnaire.TableauDeJeu; Touches = new Clavier(this); Graphismes = new Graphisme(this); //this. //Run(60.0); // Run the game at 60 updates per second }
// GET: Claviers/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Clavier clavier = db.Claviers.Find(id); if (clavier == null) { return(HttpNotFound()); } return(View(clavier)); }
// Start is called before the first frame update void Start() { Animation1 = Animation1.GetComponent <Animation>(); Animation2 = Animation2.GetComponent <Animation>(); Animation3 = Animation3.GetComponent <Animation>(); Animation4 = Animation4.GetComponent <Animation>(); Animation5 = Animation5.GetComponent <Animation>(); Animation6 = Animation6.GetComponent <Animation>(); Animation7 = Animation7.GetComponent <Animation>(); Animation8 = Animation8.GetComponent <Animation>(); Animation9 = Animation9.GetComponent <Animation>(); Animation10 = Animation10.GetComponent <Animation>(); AnimationCard = GetComponent <Animation>(); clav = FindObjectOfType <Clavier>(); }
/// <summary> /// Lets the game respond to player input. Unlike the Update method, /// this will only be called when the gameplay screen is active. /// </summary> public override void HandleInput(InputState input) { if (input == null) { throw new ArgumentNullException("input"); } // Look up inputs for the active player profile. var playerIndex = ControllingPlayer != null ? (int)ControllingPlayer.Value : 0; var gamePadState = input.CurrentGamePadStates[playerIndex]; // The game pauses either if the user presses the pause button, or if // they unplug the active gamepad. This requires us to keep track of // whether a gamepad was ever plugged in, because we don't want to pause // on PC if they are playing with a keyboard and have no gamepad at all! var gamePadDisconnected = !gamePadState.IsConnected && input.GamePadWasConnected[playerIndex]; if (input.IsPauseGame(ControllingPlayer) || gamePadDisconnected) { ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer); } else { // Camera movement var movement = Vector2.Zero; movement.X += gamePadState.ThumbSticks.Left.X; movement.Y += gamePadState.ThumbSticks.Left.Y; if (Clavier.Get().Pressed(Keys.Left)) { movement.X--; } if (Clavier.Get().Pressed(Keys.Right)) { movement.X++; } if (Clavier.Get().Pressed(Keys.Up)) { movement.Y--; } if (Clavier.Get().Pressed(Keys.Down)) { movement.Y++; } _camera += movement * CameraSpeed; } }
//Fonction de choix du menu public static int MenuChoix(string[] contenu, string titre = "", int taille = 0) { int col, row, choix; if (taille == 0) { taille = TailleStringMax(contenu); } AffMenu(contenu, titre, taille); col = Console.CursorLeft; row = Console.CursorTop; col += 2; row -= 2; do { Console.SetCursorPosition(col, row); RepChar(' ', (taille + 1)); Console.Write("│"); Console.SetCursorPosition(col, row); Console.Write("Choix : "); choix = Clavier.LireEntier(); } while (choix < 0 || choix > contenu.Length); return(choix); }
public void SetClavier(bool azerty) { clavier = azerty ? Clavier.AZERTY : Clavier.QWERTY; }
static void MapNameMenuEntryUnfocus(object sender, PlayerIndexEventArgs e) { Clavier.Get().GetText = false; }
void MapHeightMenuEntrySelected(object sender, PlayerIndexEventArgs e) { Clavier.Get().GetText = false; _mapHeight = (_mapHeight - 5 + 1) % 16 + 5; SetMenuEntryText(); }
void MapWidthMenuEntrySelected(object sender, PlayerIndexEventArgs e) { Clavier.Get().GetText = false; _mapWidth = (_mapWidth - 5 + 1) % 26 + 5; SetMenuEntryText(); }
// Start is called before the first frame update void Start() { clav = FindObjectOfType <Clavier>(); UpdateStars(); }
// Start is called before the first frame update void Start() { clav = FindObjectOfType <Clavier>(); cardRender = GetComponent <SpriteRenderer>(); }