private void GenerateTransmitter() { generation = gameObject.AddComponent <TransmitterGeneration>(); pieces = generation.Generate(connections, transmitter, nonTransmitter, transform).ToArray(); for (int i = 0; i < pieces.Length; i++) { if (pieces[i].transform.childCount > 0) { pieces[i].transform.GetChild(0).gameObject.SetActive(false); } } if (startPoint) { Spark spark = Instantiate(sparkPrefab, transform.position, Quaternion.identity).GetComponent <Spark>(); spark.GiveTransmitter(this); } if (endPoint) { // Spawn the end point thing here if (endPointPrefab != null) { Instantiate(endPointPrefab, transform.position, endPointParticle.transform.rotation); } if (endPointParticle != null) { Instantiate(endPointParticle, transform.position, endPointParticle.transform.rotation); } } }
/// <summary> /// Fired each time an event is read from file /// </summary> /// <param name="eventItem"></param> private void EventRecieved(Spark.Event eventItem) { //Raise event if (Spark.TimeToDateTime(eventItem.Time) > _latestMarketTime) { _latestMarketTime = Spark.TimeToDateTime(eventItem.Time); } RaiseEvent(new EventFeedArgs(eventItem, _latestMarketTime)); //Skip over waiting logic if quote event and ignoring quotes if ((IgnoreQuoteEvents) && (eventItem.Type == Spark.EVENT_QUOTE)) { return; } //Wait before playing next event while replay is pause while ((IsPaused) && (!_isSteppingForward)) { System.Threading.Thread.Sleep(100); } if (_isSteppingForward) { _isSteppingForward = false; } }
/// <summary> /// Execute query /// </summary> /// <param name="exchange">Security exchange</param> public static List <Spark.Event> Execute(string exchange) { //Connect to Spark API if required ApiControl.Instance.Connect(); //Get exchange reference Spark.Exchange exchangeRef; List <Spark.Event> result = null; if (ApiFunctions.GetSparkExchange(exchange, out exchangeRef)) { //Wait to allow Spark API to prepare for large download (it will only return a small number of events without this) System.Threading.Thread.Sleep(1000); //Request stock events result = new List <Spark.Event>(); Spark.Event sparkEvent = new Spark.Event(); //Execute query using current day request method if (Spark.GetAllExchangeEvents(ref exchangeRef, ref sparkEvent)) { while (Spark.GetNextExchangeEvent(ref exchangeRef, ref sparkEvent, 1000)) { result.Add(sparkEvent); } } Spark.ReleaseCurrentEvents(); } return(result); }
void OnCollisionEnter2D(Collision2D collision) { if (leftCollision) { ContactPoint2D[] contact = new ContactPoint2D[1]; collision.GetContacts(contact); moveSpeed *= collisionSpeedCoefficient; float oldMoveAngle = moveAngle - 180f; moveAngle = ReflectAngle(moveAngle, contact[0].normal); float sparkDuration = 0.3f + ((moveSpeed / initialSpeed) * 0.4f); for (int i = 0; i < 2; i++) { Spark.GetFromPool(sparkPrefab).Initialize(contact[0].point, oldMoveAngle + Random.Range(-5f, 5f), sparkDuration, (moveSpeed / initialSpeed) * Random.Range(0.5f, 2f), 0.2f, Random.Range(1f, 2f)); } for (int i = 0; i < 2; i++) { Spark.GetFromPool(sparkPrefab).Initialize(contact[0].point, moveAngle + Random.Range(-5f, 5f), sparkDuration, (moveSpeed / initialSpeed) * Random.Range(0.5f, 2f), 0.2f, Random.Range(1f, 2f)); } } leftCollision = false; }
void OnCollisionEnter2D(Collision2D coll) { //if (!movingTo || (coll != null && coll.gameObject != bubble_b.gameObject)) if (!movingTo || (bubble_b != null && coll.gameObject != bubble_b.gameObject)) { forceDirection = new Vector2(Random.Range(-2f, 2f), Random.Range(-2f, 2f)); } //Verify hit on Baiacu Baiacu baiacu = coll.gameObject.GetComponent <Baiacu> (); Spark spark = coll.gameObject.GetComponent <Spark> (); if (baiacu != null) { baiacu.hitMe(this); explodeMe = true; } else if (spark != null) { //Baiacu is the grandfather of spark. The Spark is son of the Spark Side Group. if (spark.transform.parent != null) //Verifica se ele não é um espinho arrancado. { spark.transform.parent.parent.gameObject.GetComponent <Baiacu>().hitMe(this); } //"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" explodeMe = true; } }
public SparkTestFixture() { adminClientId = ConfigurationManager.AppSettings["AdminClientID"] ?? ""; adminClientSecret = ConfigurationManager.AppSettings["AdminSecret"] ?? ""; // get access token adminAccessToken = CreateAdminAccessToken(adminClientId, adminClientSecret); if (adminAccessToken == null) { Console.WriteLine("Error: create access token failed!"); return; } //create the first user selfUser = CreateUser(adminAccessToken, adminClientId, adminClientSecret); if (selfUser == null) { Console.WriteLine("Error: create test user failed!"); return; } spark = CreateSpark(); Console.WriteLine("SparkTestFixture build success!"); }
public Spark CreateSparkbyJwt() { if (jwtSpark == null) { jwtAuth = new JWTAuthenticator(); jwtSpark = new SparkSDK.Spark(jwtAuth); //login for (int count = 1; count <= 5; count++) { if (JWtLogin() == true) { Console.WriteLine("JWtLogin success."); break; } Console.WriteLine($"Error: jwt login fail[{count}]."); if (count == 5) { jwtSpark = null; return(null); } } } return(jwtSpark); }
public override bool Hit(Bullet bullet, Vec2 hitPos) { if (BulletThroughNotEquipped && (_equippedDuck == null || bullet.owner == duck || !bullet.isLocal)) { return(false); } if (_isArmor) { if (bullet.isLocal && duck != null) { if (--EquipmentHitPoints <= 0 && KnockOffOnHit) { duck.KnockOffEquipment(this, ting: true, bullet); Fondle(this, DuckNetwork.localConnection); } } if (bullet.isLocal && Network.isActive) { NetSoundEffect.Play("equipmentTing"); } bullet.hitArmor = true; Level.Add(MetalRebound.New(hitPos.x, hitPos.y, (bullet.travelDirNormalized.x > 0f) ? 1 : (-1))); for (int i = 0; i < 6; i++) { Level.Add(Spark.New(x, y, bullet.travelDirNormalized)); } return(thickness > bullet.ammo.penetration); } return(base.Hit(bullet, hitPos)); }
//add a spark object to the room, up to 2 public void addSpark(Spark spark) { if (sparkList.Count < 2) { sparkList.Add(spark); } }
public override void SetPlace(Map map) { base.SetPlace(map); spark = new Spark(); spark.Id = Game1.Form1.PictId.Isparkred; map.place[x,y]=Map.EnemyChar; }
public async Task <(int, int)> CreateAsync(int projectId, int userId) { var project = await _context.Projects.FindAsync(projectId); var user = await _context.Users.FindAsync(userId); var sparkToCreate = new Spark { ProjectId = project.Id, Project = project, UserId = user.Id, User = user, Status = (int)SparkStatus.PENDING, CreatedDate = System.DateTime.UtcNow }; _context.Sparks.Add(sparkToCreate); if (await saveContextChanges() > 0) { return(sparkToCreate.ProjectId, sparkToCreate.UserId); } else { throw new DbUpdateException("Error creating spark", (Exception)null); } }
void OnCollisionEnter(Collision col) { //Debug.Log("Entered my domain!"); Spark.SetActive(true); //Blast.SetActive(true); timer = 0; }
public override bool Hit(Bullet bullet, Vec2 hitPos) { if (_equippedDuck == null || bullet.owner == duck || !bullet.isLocal) { return(false); } if (_isArmor && duck != null) { EquipmentHitPoints--; if (bullet.isLocal && EquipmentHitPoints <= 0) { duck.KnockOffEquipment(this, ting: true, bullet); Fondle(this, DuckNetwork.localConnection); } if (MakeDefaultHitEffects) { if (bullet.isLocal && Network.isActive) { NetSoundEffect.Play("equipmentTing"); } bullet.hitArmor = true; Level.Add(MetalRebound.New(hitPos.x, hitPos.y, (bullet.travelDirNormalized.x > 0f) ? 1 : (-1))); for (int i = 0; i < 6; i++) { Level.Add(Spark.New(x, y, bullet.travelDirNormalized)); } } return(BaseBaseHit()); } return(BaseBaseHit()); bool BaseBaseHit() { if (MakeDefaultHitEffects) { if (physicsMaterial == PhysicsMaterial.Metal) { Level.Add(MetalRebound.New(hitPos.x, hitPos.y, (bullet.travelDirNormalized.x > 0f) ? 1 : (-1))); hitPos -= bullet.travelDirNormalized; for (int j = 0; j < 3; j++) { Level.Add(Spark.New(hitPos.x, hitPos.y, bullet.travelDirNormalized)); } } else if (physicsMaterial == PhysicsMaterial.Wood) { hitPos -= bullet.travelDirNormalized; for (int i = 0; i < 3; i++) { WoodDebris woodDebris = WoodDebris.New(hitPos.x, hitPos.y); woodDebris.hSpeed = 0f - bullet.travelDirNormalized.x + Rando.Float(-1f, 1f); woodDebris.vSpeed = 0f - bullet.travelDirNormalized.y + Rando.Float(-1f, 1f); Level.Add(woodDebris); } } } return(thickness > bullet.ammo.penetration); } }
public Spark(Spark other) { pos = other.pos; color = other.color; faintcolor = other.faintcolor; Init(); }
public static void ClassSetup(TestContext context) { fixture = SparkTestFixture.Instance; Assert.IsNotNull(fixture); spark = fixture.CreateSpark(); Assert.IsNotNull(spark); }
IEnumerator StartWait() { yield return(StartCoroutine(Wait(1.50F))); Spark.SetActive(false); Cyclone.SetActive(false); Blast.SetActive(false); }
public BareHand() { Id = Game1.Form1.PictId.Iplayer; cntSpark = SPK; spark = new Spark[cntSpark]; for (int i = 0; i < cntSpark; ++i) spark[i] = new Spark(); for (int i = 0; i < cntSpark; ++i) spark[i].Id = Game1.Form1.PictId.Isparkblue; }
public static bool Impact(Spark __instance, Thing hitThing) { Map map = __instance.Map; Projectile_Patch.Base_Impact(__instance, hitThing); FireUtility.TryStartFireIn(__instance.Position, map, 0.1f); return(false); }
public Bow() { Id = Game1.Form1.PictId.Ibow; cntSpark = SPK; spark = new Spark[cntSpark]; for (int i = 0; i < cntSpark; ++i) spark[i] = new Spark(); for (int i = 0; i < cntSpark; ++i) spark[i].Id = Game1.Form1.PictId.Isparkblue; }
public void SparksLowPriority(Vector3 pos, Spark type) { if (this.random.Next(0, 2) == 0) { bool sound = this.main.TotalTime - this.lastSound[(int)type] > 0.15f && (this.main.Camera.Position - pos).LengthSquared() < soundRadiusSquared; this.Sparks(pos, type, sound); } }
/// <summary> /// Extension method for the Spark.Event struct that generates new trade from order event if there is an /// event type match, otherwise returns NULL. /// </summary> internal static Trade ToTrade(this Spark.Event eventItem, string symbol, string exchange, DateTime observationTime) { int price = eventItem.Price; int volume = (int)eventItem.Volume; DateTime timeStamp = DateTimeFromUnixTimestampSeconds(eventItem.Time); string conditionCodes = Spark.ConditionCodesToStr(eventItem.ConditionCodes, eventItem.Exchange); return(new Trade(timeStamp, symbol, exchange, price, volume, conditionCodes, observationTime)); }
private Spiral PopulateSpiral(Spiral spiral) { Spark spark = new Spark(Side.Top, spiral.Origin, 0, 0, spiral); for (int i = 0; i < spiral.Numbers.Length; i++) { spark.Advance(); } return spiral; }
public void Test1() { Assert.AreEqual(@"▁▂▃▄▅▆▇█", Spark.Render(new double[] { 10, 20, 30, 40, 50, 60, 70, 80 })); Assert.AreEqual(@"▁▅█", Spark.Render(10, 50, 80)); Assert.AreEqual(@"▁▅█", Spark.Render(new List <double>() { 10, 50, 80 })); }
public RoomManageViewModel() { spark = ApplicationController.Instance.CurSparkManager.CurSpark; CreateRoomCMD = new RelayCommand(CreateRoom); DeleteRoomCMD = new RelayCommand(DeleteRoom); CreateMembershipCMD = new RelayCommand(CreateMembership); DeleteMembershipCMD = new RelayCommand(DeleteMembership); FetchRooms(); }
public Spark CreateSpark() { if (spark == null) { spark = new SparkSDK.Spark(new SparkTestFixtureAuth(selfUser.AccessToken)); } return(spark); }
//------------------------------------------------------------------------- // Load, Unload public static void Load(System.Action pre, System.Action done) { Rain.Load(pre, done); Thunder.Load(pre, done); Ice.Load(pre, done); Leaves.Load(pre, done); Ghost.Load(pre, done); Twinkle.Load(pre, done); Spark.Load(pre, done); }
public SparkSystem(Vector2 startPosition) { sparkParticles = new Spark[MaxParticles]; //this.gameWindow = gameWindow; for (int i = 0; i < MaxParticles; i++) { sparkParticles[i] = new Spark(i, startPosition); //seed i och startposition vector2 } }
private void precompileInstaller1_DescribeBatch(object sender, Spark.Web.Mvc.Install.DescribeBatchEventArgs e) { // Add controllers from assemblies. // NOTE: This will change to reflect the override model. /*foreach (var viewSetting in AssemblySettings.AssemblyViewPaths) e.Batch.FromAssembly(viewSetting.Item1);*/ foreach (var controller in AssemblySettings.FormContainer().GetAllInstances<IController>()) e.Batch.For(controller.GetType()); }
public static void Unload() { Rain.Unload(); Thunder.Unload(); Ice.Unload(); Leaves.Unload(); Ghost.Unload(); Twinkle.Unload(); Spark.Unload(); }
private void OnTriggerEnter2D(Collider2D collision) { CharacterMovement sp = collision.GetComponent <CharacterMovement>(); if (sp != null) { //Player activates this trap, shoot sparkes than fire Spark.Ativated(); FireTrap.Ativated(); } }
public void UseSpark() { actionSetter = () => { turnActions.Clear(); Spark step = spark.Use(); if (step.CheckActionPrerequisites(ref actionFailedInfo)) { turnActions.Add(step); } }; }
public override bool Hit(Bullet bullet, Vec2 hitPos) { Level.Add(MetalRebound.New(hitPos.x, hitPos.y, (double)bullet.travelDirNormalized.x > 0.0 ? 1 : -1)); //SFX.Play(Mod.GetPath<EdoMod>("SFX\\anvilTing")); hitPos -= bullet.travelDirNormalized; for (int index = 0; index < 3; ++index) { Level.Add(Spark.New(hitPos.x, hitPos.y, bullet.travelDirNormalized, 0.02f)); } return(thickness > bullet.ammo.penetration); }
public void Dispose() { Spark.Dispose(); // CSparkRunner will exit upon receiving newline from // the standard input stream. _process.StandardInput.WriteLine("done"); _process.StandardInput.Flush(); _process.WaitForExit(); _tempDirectory.Dispose(); }
public void Test8() { Assert.AreEqual(@"▁▂▄▆█", Spark.Render(new double[] { 1, 2, 3, 4, 5 })); Spark.TickProvider = new VerticalTickProvider(); Assert.AreEqual( @"▏ ▎ ▍ ▌ ▋" , Spark.Render(new double[] { 1, 2, 3, 4, 5 })); }
public void SetUp() { fixture = SparkTestFixture.Instance; Assert.IsNotNull(fixture); //spark = fixture.spark; spark = fixture.CreateSpark(); Assert.IsNotNull(spark); room = spark.Rooms; Assert.IsNotNull(room); }
public override bool Hit(Bullet bullet, Vec2 hitPos) { Level.Add(MetalRebound.New(hitPos.x, hitPos.y, (bullet.travelDirNormalized.x > 0f) ? 1 : -1)); hitPos -= bullet.travelDirNormalized; for (int i = 0; i < 3; i++) { Level.Add(Spark.New(hitPos.x, hitPos.y, bullet.travelDirNormalized)); } SFX.Play("ting"); return(thickness > bullet.ammo.penetration); }
public void Spark(int sparkType, Vector3 position, Quaternion rotation, float size, float dimAlpha) { GameObject newSpark = Instantiate(sparkPrefabs [sparkType]); newSpark.transform.position = position; newSpark.transform.rotation = rotation; newSpark.transform.localScale = new Vector3(size, size, size); Spark spark = newSpark.GetComponent <Spark> (); spark.alpha = 1; spark.dimAlpha = dimAlpha; }
public void Fire() { Random rand = new Random(); for (int i = 0; i < maxSparks; i++) { double speed = rand.NextDouble() * maxSparkSpeed; double rotation = Math.PI / 2; double colorMix = rand.NextDouble(); Color c = new Color(); c.A = (byte)(rand.Next() & 0xff); c.R = (byte)((colorMix * grad1.R) + ((1 - colorMix) * grad2.R)); c.B = (byte)((colorMix * grad1.B) + ((1 - colorMix) * grad2.B)); c.G = (byte)((colorMix * grad1.G) + ((1 - colorMix) * grad2.G)); rotation += rand.NextDouble() % Math.PI * (rand.Next() % 2 == 0 ? -1 : 1); Spark s = new Spark(); s.position.X = location.X; s.position.Y = location.Y; s.velocity.X = (float)(Math.Cos(rotation) * speed); s.velocity.Y = (float)(Math.Sin(rotation) * -speed); s.color = c; sparks.Add(s); } life = 1; }
public virtual MidMemberDecl LookupMemberDecl(Spark.ResolvedSyntax.IResMemberDecl resMemberDecl) { throw new NotImplementedException(); }
private void precompileInstaller1_DescribeBatch(object sender, Spark.Web.Mvc.Install.DescribeBatchEventArgs e) { FindControllers().ForEach(t=>e.Batch.For(t)); }
public void push(Spark spark) { inactiveSparks.Push(spark); }
public SearchResults Search(Spark.Search.Mongo.Parameters parameters) { return searcher.Search(parameters); }