// This callback is called when the flag is not retrieved for a period of time. private void OnFlagIsNotRetrievedPeriodOfTime(object sender, EventArgs e) { Flag.Delete(); Flag.Create(); Flag.IsPositionBase = true; PickupInfo.Dispose(); BasePlayer.SendClientMessageToAll($"{OtherColor}[Auto-Return]: La bandera {NameColor} regresó a su posición inicial."); }
public void Cell_NoEventFiredWhenValueChangeToSameOldValue() { var cell = CreateCell(0); var flag = Flag.Create(cell); Assert.IsFalse(flag.Status); cell.Value = 0; Assert.IsFalse(flag.Status); }
public void Cell_EventFiredWhenValueChange() { var cell = CreateCell(0); var flag = Flag.Create(cell); Assert.IsFalse(flag.Status); cell.Value = 1; Assert.IsTrue(flag.Status); }
public void Drop(Player player) { Flag.Create(player); Flag.PlayerCaptured = null; Flag.IsPositionBase = false; BasePlayer.SendClientMessageToAll($"{OtherColor}[Team {NameTeam}]: {player.Name} dejó caer la bandera {NameColor} del equipo {NameTeam}."); BasePlayer.GameTextForAll($"~n~~n~~n~{ColorGameText}la bandera {NameColor} fue soltada!", 5000, 3); player.RemoveAttachedObject(0); Timer.Start(); }
public void Recover(Player player) { Flag.IsPositionBase = true; Flag.Create(); PickupInfo.Dispose(); BasePlayer.SendClientMessageToAll($"{OtherColor}[Team {NameTeam}]: {player.Name} recuperó la bandera {NameColor} del equipo {NameTeam}."); BasePlayer.GameTextForAll($"~n~~n~~n~{ColorGameText}la bandera {NameColor} fue recuperada!", 5000, 3); player.UpdateAdrenaline(4, "recuperar la bandera"); Timer.Stop(); }
public void ContentsChangeNotification() { var puzzle = CreateManualPuzzle("."); var square = puzzle.Grid[new Vector2D(0, 0)]; var flag = Flag.Create(square.Contents); Assert.IsFalse(flag.Status); Assert.AreSame(Square.UNKNOWN, square.Contents.Value); square.Contents.Value = Square.EMPTY; Assert.IsTrue(flag.Status); Assert.AreSame(Square.EMPTY, square.Contents.Value); }
public void RowConstraintsObserversGetNotifiedOnChange() { var editor = CreatePuzzleEditor( "..x", "xxx", ".x." ); var square = editor.Grid[new Vector2D(0, 0)]; var flag = Flag.Create(editor.RowConstraints[0].Constraints); Assert.IsFalse(flag.Status); square.IsFilled.Value = true; Assert.IsTrue(flag.Status); }
public void SquareObserversDoNotGetNotifiedWhenChangedToSameValue() { var editor = CreatePuzzleEditor( "..x", "xxx", ".x." ); var square = editor.Grid[new Vector2D(0, 0)]; var flag = Flag.Create(square.IsFilled); Assert.IsFalse(flag.Status); square.IsFilled.Value = false; Assert.IsFalse(flag.Status); }
public void ConstraintsSatisfactionChangeNotification() { var puzzle = CreateManualPuzzle("x"); var square = puzzle.Grid[new Vector2D(0, 0)]; var constraint = puzzle.RowConstraints[0]; var flag = Flag.Create(constraint.IsSatisfied); Assert.IsFalse(flag.Status); Assert.IsFalse(constraint.IsSatisfied.Value); square.Contents.Value = Square.FILLED; Assert.IsTrue(flag.Status); Assert.IsTrue(constraint.IsSatisfied.Value); }
int counter = 0; //-1000; public void CrearObjetos() { flag = new Flag(new Vector3(-4, 10, -4), "OGL.jpg"); flag.Create(); plaza.Create(); plaza.CrearColisiones(); Sprite.Create(); //Collision.GhostMode = true; road = new Road(); road.Create(); // star.CreateStars(450); spaceShip.Create(); Asteroid.Crear(); // AsteroidGenerator.GenerateAsteroid(35, true); SpcShipGenerator.Generate(9, true); }
public void Carry(Player player) { BasePlayer.SendClientMessageToAll($"{OtherColor}[Team {NameTeam}]: {player.Name} llevó la bandera {NameColor} del equipo {NameTeam} a su base."); BasePlayer.GameTextForAll($"~n~~n~~n~{TeamRival.ColorGameText}+1 score team {TeamRival.NameTeam}", 5000, 3); player.RemoveAttachedObject(0); Flag.Create(); PickupInfo.Dispose(); Flag.PlayerCaptured = null; Flag.IsPositionBase = true; ++TeamRival.Score; TeamRival.UpdateTdScore(); player.UpdateAdrenaline(10, "llevar la bandera tu base"); player.UpdateData("droppedFlags", ++player.Data.DroppedFlags); foreach (Player player1 in player.PlayerTeam.Players) { if (player != player1) { player1.UpdateAdrenaline(3, "ayudar a capturar la bandera"); } } }
public void Create() { flag.Create(); flag.Update(); }
public MainScreen(Manager manager) { base.manager = manager; if (Layout.ScreenFormat == ScreenFormat.Format4X3) { flag = new Flag(new Vector3(1, 1, 0.01f), new Vector3(1.2f, 2, 1), EngineContent.GetTextureByName(Game.GameStrings.GetString("Title")), new Rectangle(430, 85, 520, 140)); flag.Create(); Edit edit = new Edit(new Rectangle(690, 660, 120, 40), "edtName", Game.GameStrings.GetString("DefaultName")); Panel panel = new Panel(new Rectangle(0, 0, 1024, 768), "portada", Aligment.Left); Button button = new Button(new Rectangle(830, 660, 100, 40), Game.GameStrings.GetString("Enter"), new MouseClick(base.EnterSetupScreen)); Label textInsertar = new Label(Game.GameStrings.GetString("InsertName"), new Vector2(730, 622), Sprite.SpriteFont); FlagButton languageSpanish = new FlagButton(new Rectangle(80, 642, 100, 50), SelectSpanish, new Vector3(-5.55f, -5.1f, -15), Game.GameStrings.GetString("Spanish"), "espanna"); FlagButton languageEnglish = new FlagButton(new Rectangle(200, 642, 100, 50), SelectEnglish, new Vector3(-3.6f, -5.1f, -15), Game.GameStrings.GetString("English"), "uk"); Label textLanguage = new Label(Game.GameStrings.GetString("SelectLanguage"), new Rectangle(82, 622, 218, 20), Sprite.SpriteFont, Aligment.Center); base.AddControl(panel); base.AddControl(textInsertar); base.AddControl(button); base.AddControl(edit); base.AddControl(languageSpanish); base.AddControl(languageEnglish); base.AddControl(textLanguage); } else { flag = new Flag(new Vector3(1, 1, 0.01f), new Vector3(1.2f, 2, 1), EngineContent.GetTextureByName(Game.GameStrings.GetString("Title")), Layout.CalculateTotalLayout(new Rectangle(538, 79, 520, 140))); flag.Create(); Edit edit = new Edit(Layout.CalculateTotalLayout(new Rectangle(940, 612, 120, 40)), "edtName", Game.GameStrings.GetString("DefaultName")); Panel panel = new Panel(Layout.CalculateTotalLayout(new Rectangle(0, 0, 1280, 720)), "portada", Aligment.Left); Button button = new Button(Layout.CalculateTotalLayout(new Rectangle(1080, 612, 100, 40)), Game.GameStrings.GetString("Enter"), new MouseClick(base.EnterSetupScreen)); Label textInsertar = new Label(Game.GameStrings.GetString("InsertName"), Layout.CalculateLayoutXY(980, 574), Sprite.SpriteFont); FlagButton languageSpanish = new FlagButton(Layout.CalculateTotalLayout(new Rectangle(80, 596, 100, 50)), SelectSpanish, new Vector3(-5.55f, -5.1f, -15), Game.GameStrings.GetString("Spanish"), "espanna"); FlagButton languageEnglish = new FlagButton(Layout.CalculateTotalLayout(new Rectangle(200, 596, 100, 50)), SelectEnglish, new Vector3(-3.6f, -5.1f, -15), Game.GameStrings.GetString("English"), "uk"); Label textLanguage = new Label(Game.GameStrings.GetString("SelectLanguage"), Layout.CalculateTotalLayout(new Rectangle(82, 574, 218, 20)), Sprite.SpriteFont, Aligment.Center); base.AddControl(panel); base.AddControl(textInsertar); base.AddControl(button); base.AddControl(edit); base.AddControl(languageSpanish); base.AddControl(languageEnglish); base.AddControl(textLanguage); } }