public void Init(Storm storm) { this.curr_storm = storm; if (StormDataHandler.Instance.StormDictionary.ContainsKey(storm.serialNo)) { storm_list = StormDataHandler.Instance.StormDictionary[storm.serialNo]; Debug.Log("Storm : " + storm.name + ", storm points : " + storm_list.Count); GameObject stormParent = GameObject.Find(storm.name); Play.onClick.AddListener(AnimateCycloneEffect); Stop.onClick.AddListener(StopAnimation); //PlotGraph(100); PlotGraph2(storm_list.Count); } else { Debug.Log("Key Not Found !"); } Vector3 pos = gameObject.GetComponent <RectTransform>().anchoredPosition; pos.x += 60; //gameObject.GetComponent<RectTransform>().anchoredPosition = pos; Vector3 crossDir = Vector3.Cross(dir, StromEffectPrefab.transform.position); float angle = Vector3.Angle(dir, StromEffectPrefab.transform.position); StromEffectPrefab.transform.Rotate(crossDir, angle, Space.Self); curve_LR = b_Curve.gameObject.GetComponent <LineRenderer>(); }
public void Assert_Add_Connection_Between_Enties() { Storm storm = new Storm(); storm.EditSchema(e => { e.Add <TestModel>("TestModel", "TABTest"); e.Add("SomeDynModel", "Table", b => { b.Add(new FieldConfig() { CodeName = "ID", IsPrimary = true, CodeType = typeof(int) }); b.Add(new FieldConfig() { CodeName = "TestModelID", CodeType = typeof(int) }); return(b); }); e.Connect("TestModel", "SomeDynModel", "TestModel", "TestModelID", "ID"); return(e); }); var nav = storm.schema.GetNavigator(); var s = nav.GetEntity("SomeDynModel"); var t = nav.GetEntity("TestModel"); var x = nav.GetEdge("SomeDynModel.TestModel"); Assert.Equal(s.ID, x.SourceID); Assert.Equal(t.ID, x.TargetID); Assert.Equal("TestModelID", x.On.Item1); Assert.Equal("ID", x.On.Item2); }
public void ForecastMessage_IsRain() { Rnd.Reset(1); var storm = new Storm(); Assert.AreEqual("There is a 42 % chance of light rain, and the weather is cooler today", storm.ForecastMessage); }
public void FillTest() { Storm <MallardDuck> storm = new Storm <MallardDuck>(); storm.FillStorm(nDucks); Assert.AreEqual(nDucks, storm.Ducks.Count); }
public void Throw_If_Connection_With_Same_ID_Exists() { Storm storm = new Storm(); Assert.Throws <ArgumentException>(() => { storm.EditSchema(e => { e.Add <TestModel>("TestModel", "TABTest"); e.Add("SomeDynModel", "Table", b => { b.Add(new FieldConfig() { CodeName = "ID", IsPrimary = true, CodeType = typeof(int) }); b.Add(new FieldConfig() { CodeName = "TestModelID", CodeType = typeof(int) }); return(b); }); e.Connect("TestModel", "SomeDynModel", "TestModel", "TestModelID", "ID"); e.Connect("TestModel", "SomeDynModel", "TestModel", "TestModelID", "ID"); return(e); }); }); }
public void Parse_SetCommand_Update_UsingModel() { Storm storm = new Storm(); storm.EditSchema(SampleSchema); var compiler = new SqlServerCompiler(); var con = storm.OpenConnection(new EmptyConnection()); var cmd1 = con.Set(Model_0, 12) .Value(new Model_0() { ID = 12, //<= this shold not take in consideration because it's primary key of the entity Model1ID = 1, Field1 = "value1", Field2 = "value2", Field3 = "value3", Field4 = "value4", Field5 = "value5", }); cmd1.ParseSQL(); SqlResult result1 = compiler.Compile(cmd1.query); string sql1 = result1.Sql; // Previusly Calculated check sum integrity Assert.Equal("ADD301250F02D5AF0240ACE77079032E", Helpers.Checksum(sql1)); }
public void MigrateTest() { Storm <MallardDuck> storm = new Storm <MallardDuck>(); storm.FillStorm(nDucks); //migrazione storm.Migrate(Direction.NORD, 25.3); storm.Migrate(Direction.OVEST, 25.3); storm.Migrate(Direction.SUD, 25.3); storm.Migrate(Direction.EST, 25.3); Assert.AreEqual(0d, storm.PositionX); Assert.AreEqual(0d, storm.PositionY); Assert.AreEqual(0d, storm.LineDistanceFromStart); //altra migrazione storm.Migrate(Direction.NORD, 25.3); storm.Migrate(Direction.EST, 67.3); Assert.AreEqual(67.3, storm.PositionX); Assert.AreEqual(25.3, storm.PositionY); Assert.AreEqual(71.90, storm.LineDistanceFromStart); storm.Migrate(Direction.SUD, 30.9); storm.Migrate(Direction.EST, 14.9); Assert.AreEqual(82.2, storm.PositionX); Assert.AreEqual(-5.6, storm.PositionY); Assert.AreEqual(82.39, storm.LineDistanceFromStart); Assert.AreEqual(storm.TotalDistance, 239.6); Assert.IsTrue(storm.Ducks.TrueForAll(dk => dk.TotalFly == storm.TotalDistance)); }
public void Parse_Filter_NotLike() { Storm storm = new Storm(); storm.EditSchema(SampleSchema); var compiler = new SqlServerCompiler(); var con = storm.OpenConnection(new EmptyConnection()); var cmd1 = con.Get(Model_1) .Where(e => e["data"].NotLike.Val("data1")); cmd1.ParseSQL(); SqlResult result1 = compiler.Compile(cmd1.query); string sql1 = result1.Sql; // Previusly Calculated check sum integrity Assert.Equal("40DD56CBBD7FB9B8F6B8475CC9FECB26", Helpers.Checksum(sql1)); var cmd2 = con.Get(Model_1) .Where(e => e["data"].NotLike.Ref("Child_2.data")); cmd2.ParseSQL(); SqlResult result2 = compiler.Compile(cmd2.query); string sql2 = result2.Sql; // Previusly Calculated check sum integrity Assert.Equal("33D480C67D31B5769AA65E4CA87403C2", Helpers.Checksum(sql2)); }
public void Parse_SetCommand_Update() { Storm storm = new Storm(); storm.EditSchema(SampleSchema); var compiler = new SqlServerCompiler(); var con = storm.OpenConnection(new EmptyConnection()); var cmd1 = con.Set(Model_0, 12) .Value(new Dictionary <string, object>() { { "ID", "asd" }, //<= this shold not take in consideration because it's primary key of the entity { "Model1ID", "1" }, { "Field1", "value1" }, { "Field2", "value2" }, { "Field3", "value3" }, { "Field4", "value4" }, { "Field5", "value5" }, { "NotExistingField", "some value" } // <= this shold not take in consideration because it's not a field of the entity }); cmd1.ParseSQL(); SqlResult result1 = compiler.Compile(cmd1.query); string sql1 = result1.Sql; // Previusly Calculated check sum integrity Assert.Equal("ADD301250F02D5AF0240ACE77079032E", Helpers.Checksum(sql1)); }
public void Parse_Filter_LessOrEqualTo() { Storm storm = new Storm(); storm.EditSchema(SampleSchema); var compiler = new SqlServerCompiler(); var con = storm.OpenConnection(new EmptyConnection()); var cmd1 = con.Get(Model_1) .Where(e => e["data"].LessOrEqualTo.Val("data1")); cmd1.ParseSQL(); SqlResult result1 = compiler.Compile(cmd1.query); string sql1 = result1.Sql; // Previusly Calculated check sum integrity Assert.Equal("5D7050823EE2EC6956E201D0400DA419", Helpers.Checksum(sql1)); var cmd2 = con.Get(Model_1) .Where(e => e["data"].LessOrEqualTo.Ref("Child_2.data")); cmd2.ParseSQL(); SqlResult result2 = compiler.Compile(cmd2.query); string sql2 = result2.Sql; // Previusly Calculated check sum integrity Assert.Equal("05069F883119759EB2718B153F573D1A", Helpers.Checksum(sql2)); }
public void Parse_Filter_Like() { Storm storm = new Storm(); storm.EditSchema(SampleSchema); var compiler = new SqlServerCompiler(); var con = storm.OpenConnection(new EmptyConnection()); var cmd1 = con.Get(Model_1) .Where(e => e["data"].Like.Val("data1")); cmd1.ParseSQL(); SqlResult result1 = compiler.Compile(cmd1.query); string sql1 = result1.Sql; // Previusly Calculated check sum integrity Assert.Equal("DE63F4F1988F9EE29ABD22F382A210D3", Helpers.Checksum(sql1)); var cmd2 = con.Get(Model_1) .Where(e => e["data"].Like.Ref("Child_2.data")); cmd2.ParseSQL(); SqlResult result2 = compiler.Compile(cmd2.query); string sql2 = result2.Sql; // Previusly Calculated check sum integrity Assert.Equal("461335C8133CF486EB72CC7A2B7B5606", Helpers.Checksum(sql2)); }
public void Parse_Filter_GreaterOrEqualTo() { Storm storm = new Storm(); storm.EditSchema(SampleSchema); var compiler = new SqlServerCompiler(); var con = storm.OpenConnection(new EmptyConnection()); var cmd1 = con.Get(Model_1) .Where(e => e["data"].GreaterOrEqualTo.Val("data1")); cmd1.ParseSQL(); SqlResult result1 = compiler.Compile(cmd1.query); string sql1 = result1.Sql; // Previusly Calculated check sum integrity Assert.Equal("34AABBD1AE39782F004A906AE1B2AB72", Helpers.Checksum(sql1)); var cmd2 = con.Get(Model_1) .Where(e => e["data"].GreaterOrEqualTo.Ref("Child_2.data")); cmd2.ParseSQL(); SqlResult result2 = compiler.Compile(cmd2.query); string sql2 = result2.Sql; // Previusly Calculated check sum integrity Assert.Equal("B3F599E6750A4CEE5E467FA1A902F705", Helpers.Checksum(sql2)); }
public void Parse_Filter_LessTo() { Storm storm = new Storm(); storm.EditSchema(SampleSchema); var compiler = new SqlServerCompiler(); var con = storm.OpenConnection(new EmptyConnection()); var cmd1 = con.Get(Model_1) .Where(e => e["data"].LessTo.Val("data1")); cmd1.ParseSQL(); SqlResult result1 = compiler.Compile(cmd1.query); string sql1 = result1.Sql; // Previusly Calculated check sum integrity Assert.Equal("8C816D6911AF6D3456AF68589502AFFE", Helpers.Checksum(sql1)); var cmd2 = con.Get(Model_1) .Where(e => e["data"].LessTo.Ref("Child_2.data")); cmd2.ParseSQL(); SqlResult result2 = compiler.Compile(cmd2.query); string sql2 = result2.Sql; // Previusly Calculated check sum integrity Assert.Equal("09864DD8F14F77517975BFDBBC9CE637", Helpers.Checksum(sql2)); }
public void Parse_Filter_GreaterTo() { Storm storm = new Storm(); storm.EditSchema(SampleSchema); var compiler = new SqlServerCompiler(); var con = storm.OpenConnection(new EmptyConnection()); var cmd1 = con.Get(Model_1) .Where(e => e["data"].GreaterTo.Val("data1")); cmd1.ParseSQL(); SqlResult result1 = compiler.Compile(cmd1.query); string sql1 = result1.Sql; // Previusly Calculated check sum integrity Assert.Equal("3AFF85B634EC75196A52F423A4308A30", Helpers.Checksum(sql1)); var cmd2 = con.Get(Model_1) .Where(e => e["data"].GreaterTo.Ref("Child_2.data")); cmd2.ParseSQL(); SqlResult result2 = compiler.Compile(cmd2.query); string sql2 = result2.Sql; // Previusly Calculated check sum integrity Assert.Equal("A69ECA081ECE81EF542FD3CF164F914E", Helpers.Checksum(sql2)); }
public void Parse_Filter_NotEqualTo() { Storm storm = new Storm(); storm.EditSchema(SampleSchema); var compiler = new SqlServerCompiler(); var con = storm.OpenConnection(new EmptyConnection()); var cmd1 = con.Get(Model_1) .Where(e => e["data"].NotEqualTo.Val("data1")); cmd1.ParseSQL(); SqlResult result1 = compiler.Compile(cmd1.query); string sql1 = result1.Sql; // Previusly Calculated check sum integrity Assert.Equal("0E80502056208D5E9BD4A68A47059921", Helpers.Checksum(sql1)); var cmd2 = con.Get(Model_1) .Where(e => e["data"].NotEqualTo.Ref("Child_2.data")); cmd2.ParseSQL(); SqlResult result2 = compiler.Compile(cmd2.query); string sql2 = result2.Sql; // Previusly Calculated check sum integrity Assert.Equal("296C9F346FD332C7E5ECBA70C5FEAFFA", Helpers.Checksum(sql2)); }
public void Parse_Filter_EqualTo() { Storm storm = new Storm(); storm.EditSchema(SampleSchema); var compiler = new SqlServerCompiler(); var con = storm.OpenConnection(new EmptyConnection()); var cmd1 = con.Get(Model_1) .Where(e => e["data"].EqualTo.Val("data1")); cmd1.ParseSQL(); SqlResult result1 = compiler.Compile(cmd1.query); string sql1 = result1.Sql; // Previusly Calculated check sum integrity Assert.Equal("4E0A97FDD8410E7E2B981D76CE1FC8C9", Helpers.Checksum(sql1)); var cmd2 = con.Get(Model_1) .Where(e => e["data"].EqualTo.Ref("Child_2.data")); cmd2.ParseSQL(); SqlResult result2 = compiler.Compile(cmd2.query); string sql2 = result2.Sql; // Previusly Calculated check sum integrity Assert.Equal("D44B3E75EA1EEAAC343E96981603CD43", Helpers.Checksum(sql2)); }
public void OKHit(object sender, DanoEventArgs DEA) { Debug.Assert(DEA.DanoParameters.Count == 4); #if DANO Basin CBasin = GlobalState.GetCurrentBasin(); // only valid when project valid Storm Sto = CBasin.GetCurrentStorm(); #else MainWindow MnWindow = (MainWindow)Application.Current.MainWindow; Storm Sto = MnWindow.CurrentProject.SelectedBasin.GetCurrentStorm(); try { int Intensity = (int)DEA.DanoParameters[0]; string Type = (string)DEA.DanoParameters[1]; Point Position = (Point)DEA.DanoParameters[2]; int Pressure = (int)DEA.DanoParameters[3]; Sto.AddNode(Intensity, Type, Position, Pressure, MnWindow.ST2Manager); Close(); } catch (InvalidCastException err) { #if DEBUG Error.Throw("Warning!", $"Internal error: Cannot convert DanoParameters to their actual types.\n\n{err}", ErrorSeverity.Warning, 403); #else Error.Throw("Warning!", "Internal error: Cannot convert DanoParameters to their actual types.\n\n{err}", ErrorSeverity.Warning, 403); #endif #endif } }
private void GetDischarge(Storm storm, double [] rain_in, double [] flow_out, double threshold, int lag, double icap) { int n = storm.Length; int m = MINS5; double [,] out_temp = new double[n, n + m + lag - 1]; for (int i = 0; i < n; i++) { if (rain_in[i + storm.Start] > threshold) { for (int j = 0; j < m; j++) { out_temp[i, j + i + lag] = (rain_in[i + storm.Start] - icap) * g[j]; if (out_temp[i, j + i + lag] < 0) { out_temp[i, j + i + lag] = 0; } } } } //sum up unit hydrographs at each time step for (int j = 0; j < n + m + lag - 1; j++) { for (int i = 0; i < n; i++) { flow_out[j + storm.Start] += out_temp[i, j]; } } }
public void CreateSchemaWithEditor() { var s = new Storm(); s.EditSchema(e => { return(e.Add <Appointment>("Appointment", "Appointments") .Add <Contact>("Contact", "Contacts") .Add <User>("User", "Users") .Add <Organization>("Organization", "Organizations") .Add <Language>("Language", "Languages") .Add("AppointmentCf", "AppointmentCustomFields", AppointmentCustomFields)); }); var n = s.schema.GetNavigator(); //-------------------- APPOINTMENT --------------------- var appointment = n.GetEntity("Appointment"); Assert.Equal("Appointments", appointment.DBName); Assert.Equal(typeof(Appointment), appointment.TModel); Assert.Equal("Appointment", appointment.ID); Assert.Equal(9, appointment.entityFields.Count()); //------------------- APPOINTMENT CF ------------------- var appointmentCf = n.GetEntity("AppointmentCf"); Assert.Equal("AppointmentCustomFields", appointmentCf.DBName); Assert.Null(appointmentCf.TModel); Assert.Equal("AppointmentCf", appointmentCf.ID); Assert.Equal(5, appointmentCf.entityFields.Count()); }
protected override void Awake() { base.Awake(); Astral.onClick.AddListener(OnAstralClick); Darkness.onClick.AddListener(OnDarknessClick); Ice.onClick.AddListener(OnIceClick); Iron.onClick.AddListener(OnIronClick); Storm.onClick.AddListener(OnStormClick); Nature.onClick.AddListener(OnNatureClick); Fire.onClick.AddListener(OnFireClick); astralLevel = Astral.GetComponentInChildren <TextMeshProUGUI>(); darknessLevel = Darkness.GetComponentInChildren <TextMeshProUGUI>(); iceLevel = Ice.GetComponentInChildren <TextMeshProUGUI>(); ironLevel = Iron.GetComponentInChildren <TextMeshProUGUI>(); stormLevel = Storm.GetComponentInChildren <TextMeshProUGUI>(); natureLevel = Nature.GetComponentInChildren <TextMeshProUGUI>(); fireLevel = Fire.GetComponentInChildren <TextMeshProUGUI>(); void OnAstralClick() => Owner.ElementSystem.LearnElement((int)ElementType.Astral); void OnDarknessClick() => Owner.ElementSystem.LearnElement((int)ElementType.Darkness); void OnIceClick() => Owner.ElementSystem.LearnElement((int)ElementType.Ice); void OnIronClick() => Owner.ElementSystem.LearnElement((int)ElementType.Iron); void OnStormClick() => Owner.ElementSystem.LearnElement((int)ElementType.Storm); void OnNatureClick() => Owner.ElementSystem.LearnElement((int)ElementType.Nature); void OnFireClick() => Owner.ElementSystem.LearnElement((int)ElementType.Fire); Buttons = new Button[] { Astral, Darkness, Ice, Iron, Storm, Nature, Fire }; }
public void CreateGetCommandWithWhere() { Storm s = StormDefine(); GetCommand cmd = new GetCommand(s.schema.GetNavigator(), "Appointment"); cmd.With("Contact") .With("AssignedUser") .Where(f => f["Contact.LastName"].EqualTo.Val("foo") * f["Contact.FirstName"].EqualTo.Val("boo")); Assert.Equal("Appointment", cmd.from.root.Entity.ID); var _and = Assert.IsType <AndFilter>(cmd.where); Assert.Equal(2, _and.filters.Count()); var _eq1 = Assert.IsType <EqualToFilter>(_and.filters.First()); Assert.Equal("Contact.LastName", _eq1.Left.Path); Assert.Equal("foo", ((DataFilterValue)_eq1.Right).value); var _eq2 = Assert.IsType <EqualToFilter>(_and.filters.Last()); Assert.Equal("Contact.FirstName", _eq2.Left.Path); Assert.Equal("boo", ((DataFilterValue)_eq2.Right).value); }
public static List <Storm> GetStorms() { List <Storm> storms = new List <Storm>(); try { string sourceHTML = "https://evescoutrescue.com/home/stormtrack.php"; string tableXPath = "/html/body/div/div[4]/div/div/div[2]/table/tbody"; HtmlAgilityPack.HtmlWeb hw = new HtmlAgilityPack.HtmlWeb(); HtmlAgilityPack.HtmlDocument doc = hw.Load(sourceHTML); HtmlAgilityPack.HtmlNodeCollection hnc = doc.DocumentNode.SelectNodes(tableXPath); List <List <string> > table = hnc.Descendants("tr") .Where(tr => tr.Elements("td").Count() > 1) .Select(tr => tr.Elements("td").Select(td => td.InnerText.Trim()).ToList()) .ToList(); foreach (List <string> ls in table) { Storm s = new Storm(); s.Region = ls[0]; s.System = ls[1]; s.Type = ls[3]; s.Name = ls[2]; storms.Add(s); } } catch { } return(storms); }
public override void Action() { if (this.player.waittime == 5) { this.sound.PlaySE(SoundEffect.sword); } if (this.player.waittime <= 5) { this.player.animationpoint = new Point(0, 1); } else if (this.player.waittime <= 23) { this.player.animationpoint = new Point((this.player.waittime - 5) / 3, 1); } else if (this.player.waittime < 50) { this.player.animationpoint = new Point(6, 1); } else { this.End(); this.player.animationpoint = new Point(0, 0); this.player.motion = Player.PLAYERMOTION._neutral; } if (this.player.waittime != 14) { return; } AttackBase attackBase = new Storm(this.sound, this.player.parent, this.player.position.X + 2 * this.UnionRebirth(this.player.union), this.player.position.Y, this.player.union, this.Power, 8, this.player.Element); attackBase.canCounter = false; this.player.parent.attacks.Add(attackBase); }
/// <summary> /// bad dynahotkey impl /// </summary> /// <param name="HitKey"></param> private void Window_HandleCategorySystemDynaHotkeys(Key HitKey) { CategorySystem CurrentCategorySystem = GlobalState.CategoryManager.CurrentCategorySystem; foreach (Category Cat in CurrentCategorySystem.Categories) { if (Cat.Hotkey != null) { // needs a refactoring to be done properly int MinIntensity = Cat.LowerBound; Storm CurrentStorm = CurrentProject.SelectedBasin.GetCurrentStorm(); Debug.Assert(Cat.Hotkey.Keys.Count > 0); // yeah if (Cat.Hotkey.Keys[0] == HitKey) { // temp if (CurrentStorm != null) { Node CNa = new Node() { Intensity = MinIntensity, NodeType = ST2Manager.GetStormTypeWithName("Tropical"), Position = new RelativePosition(0, 0) }; CurrentStorm.LastNode = CNa; } } } } }
private static (Storm, Schema.SchemaNavigator, StormDataSet) PrepareDataSet() { Storm s = StormDefine(); var nav = s.schema.GetNavigator(); var entity = nav.GetEntity("Test"); Origin fromNode = new Origin() { Alias = "A1", children = new List <Origin>(), Entity = entity, Edge = null, FullPath = new Schema.EntityPath("Test", "") }; var _idField = entity.entityFields.First(x => x.CodeName == "ID"); var _FirstName = entity.entityFields.First(x => x.CodeName == "FirstName"); var _LastName = entity.entityFields.First(x => x.CodeName == "LastName"); var _Email = entity.entityFields.First(x => x.CodeName == "Email"); var _Mobile = entity.entityFields.First(x => x.CodeName == "Mobile"); var _Phone = entity.entityFields.First(x => x.CodeName == "Phone"); var _Addre = entity.entityFields.First(x => x.CodeName == "Address"); StormDataSet data = new StormDataSet("Test"); List <SelectNode> nodes = new List <SelectNode>() { new SelectNode() { FromNode = fromNode, FullPath = new Schema.FieldPath("Test", "", "ID"), EntityField = _idField }, new SelectNode() { FromNode = fromNode, FullPath = new Schema.FieldPath("Test", "", "FirstName"), EntityField = _FirstName }, new SelectNode() { FromNode = fromNode, FullPath = new Schema.FieldPath("Test", "", "LastName"), EntityField = _LastName }, new SelectNode() { FromNode = fromNode, FullPath = new Schema.FieldPath("Test", "", "Email"), EntityField = _Email }, new SelectNode() { FromNode = fromNode, FullPath = new Schema.FieldPath("Test", "", "Mobile"), EntityField = _Mobile }, new SelectNode() { FromNode = fromNode, FullPath = new Schema.FieldPath("Test", "", "Phone"), EntityField = _Phone }, new SelectNode() { FromNode = fromNode, FullPath = new Schema.FieldPath("Test", "", "Address"), EntityField = _Addre } }; data.ReadData(new MonoEntityMockDataSources().GetReader(), nodes); return(s, nav, data); }
// Start is called before the first frame update void Start() { var generator = GetComponent <StormGenerator>(); var storm = new Storm(); var emitList = EmitList.Cone(100, 2, 90, 1); storm.AddBehavior(0, emitList, new Particle(particle), gap); generator.Generate(storm); }
public void StormCantSee() { AddSensorAbility(destroyer.Hull, "Foobar", 1); var storm = new Storm(); storm.Abilities.Add(new Ability(sys, Mod.Current.AbilityRules.FindByName("Sector - Sight Obscuration"), null, 999)); sys.Place(storm, new Point()); Assert.IsTrue(submarine.IsHiddenFrom(seekers), "Submarine should be hidden."); }
// Start is called before the first frame update void Start() { hasWon = false; storm = GameObject.FindGameObjectWithTag("Storm").GetComponent <Storm>(); backgroundImage = storm.transform.Find("GameOverCanvas").Find("GameOverBackground").GetComponent <Image>(); interactibles = new List <GameObject>(); currentNeonCount = initialNeonCount; UpdateUI(); }
void Start() { stormAbility = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <Storm>(); playerStats = stormAbility.GetComponentInParent <PlayerStats>(); damageType = stormAbility.damageType; damage = stormAbility.baseDamage; anim = GetComponent <Animator>(); cc = GetComponent <CircleCollider2D>(); StartCoroutine(BoltPrefab()); }
public void Assert_It_Read_Attr_StormDefaultIfNull_TypedModel() { Storm storm = new Storm(); storm.EditSchema(e => e.Add <TestModel>("TestModel", "TABTest")); var nav = storm.schema.GetNavigator(); var x = nav.GetEntity("TestModel"); Assert.Equal("Some Default Value", x.entityFields.First(y => y.CodeName == "DefaultedField").DefaultIfNull); }
public override void onPickup(Storm storm) { storm.stormHealth.ModifyHealth(2000); readyToRemove = true; base.onPickup(storm); }
private void GetDischarge(Storm storm, double [] rain_in, double [] flow_out, double threshold, int lag, double icap) { int n = storm.Length; int m = MINS5; double [,] out_temp = new double[n, n + m + lag - 1]; for(int i = 0; i < n; i++) { if(rain_in[i + storm.Start] > threshold) { for(int j = 0; j < m; j++) { out_temp[i, j + i + lag] = (rain_in[i + storm.Start] - icap) * g[j]; if(out_temp[i, j + i + lag] < 0) out_temp[i, j + i + lag] = 0; } } } //sum up unit hydrographs at each time step for(int j = 0; j < n + m + lag - 1; j++) { for(int i = 0; i < n; i++) { flow_out[j + storm.Start] += out_temp[i, j]; } } }