public void SwitchState(GameState gameState) { switch (gameState) { case GameState.LEVEL_1: this.Components.Remove(mainMenu); level3 = new Level3(this); Components.Add(level3); currentLevel = level3; break; case GameState.MAIN_MENU: this.Components.Remove(currentLevel); mainMenu = new MenuJewSaver(this); Components.Add(mainMenu); break; case GameState.LEVEL_2: this.Components.Remove(level1); level2 = new Level2(this); this.Components.Add(level2); currentLevel = level2; break; case GameState.LEVEL_3: this.Components.Remove(level2); level3 = new Level3(this); this.Components.Add(level3); currentLevel = level3; break; default: break; } }
static int Main(string[] args) { ITest test = new Level3(); int ret1 = test.Test; int ret2 = test.Test2; if (ret1 != 21 || ret2 != 32) { Console.WriteLine("FAIL"); Console.WriteLine("EXPECTED: '21' and '32' when invoking test.Test and test.Test2 on an instance of Level3"); Console.WriteLine("ACTUAL: '" + ret1 + "' and '" + ret2 + "'"); return 101; } Console.WriteLine("PASS"); return 100; }
private void StartState() { switch (_state) { case "MainMenu": _menu = new MainMenu(this); AddChild(_menu); break; case "HighScores": _scores = new HighScores(this); AddChild(_scores); break; case "Credits": _credits = new Credits(this); AddChild(_credits); break; case "Level1": _level1 = new Level1(this); AddChild(_level1); break; case "Level2": _level2 = new Level2(this, 5); //Would have _lives instead of 5 if pickups were implemented AddChild(_level2); break; case "Level3": _level3 = new Level3(this, 5); //Idem ditto AddChild(_level3); break; case "WonGame": _wonGame = new WonGame(this); AddChild(_wonGame); break; case "Exit": Environment.Exit(0); break; default: throw new Exception("You tried to load a non-existant state"); } }
public void IfNeedColorListPerson(Level3 mutation) { CalculationLevel1.SetColorInListPerson(mutation.ListPerson, 1); }
public static Level3 Search(List <Level3> mutations, string DyDis, string DyMut, string MutID) { Level3 result = mutations.First(s => s.DyDis.Equals(DyDis) && s.DyMut.Equals(DyMut) && s.MutID.Equals(MutID)); return(result); }
public CalculationLevel3(Level3 mutation) { IfNeedColorListPerson(mutation); }
protected bool Equals(Level3 other) => Id == other.Id && string.Equals(Name, other.Name) && Level2_Required_Id == other.Level2_Required_Id && Level2_Optional_Id == other.Level2_Optional_Id;
public void TestLevel3Positive4() { bool result = new Level3().TestIsNonEmpty(""); Assert.IsFalse(result); }
public void Should_activate_all_upstream_dependencies_when_chain_deep() { var defaultsOrder = new List<Feature>(); var level1 = new Level1 { OnDefaults = f => defaultsOrder.Add(f) }; var level2 = new Level2 { OnDefaults = f => defaultsOrder.Add(f) }; var level3 = new Level3 { OnDefaults = f => defaultsOrder.Add(f) }; //the orders matter here to expose a bug featureSettings.Add(level3); featureSettings.Add(level2); featureSettings.Add(level1); featureSettings.SetupFeatures(null, null); Assert.True(level1.IsActive, "Level1 wasn't activated"); Assert.True(level2.IsActive, "Level2 wasn't activated"); Assert.True(level3.IsActive, "Level3 wasn't activated"); Assert.IsInstanceOf<Level1>(defaultsOrder[0], "Upstream dependencies should be activated first"); Assert.IsInstanceOf<Level2>(defaultsOrder[1], "Upstream dependencies should be activated first"); Assert.IsInstanceOf<Level3>(defaultsOrder[2], "Upstream dependencies should be activated first"); }
public void Poor_Performance() { long ms = 0; using (MetricTracker m = new MetricTracker("Starting simple object", t => ms = t)) { Level1 level1 = new Level1(); level1.Value = "test"; level1.levels = new List <Level2>(); Trace.WriteLine("Starting the test"); for (int i = 0; i < 1296; i++) { Level2 curLevel2 = new Level2(); level1.levels.Add(curLevel2); curLevel2.Value = "test" + i.ToString(); curLevel2.levels = new List <Level3>(); } using (LevelsPoor context = new LevelsPoor()) { context.Level1.Add(level1); context.SaveChanges(); Trace.WriteLine("Done simple save"); } ms.Should().BeLessThan(2960); ms = 0; } using (LevelsPoor context = new LevelsPoor()) using (new MetricTracker("Starting complex object", t => ms = t)) { Level1 level1 = new Level1(); level1.Value = "test"; level1.levels = new List <Level2>(); for (int i = 0; i < 5; i++) { Level2 curLevel2 = new Level2(); level1.levels.Add(curLevel2); curLevel2.Value = "test" + i.ToString(); curLevel2.levels = new List <Level3>(); for (int j = 0; j < 5; j++) { Level3 curLevel3 = new Level3(); curLevel2.levels.Add(curLevel3); curLevel3.Value = "test" + j.ToString(); curLevel3.levels = new List <Level4>(); for (int k = 0; k < 10; k++) { Level4 curLevel4 = new Level4(); curLevel3.levels.Add(curLevel4); curLevel4.Value = "test" + k.ToString(); curLevel4.levels = new List <Level5>(); for (int l = 0; l < 10; l++) { Level5 curLevel5 = new Level5(); curLevel4.levels.Add(curLevel5); curLevel5.Value = "test" + l.ToString(); } } } } context.Level1.Add(level1); context.SaveChanges(); } ms.Should().BeLessThan(15000); ms = 0; }
// Start is called before the first frame update void Start() { if (ScoreText != null) { ScoreText.text = "Score: " + GameObject.FindObjectOfType <Globals>().returnScore(); } if (LevelSelect != null) { LevelSelect.GetComponent <Button>().onClick.AddListener(PlayOnClick); } if (Level1 != null) { Level1.GetComponent <Button>().onClick.AddListener(delegate { LoadLevel(1); }); Level2.GetComponent <Button>().onClick.AddListener(delegate { LoadLevel(2); }); Level3.GetComponent <Button>().onClick.AddListener(delegate { LoadLevel(3); }); Level4.GetComponent <Button>().onClick.AddListener(delegate { LoadLevel(4); }); SetLevelsInteractable(); } if (Quit != null) { Quit.GetComponent <Button>().onClick.AddListener(QuitOnClick); } if (Credits != null) { Credits.GetComponent <Button>().onClick.AddListener(CreditsOnClick); } if (MainMenu != null) { MainMenu.GetComponent <Button>().onClick.AddListener(MainMenuOnClick); } if (ResetProgress != null) { ResetProgress.GetComponent <Button>().onClick.AddListener(ResetProgressOnClick); } if (UnlockLevelsCheat != null) { UnlockLevelsCheat.GetComponent <Button>().onClick.AddListener(UnlockLevelsOnClick); } if (RestartCurrLevel != null) { RestartCurrLevel.GetComponent <Button>().onClick.AddListener(delegate { LoadLevel(GameObject.FindObjectOfType <Globals>().returnCurrentLevel()); }); } if (NextLevel != null) { Globals globals = GameObject.FindObjectOfType <Globals>(); ushort nextLevel = globals.returnCurrentLevel(); // Current level is increased by touching the end portal nextLevel++; globals.setMaxLevel(nextLevel); NextLevel.GetComponent <Button>().onClick.AddListener(delegate { LoadLevel(nextLevel); }); // Loads next level } }
public void InheritFrom() { using (var container = new RhetosTestContainer()) { Level1 l1ReadAllow = new Level1() { ID = Guid.NewGuid(), value = 190 }, l1ReadDeny = new Level1() { ID = Guid.NewGuid(), value = 90 }, l1WriteAllow = new Level1() { ID = Guid.NewGuid(), value = 60 }, l1WriteDeny = new Level1() { ID = Guid.NewGuid(), value = 160 }; Level2 l2ParentReadAllow = new Level2() { ID = Guid.NewGuid(), MyParentID = l1ReadAllow.ID, value = 5 }, l2cParentReadDeny = new Level2() { ID = Guid.NewGuid(), MyParentID = l1ReadDeny.ID, value = 6 }, l2cParentWriteAllow = new Level2() { ID = Guid.NewGuid(), MyParentID = l1WriteAllow.ID, value = 7 }, l2cParentWriteDeny = new Level2() { ID = Guid.NewGuid(), MyParentID = l1WriteDeny.ID, value = 8 }; var repositories = container.Resolve <Common.DomRepository>(); var l1Repo = repositories.TestRowPermissions.Level1; var l2Repo = repositories.TestRowPermissions.Level2; var l3Repo = repositories.TestRowPermissions.Level3; var browseRepo = repositories.TestRowPermissions.Level1Browse; l3Repo.Delete(l3Repo.Query()); l2Repo.Delete(l2Repo.Query()); l1Repo.Delete(l1Repo.Query()); l1Repo.Insert(new Level1[] { l1ReadAllow, l1ReadDeny, l1WriteAllow, l1WriteDeny }); l2Repo.Insert(new Level2[] { l2ParentReadAllow, l2cParentReadDeny, l2cParentWriteAllow, l2cParentWriteDeny }); { var l2AllowRead = l2Repo.Filter(l2Repo.Query(), new Common.RowPermissionsReadItems()).ToList(); Assert.AreEqual("5, 8", TestUtility.DumpSorted(l2AllowRead, a => a.value.ToString())); } { var l2AllowWrite = l2Repo.Filter(l2Repo.Query(), new Common.RowPermissionsWriteItems()).ToList(); Assert.AreEqual("6, 7", TestUtility.DumpSorted(l2AllowWrite, a => a.value.ToString())); } // Test combination with rule on level 2 Level2 cCombo = new Level2() { ID = Guid.NewGuid(), MyParentID = l1ReadAllow.ID, value = 3 }; l2Repo.Insert(new Level2[] { cCombo }); { var l2AllowRead = l2Repo.Filter(l2Repo.Query(), new Common.RowPermissionsReadItems()).ToList(); Assert.IsTrue(!l2AllowRead.Select(a => a.value).Contains(3)); } // Test double inheritance, only write deny case Level3 bDenyWrite = new Level3() { ID = Guid.NewGuid(), MyParentID = l2cParentWriteDeny.ID }; l3Repo.Insert(new Level3[] { bDenyWrite }); { Assert.AreEqual(1, l3Repo.Query().Count()); var l3DenyWrite = l3Repo.Filter(l3Repo.Query(), new Common.RowPermissionsWriteItems()).ToList(); Assert.AreEqual(0, l3DenyWrite.Count); } // Test inheritance form base data structure { var allowedRead = browseRepo.Filter(browseRepo.Query(), new Common.RowPermissionsReadItems()).ToList(); Assert.AreEqual("160, 190", TestUtility.DumpSorted(allowedRead, item => item.Value2)); var allowedWrite = browseRepo.Filter(browseRepo.Query(), new Common.RowPermissionsWriteItems()).ToList(); Assert.AreEqual("60, 90", TestUtility.DumpSorted(allowedWrite, item => item.Value2)); } } }
// Use this for initialization void Start() { audioplay = GameObject.FindGameObjectWithTag("SoundLoader").GetComponent <AudioScript>(); var scaleFactor = ScaleFactor.GetScaleFactor(); var backButton = UIButton.create(buttonsManager2, "CloseBtn.png", "CloseBtn.png", 0, 0); backButton.onTouchUpInside += sender => Application.LoadLevel("AGAIN"); backButton.positionFromCenter(-0.42f, 0.355f); backButton.setSize(backButton.width / scaleFactor * 1f, backButton.height / scaleFactor * 1f); Level1 = UIButton.create(buttonsManager, "L1.png", "L1.png", 0, 0); Level1.setSize(Level1.width / scaleFactor, Level1.height / scaleFactor); Level1.onTouchUpInside += sender => Application.LoadLevel("Level1"); Level2 = UIButton.create(buttonsManager, "L2.png", "L2.png", 0, 0); Level2.setSize(Level2.width / scaleFactor, Level2.height / scaleFactor); Level2.onTouchUpInside += sender => Application.LoadLevel("Level2"); Level2.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level3 = UIButton.create(buttonsManager, "L3.png", "L3.png", 0, 0); Level3.setSize(Level3.width / scaleFactor, Level3.height / scaleFactor); Level3.onTouchUpInside += sender => Application.LoadLevel("Level3"); Level3.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level4 = UIButton.create(buttonsManager, "L4.png", "L4.png", 0, 0); Level4.setSize(Level4.width / scaleFactor, Level4.height / scaleFactor); Level4.onTouchUpInside += sender => Application.LoadLevel("Level4"); Level4.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level5 = UIButton.create(buttonsManager, "L5.png", "L5.png", 0, 0); Level5.setSize(Level5.width / scaleFactor, Level5.height / scaleFactor); Level5.onTouchUpInside += sender => Application.LoadLevel("Level5"); Level5.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level6 = UIButton.create(buttonsManager, "L6.png", "L6.png", 0, 0); Level6.setSize(Level6.width / scaleFactor, Level6.height / scaleFactor); Level6.onTouchUpInside += sender => Application.LoadLevel("Level6"); Level6.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level7 = UIButton.create(buttonsManager, "L7.png", "L7.png", 0, 0); Level7.setSize(Level7.width / scaleFactor, Level7.height / scaleFactor); Level7.onTouchUpInside += sender => Application.LoadLevel("Level7"); Level7.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level8 = UIButton.create(buttonsManager, "L8.png", "L8.png", 0, 0); Level8.setSize(Level8.width / scaleFactor, Level8.height / scaleFactor); Level8.onTouchUpInside += sender => Application.LoadLevel("Level8"); Level8.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level9 = UIButton.create(buttonsManager, "L9.png", "L9.png", 0, 0); Level9.setSize(Level9.width / scaleFactor, Level9.height / scaleFactor); Level9.onTouchUpInside += sender => Application.LoadLevel("Level9"); Level9.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level10 = UIButton.create(buttonsManager, "L10.png", "L10.png", 0, 0); Level10.setSize(Level10.width / scaleFactor, Level10.height / scaleFactor); Level10.onTouchUpInside += sender => Application.LoadLevel("Level10"); Level10.onTouchUpInside += sender => Basket.levelShortcutSet(0); Level1.positionFromCenter(-0.4f, 0f); Level2.parentUIObject = Level1; Level2.positionFromCenter(1.1f, 0f); Level3.parentUIObject = Level2; Level3.positionFromCenter(1.1f, 0f); Level4.parentUIObject = Level3; Level4.positionFromCenter(1.1f, 0f); Level5.parentUIObject = Level4; Level5.positionFromCenter(1.1f, 0f); Level6.parentUIObject = Level5; Level6.positionFromCenter(1.1f, 0f); Level7.parentUIObject = Level6; Level7.positionFromCenter(1.1f, 0f); Level8.parentUIObject = Level7; Level8.positionFromCenter(1.1f, 0f); Level9.parentUIObject = Level8; Level9.positionFromCenter(1.1f, 0f); Level10.parentUIObject = Level9; Level10.positionFromCenter(1.1f, 0f); Level1.touchDownSound = audioplay.getSoundClip(); Level2.touchDownSound = audioplay.getSoundClip(); Level3.touchDownSound = audioplay.getSoundClip(); Level4.touchDownSound = audioplay.getSoundClip(); Level5.touchDownSound = audioplay.getSoundClip(); Level6.touchDownSound = audioplay.getSoundClip(); Level7.touchDownSound = audioplay.getSoundClip(); Level8.touchDownSound = audioplay.getSoundClip(); Level9.touchDownSound = audioplay.getSoundClip(); Level10.touchDownSound = audioplay.getSoundClip(); backButton.touchDownSound = audioplay.getSoundClip(); }
public void Should_activate_all_upstream_deps_when_chain_deep() { var order = new List<Feature>(); var level1 = new Level1 { OnActivation = f => order.Add(f) }; var level2 = new Level2 { OnActivation = f => order.Add(f) }; var level3 = new Level3 { OnActivation = f => order.Add(f) }; var settings = new SettingsHolder(); var featureSettings = new FeatureActivator(settings); //the orders matter here to expose a bug featureSettings.Add(level3); featureSettings.Add(level2); featureSettings.Add(level1); featureSettings.SetupFeatures(new FeatureConfigurationContext(null)); Assert.True(level1.IsActive, "Level1 wasn't activated"); Assert.True(level2.IsActive, "Level2 wasn't activated"); Assert.True(level3.IsActive, "Level3 wasn't activated"); Assert.IsInstanceOf<Level1>(order[0], "Upstream deps should be activated first"); Assert.IsInstanceOf<Level2>(order[1], "Upstream deps should be activated first"); Assert.IsInstanceOf<Level3>(order[2], "Upstream deps should be activated first"); }
protected void submitButton_Click(object sender, EventArgs e) { String level; String question; String Option1, Option2, Option3, Option4; String answer; try { OnlineExamSystemEntities db = new OnlineExamSystemEntities(); level = divisionDropDownList.SelectedValue; question = TextBox1.Text; Option1 = TextBox2.Text; Option2 = TextBox3.Text; Option3 = TextBox4.Text; Option4 = TextBox5.Text; answer = TextBox6.Text; if (level == "Beginner Level") { Level1 lvl = new Level1(); lvl.Question = question; lvl.Option1 = Option1; lvl.Option2 = Option2; lvl.Option3 = Option3; lvl.Option4 = Option4; lvl.Answer = answer; db.Level1.AddObject(lvl); db.SaveChanges(); } else if (level == "Intermediate Level") { Level2 lvl = new Level2(); lvl.Question = question; lvl.Option1 = Option1; lvl.Option2 = Option2; lvl.Option3 = Option3; lvl.Option4 = Option4; lvl.Answer = answer; db.Level2.AddObject(lvl); db.SaveChanges(); } else if (level == "Advance Level") { Level3 lvl = new Level3(); lvl.Question = question; lvl.Option1 = Option1; lvl.Option2 = Option2; lvl.Option3 = Option3; lvl.Option4 = Option4; lvl.Answer = answer; db.Level3.AddObject(lvl); db.SaveChanges(); } else if (level == "Master Level") { Level4 lvl = new Level4(); lvl.Question = question; lvl.Option1 = Option1; lvl.Option2 = Option2; lvl.Option3 = Option3; lvl.Option4 = Option4; lvl.Answer = answer; db.Level4.AddObject(lvl); db.SaveChanges(); } lblmsg.Text = "Question Has been Successfully Stored"; lblmsg.ForeColor = System.Drawing.Color.BlueViolet; }catch (Exception ex) { lblmsg.Text = "Error Occured"; lblmsg.ForeColor = System.Drawing.Color.Red; } }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { LEVEL_WIDTH = GraphicsDevice.DisplayMode.Width / 2; LEVEL_HEIGHT = GraphicsDevice.DisplayMode.Height / 2; graphics.PreferredBackBufferWidth = LEVEL_WIDTH; graphics.PreferredBackBufferHeight = LEVEL_HEIGHT; graphics.ApplyChanges(); this.rodStewart = Content.Load <Song>("song"); this.sunshine = Content.Load <Song>("Sunshine"); MediaPlayer.Volume = 0.1f; MediaPlayer.Play(rodStewart); MediaPlayer.IsRepeating = false; textStillToType = true; this.level3Sound = Content.Load <SoundEffect>("lolSoundEffect"); level3Inst = this.level3Sound.CreateInstance(); level3Inst.IsLooped = false; this.level7Bus = Content.Load <SoundEffect>("BusSound"); level7Inst = this.level7Bus.CreateInstance(); level7Inst.IsLooped = true; this.typingSound = Content.Load <SoundEffect>("Keyboard"); typingInst = this.typingSound.CreateInstance(); typingInst.IsLooped = true; SoundEffect.MasterVolume = 0.15f; // TODO: Add your initialization logic here levelNumber = 9; levelOne = new Level1(); levelOne.LEVEL_WIDTH = LEVEL_WIDTH; levelOne.LEVEL_HEIGHT = LEVEL_HEIGHT; levelOne.Initialize(); levelTwo = new Level2(); levelTwo.LEVEL_WIDTH = LEVEL_WIDTH; levelTwo.LEVEL_HEIGHT = LEVEL_HEIGHT; levelTwo.Initialize(); levelThree = new Level3(); levelThree.convoNumber = 1; levelThree.LEVEL_WIDTH = LEVEL_WIDTH; levelThree.LEVEL_HEIGHT = LEVEL_HEIGHT; levelThree.Initialize(); levelFour = new Level4(); levelFour.LEVEL_WIDTH = LEVEL_WIDTH; levelFour.LEVEL_HEIGHT = LEVEL_HEIGHT; levelFour.Initialize(); levelFive = new Level5(); levelFive.LEVEL_WIDTH = LEVEL_WIDTH; levelFive.LEVEL_HEIGHT = LEVEL_HEIGHT; levelFive.Initialize(); levelSix = new Level6(); levelSix.LEVEL_WIDTH = LEVEL_WIDTH; levelSix.LEVEL_HEIGHT = LEVEL_HEIGHT; levelSix.Initialize(); levelSeven = new Level7(); levelSeven.LEVEL_WIDTH = LEVEL_WIDTH; levelSeven.LEVEL_HEIGHT = LEVEL_HEIGHT; levelSeven.Initialize(); levelEight = new Level8(); levelEight.LEVEL_WIDTH = LEVEL_WIDTH; levelEight.LEVEL_HEIGHT = LEVEL_HEIGHT; levelEight.Initialize(); levelNine = new Level9(); levelNine.LEVEL_WIDTH = LEVEL_WIDTH; levelNine.LEVEL_HEIGHT = LEVEL_HEIGHT; levelNine.Initialize(); levelTen = new Level10(); levelTen.LEVEL_WIDTH = LEVEL_WIDTH; levelTen.LEVEL_HEIGHT = LEVEL_HEIGHT; levelTen.Initialize(); levelEle = new Level11(); levelEle.LEVEL_WIDTH = LEVEL_WIDTH; levelEle.LEVEL_HEIGHT = LEVEL_HEIGHT; levelEle.Initialize(); levelTwe = new Level12(); levelTwe.LEVEL_WIDTH = LEVEL_WIDTH; levelTwe.LEVEL_HEIGHT = LEVEL_HEIGHT; levelTwe.Initialize(); levelTteen = new Level13(); levelTteen.LEVEL_WIDTH = LEVEL_WIDTH; levelTteen.LEVEL_HEIGHT = LEVEL_HEIGHT; levelTteen.Initialize(); levelFourteen = new Level14(); levelFourteen.LEVEL_WIDTH = LEVEL_WIDTH; levelFourteen.LEVEL_HEIGHT = LEVEL_HEIGHT; levelFourteen.Initialize(); levelFifteen = new Level15(); levelFifteen.LEVEL_WIDTH = LEVEL_WIDTH; levelFifteen.LEVEL_HEIGHT = LEVEL_HEIGHT; levelFifteen.Initialize(); levelSixteen = new Level16(); levelSixteen.LEVEL_WIDTH = LEVEL_WIDTH; levelSixteen.LEVEL_HEIGHT = LEVEL_HEIGHT; levelSixteen.Initialize(); levelSeventeen = new Level17(); levelSeventeen.LEVEL_WIDTH = LEVEL_WIDTH; levelSeventeen.LEVEL_HEIGHT = LEVEL_HEIGHT; levelSeventeen.Initialize(); transition = false; levelProgressBBox = new Rectangle(LEVEL_WIDTH - 140, 0, 140, LEVEL_HEIGHT); transitionPos = new Vector2(0, 0); base.Initialize(); }
void Start() { transform.position = new Vector3(distanceToPlanet, 0, distanceToPlanet); level = GameObject.Find("levelmanager").GetComponent <Level3>(); player = GameObject.FindGameObjectWithTag("Player"); }
private void InitLevel(int level) { switch (level) { case 1: Level1.InitIntro(animationService, introspeedincrease); canmorph = false; break; case 2: Level2.InitIntro(animationService, introspeedincrease); canmorph = false; break; case 3: //challenge Level3.InitIntro(animationService, -2); break; case 4: Level4.InitIntro(animationService, introspeedincrease); maxwaittimebetweendives = 4000; canmorph = true; break; case 5: Level5.InitIntro(animationService, introspeedincrease); maxwaittimebetweendives = 3000; divespeedincrease = 1; missileincrease = 1; canmorph = true; break; case 6: Level6.InitIntro(animationService, introspeedincrease); maxwaittimebetweendives = 2500; divespeedincrease = 1; missileincrease = 1; introspeedincrease = 1; canmorph = true; break; case 7: //challenge Level8.InitIntro(animationService, -2); break; case 8: Level7.InitIntro(animationService, introspeedincrease); maxwaittimebetweendives = 2500; divespeedincrease = 1; missileincrease = 2; introspeedincrease = 1; canmorph = true; break; case 9: Level9.InitIntro(animationService, introspeedincrease); maxwaittimebetweendives = 2000; divespeedincrease = 2; missileincrease = 2; introspeedincrease = 1; canmorph = true; break; case 10: Level10.InitIntro(animationService, introspeedincrease); maxwaittimebetweendives = 1500; divespeedincrease = 1; missileincrease = 3; introspeedincrease = 2; canmorph = false; break; case 11: //challenge Level11.InitIntro(animationService, -3); break; } GetBugs().ForEach(a => { a.Paths.ForEach(p => { if (p.IsIntroPath) { a.PathPoints.AddRange(animationService.ComputePathPoints(p, false, 20)); } else { a.PathPoints.AddRange(animationService.ComputePathPoints(p, false)); } }); }); ////draw path logic for debugging only //var drawpathbug1 = GetBugs().FirstOrDefault(a => a.Intro is Challenge3); //var drawpathbug2 = GetBugs().FirstOrDefault(a => a.Intro is Challenge4); //drawpathbug1.DrawPath = true; //drawpathbug1.DrawControlLines = true; //drawpathbug2.DrawPath = true; //drawpathbug2.DrawControlLines = true; //drawpathbug2.Paths.ForEach(a => //{ // a.OutPutDebug = true; // a.DrawPath = true; //}); ////end draw path debugging logic GetBugs().Where(a => a.Wave == 1).ToList().ForEach(a => a.Started = true); AIManager.aidodgeing = false; }
public void TestNesting() { var scope1 = new ProcessingScope(); var scope2 = scope1.CreateChildScope(new DummyMapper()); var scope3 = scope2.CreateChildScope(new DummyMapper()); var o1 = new Level1(); var o1_1 = new Level2(); var o1_1_1 = new Level3(); var o1_1_2 = new Level3(); var o1_2 = new Level2(); var o2 = new Level1(); var o2_1 = new Level2(); var o3 = new Level1(); var o3_1 = new Level2(); var o3_2 = new Level2(); var o3_2_1 = new Level3(); var o3_3 = new Level2(); var o3_3_1 = new Level3(); var o3_3_2 = new Level3(); scope1.Set(o1); Assert.AreEqual(1, scope1.GlobalIndex); scope2.Set(o1_1); Assert.AreEqual(1, scope2.Index <Level1>()); Assert.AreEqual(1, scope2.Index <Level2>()); scope3.Set(o1_1_1); Assert.AreEqual(1, scope3.Index <Level1>()); Assert.AreEqual(1, scope3.Index <Level2>()); Assert.AreEqual(1, scope3.Index <Level3>()); scope3.Set(o1_1_2); Assert.AreEqual(2, scope3.Index <Level1>()); Assert.AreEqual(2, scope3.Index <Level2>()); Assert.AreEqual(2, scope3.Index <Level3>()); Assert.AreEqual(2, scope3.ChildIndex); Assert.AreEqual(2, scope3.GlobalIndex); scope2.Set(o1_2); Assert.AreEqual(2, scope2.Index <Level1>()); Assert.AreEqual(2, scope2.Index <Level2>()); Assert.AreEqual(2, scope2.ChildIndex); Assert.AreEqual(2, scope3.GlobalIndex); scope1.Set(o2); Assert.AreEqual(2, scope1.GlobalIndex); scope2 = scope2.Set(o2_1); Assert.AreEqual(1, scope2.Index <Level1>()); Assert.AreEqual(3, scope2.GlobalIndex); scope1.Set(o3); Assert.AreEqual(3, scope1.GlobalIndex); scope2 = scope2.Set(o3_1); Assert.AreEqual(1, scope2.Index <Level1>()); Assert.AreEqual(4, scope2.GlobalIndex); scope2.Set(o3_2); Assert.AreEqual(2, scope2.Index <Level1>()); Assert.AreEqual(5, scope2.GlobalIndex); scope3.Set(o3_2_1); Assert.AreEqual(1, scope3.Index <Level1>()); Assert.AreEqual(1, scope3.Index <Level2>()); Assert.AreEqual(3, scope3.GlobalIndex); scope2.Set(o3_3); Assert.AreEqual(3, scope2.Index <Level1>()); Assert.AreEqual(6, scope2.GlobalIndex); scope3.Set(o3_3_1); Assert.AreEqual(2, scope3.Index <Level1>()); Assert.AreEqual(1, scope3.Index <Level2>()); Assert.AreEqual(4, scope3.GlobalIndex); scope3.Set(o3_3_2); Assert.AreEqual(3, scope3.Index <Level1>()); Assert.AreEqual(2, scope3.Index <Level2>()); Assert.AreEqual(5, scope3.GlobalIndex); //Check that the objects are correctly assigned Assert.AreSame(o3, scope3.Current <Level1>()); Assert.AreSame(o3_3, scope3.Current <Level2>()); Assert.AreSame(o3_3_2, scope3.Current <Level3>()); Assert.AreSame(o3, scope2.Current <Level1>()); Assert.AreSame(o3_3, scope2.Current <Level2>()); Assert.AreSame(o3, scope1.Current <Level1>()); }
public CalculationMpileupInsertions(Level3 mutation) { IfNeedColorListPerson4(mutation); }
public void TestLevel3Positive3() { bool result = new Level3().TestIsNonEmpty("foo"); Assert.IsTrue(result); }
static void Main(string[] args) { // LEVEL 1 // Level1.T1(); // Level1.T2(); // Level1.T3(); // Level1.T4(); // Level1.T5(); // Level1.T6(); // Level1.T7(); // Level1.T8(); // Level1.T9(); // Level1.T10(); // Level1.T11(); // Level1.T12(); // Level1.T13(); // Level1.T14(); // Level1.T15(); // LEVEL 2 // Level2.T1(); // Level2.T2(); // Level2.T3(); // Level2.T4(); // Level2.T5(); // Level2.T6(); // Level2.T7(); // Level2.T8(); // Level2.T9(); // Level2.T10(); // Level2.T11(); // Level2.T12(); // Level2.T13(); // Level2.T14(); // Level2.T15(); // Level2.T16(); // Level2.T17(); // Level2.T18(); // Level2.T19(); // Level2.T20(); // LEVEL 3 // Level3.T1(); // Level3.T2(); // Level3.T3(); // Level3.T4(); // Level3.T5(); // Level3.T6(); // Level3.T7(); // Level3.T8(); // Level3.T9(); // Level3.T10(); // Level3.T11(); // Level3.T12(); Level3.T13(); // Level3.T14(); // ADDITIONAL // Additional.T11(); // Additional.T12(); // Additional.T13(); // Additional.T14(); // Additional.T15(); }
public static void InsertAllListPerson(Level3 Person, string idRuns, SqlConnection connection, SqlTransaction transaction) { SqlParameters.InsertAllListPerson(Person.ListPerson, 4, Person.Chrom, Person.Start, Person.End, Person.Id, Person.Ref, Person.Alt, Person.DyDis, Person.DyMut, Person.MutID, Person.InsertionsChrom, Person.InsertionsPos, Person.InsertionsId, Person.InsertionsRef, Person.InsertionsAlt, Person.ColorDyName, idRuns, connection, transaction); }
public void TestNesting() { var scope1 = new ProcessingScope(); var scope2 = scope1.CreateChildScope(new DummyMapper()); var scope3 = scope2.CreateChildScope(new DummyMapper()); var o1 = new Level1(); var o1_1 = new Level2(); var o1_1_1 = new Level3(); var o1_1_2 = new Level3(); var o1_2 = new Level2(); var o2 = new Level1(); var o2_1 = new Level2(); var o3 = new Level1(); var o3_1 = new Level2(); var o3_2 = new Level2(); var o3_2_1 = new Level3(); var o3_3 = new Level2(); var o3_3_1 = new Level3(); var o3_3_2 = new Level3(); scope1.Set(o1); Assert.AreEqual(1, scope1.GlobalIndex); scope2.Set(o1_1); Assert.AreEqual(1, scope2.Index<Level1>()); Assert.AreEqual(1, scope2.Index<Level2>()); scope3.Set(o1_1_1); Assert.AreEqual(1, scope3.Index<Level1>()); Assert.AreEqual(1, scope3.Index<Level2>()); Assert.AreEqual(1, scope3.Index<Level3>()); scope3.Set(o1_1_2); Assert.AreEqual(2, scope3.Index<Level1>()); Assert.AreEqual(2, scope3.Index<Level2>()); Assert.AreEqual(2, scope3.Index<Level3>()); Assert.AreEqual(2, scope3.ChildIndex); Assert.AreEqual(2, scope3.GlobalIndex); scope2.Set(o1_2); Assert.AreEqual(2, scope2.Index<Level1>()); Assert.AreEqual(2, scope2.Index<Level2>()); Assert.AreEqual(2, scope2.ChildIndex); Assert.AreEqual(2, scope3.GlobalIndex); scope1.Set(o2); Assert.AreEqual(2, scope1.GlobalIndex); scope2 = scope2.Set(o2_1); Assert.AreEqual(1, scope2.Index<Level1>()); Assert.AreEqual(3, scope2.GlobalIndex); scope1.Set(o3); Assert.AreEqual(3, scope1.GlobalIndex); scope2 = scope2.Set(o3_1); Assert.AreEqual(1, scope2.Index<Level1>()); Assert.AreEqual(4, scope2.GlobalIndex); scope2.Set(o3_2); Assert.AreEqual(2, scope2.Index<Level1>()); Assert.AreEqual(5, scope2.GlobalIndex); scope3.Set(o3_2_1); Assert.AreEqual(1, scope3.Index<Level1>()); Assert.AreEqual(1, scope3.Index<Level2>()); Assert.AreEqual(3, scope3.GlobalIndex); scope2.Set(o3_3); Assert.AreEqual(3, scope2.Index<Level1>()); Assert.AreEqual(6, scope2.GlobalIndex); scope3.Set(o3_3_1); Assert.AreEqual(2, scope3.Index<Level1>()); Assert.AreEqual(1, scope3.Index<Level2>()); Assert.AreEqual(4, scope3.GlobalIndex); scope3.Set(o3_3_2); Assert.AreEqual(3, scope3.Index<Level1>()); Assert.AreEqual(2, scope3.Index<Level2>()); Assert.AreEqual(5, scope3.GlobalIndex); //Check that the objects are correctly assigned Assert.AreSame(o3, scope3.Current<Level1>()); Assert.AreSame(o3_3, scope3.Current<Level2>()); Assert.AreSame(o3_3_2, scope3.Current<Level3>()); Assert.AreSame(o3, scope2.Current<Level1>()); Assert.AreSame(o3_3, scope2.Current<Level2>()); Assert.AreSame(o3, scope1.Current<Level1>()); }