public void StrictTextDelimiterPositioningEnabledSpacesEnabledWithTrailingSpacesMultiCharTextDelimiterMultiCharSeperator() { var opts = new ExplodeOptions(new Delimiters("_x_", "xx")); opts.StrictTextDelimiterPositioning = true; opts.StrictTextDelimiterPositioningAllowLeadingTrailingSpaces = true; var text = @"one_x_ xxtwoxx _x_three"; ExplodeResult sr = Explode.ExplodeString(text, opts); Assert.True(sr.WereAnyCellsTextDelimited); List <string> sl = sr.Cells.ToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("two", sl[1]); Assert.Equal("three", sl[2]); sl = sr.Cells.RawTextToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal(" xxtwoxx ", sl[1]); Assert.Equal("three", sl[2]); }
public void StringTextDelimiterDisabledQuotesWithinCellMultiCharTextDelimiter() { var opts = new ExplodeOptions(new Delimiters(',', "xx")); opts.StrictTextDelimiterPositioning = false; var text = @"one,txxwoxx,three"; ExplodeResult sr = Explode.ExplodeString(text, opts); Assert.True(sr.WereAnyCellsTextDelimited); List <string> sl = sr.Cells.ToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("two", sl[1]); Assert.Equal("three", sl[2]); sl = sr.Cells.RawTextToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("txxwoxx", sl[1]); Assert.Equal("three", sl[2]); }
public void StrictTextDelimiterPositioningEnabledSpacesEnabledWithLeadingSpaces() { var opts = new ExplodeOptions(new Delimiters()); opts.StrictTextDelimiterPositioning = true; opts.StrictTextDelimiterPositioningAllowLeadingTrailingSpaces = true; var text = @"one, ""two"",three"; ExplodeResult sr = Explode.ExplodeString(text, opts); Assert.True(sr.WereAnyCellsTextDelimited); List <string> sl = sr.Cells.ToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("two", sl[1]); Assert.Equal("three", sl[2]); sl = sr.Cells.RawTextToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal(" \"two\"", sl[1]); Assert.Equal("three", sl[2]); }
public void StrictTextDelimiterDisabledStandardQuotedCell() { var opts = new ExplodeOptions(new Delimiters()); opts.StrictTextDelimiterPositioning = false; var text = @"one,""two"",three"; ExplodeResult sr = Explode.ExplodeString(text, opts); Assert.True(sr.WereAnyCellsTextDelimited); List <string> sl = sr.Cells.ToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("two", sl[1]); Assert.Equal("three", sl[2]); sl = sr.Cells.RawTextToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("\"two\"", sl[1]); Assert.Equal("three", sl[2]); }
public void StrictTextDelimiterEnabledQuotesWithinCell() { var opts = new ExplodeOptions(new Delimiters()); opts.StrictTextDelimiterPositioning = true; var text = @"one,t""wo"",three"; ExplodeResult sr = Explode.ExplodeString(text, opts); Assert.False(sr.WereAnyCellsTextDelimited); List <string> sl = sr.Cells.ToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("t\"wo\"", sl[1]); Assert.Equal("three", sl[2]); sl = sr.Cells.RawTextToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("t\"wo\"", sl[1]); Assert.Equal("three", sl[2]); }
private void GetFrametoDraw() { switch (state) { case State.Exploding: xVelocity = yVelocity = 0; if (Explode.curFrameID < 2) { sourceRectangle = Explode.GetFrame(ref StateTimer); } else { canRemove = true; } break; case State.Bouncing: sourceRectangle = Bounce.GetFrame(ref StateTimer); yVelocity += fall_velocity; break; default: sourceRectangle = Bounce.GetFrame(ref StateTimer); break; } positionRectangle.Width = sourceRectangle.Width; positionRectangle.Height = sourceRectangle.Height; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.NuevaNotalayout); var menuToolbar = FindViewById <Toolbar>(Resource.Id.toolbarMenuNotas); SetActionBar(menuToolbar); ActionBar.Title = "Nueva Nota"; nuevaNota = FindViewById <EditText>(Resource.Id.nuevaNotaEditText); tituloNota = FindViewById <EditText>(Resource.Id.tituloEditText); nuevaNotaLinear = FindViewById <LinearLayout>(Resource.Id.nuevaNotaLinearLayout); notaCanvasLayout = FindViewById <LinearLayout>(Resource.Id.notaLinearLayout); linearTituloNota = FindViewById <LinearLayout>(Resource.Id.linearTituloNuevaNota); nuevaNotaLinear.SetBackgroundColor(Android.Graphics.Color.LightYellow); ActionBar.SetDisplayHomeAsUpEnabled(true); color = Metodos.CambiarColorNotasGeneric(this, null, 0, 1); Explode explode = new Explode(); explode.SetDuration(400); Window.EnterTransition = explode; tituloNota.FocusableInTouchMode = true; //Dibujando Lineas en Linearlayout funcional LienzoDraw linea = new LienzoDraw(this); notaCanvasLayout.AddView(linea); }
public void TextDelimiterDisabledWithInsideSeparator() { var opts = new ExplodeOptions(new Delimiters()); opts.EnableTextDelimiter = false; var text = @"one,""t,wo"",three"; ExplodeResult sr = Explode.ExplodeString(text, opts); Assert.False(sr.WereAnyCellsTextDelimited); List <string> sl = sr.Cells.ToStringList(); Assert.Equal(4, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal(@"""t", sl[1]); Assert.Equal(@"wo""", sl[2]); Assert.Equal("three", sl[3]); sl = sr.Cells.RawTextToStringList(); Assert.Equal(4, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal(@"""t", sl[1]); Assert.Equal(@"wo""", sl[2]); Assert.Equal("three", sl[3]); }
public void InsideDoubleTextDelimitersDisabledStrictPositioningDisabled() { var opts = new ExplodeOptions(new Delimiters()); opts.AllowInsideDoubleTextDelimiters = false; opts.StrictTextDelimiterPositioning = false; var text = @"one,""t""""wo"",three"; // " in string // t take t // " out string // " in string // w take w // o take o // " out string ExplodeResult sr = Explode.ExplodeString(text, opts); Assert.True(sr.WereAnyCellsTextDelimited); List <string> sl = sr.Cells.ToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal(@"two", sl[1]); Assert.Equal("three", sl[2]); sl = sr.Cells.RawTextToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("\"t\"\"wo\"", sl[1]); Assert.Equal("three", sl[2]); }
private void TextToStringArrayTest() { var opts = new ExplodeOptions(new Delimiters()); //defaults opts.StrictTextDelimiterPositioning = true; opts.StrictTextDelimiterPositioningAllowLeadingTrailingSpaces = true; var text = @"one,""two"",""three"""; ExplodeResult sr = Explode.ExplodeString(text, opts); Assert.True(sr.WereAnyCellsTextDelimited); string[] sa = sr.Cells.ToStringArray(); Assert.Equal(3, sa.Length); Assert.Equal("one", sa[0]); Assert.Equal("two", sa[1]); Assert.Equal("three", sa[2]); sa = sr.Cells.RawTextToStringArray(); Assert.Equal(3, sa.Length); Assert.Equal("one", sa[0]); Assert.Equal("\"two\"", sa[1]); Assert.Equal("\"three\"", sa[2]); }
public void CharacterEmptyFieldAtEnd() { var opts = new ExplodeOptions(new Delimiters()); var text = "one,two,three,"; ExplodeResult sr = Explode.ExplodeString(text, opts); Assert.False(sr.WereAnyCellsTextDelimited); List <string> sl = sr.Cells.ToStringList(); Assert.Equal(4, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("two", sl[1]); Assert.Equal("three", sl[2]); Assert.Equal("", sl[3]); sl = sr.Cells.RawTextToStringList(); Assert.Equal(4, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("two", sl[1]); Assert.Equal("three", sl[2]); Assert.Equal("", sl[3]); }
private void TerminatedWithTextDelimitedFieldMultiCharTextDelimiterTrailingSpaces() { var opts = new ExplodeOptions(new Delimiters(',', "<>")); //defaults opts.StrictTextDelimiterPositioning = true; opts.StrictTextDelimiterPositioningAllowLeadingTrailingSpaces = true; var text = @"one,<>two<>,<>three<> "; ExplodeResult sr = Explode.ExplodeString(text, opts); Assert.True(sr.WereAnyCellsTextDelimited); List <string> sl = sr.Cells.ToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("two", sl[1]); Assert.Equal("three", sl[2]); sl = sr.Cells.RawTextToStringList(); Assert.Equal(3, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("<>two<>", sl[1]); Assert.Equal("<>three<> ", sl[2]); }
public override void AI() { timer++; if (state == 0 && npc.life < npc.lifeMax / 2) { states[(counter + 1) % states.Length] = 5; npc.Approach(TPlayer.Center, 0.5f); npc.velocity *= 2; Explode.DustExplodeEasy(npc.Center, 100, 30, 197, 1, 100, Color.White, 3f); state++; } switch (states[counter]) { case 0: State0(); break; case 1: State1(); break; case 2: State2(); break; case 3: State3(); break; case 4: State4(); break; case 5: State5(); break; } npc.rotation = npc.velocity.ToRotation() + 1.57f; }
void clearDeath() { for (int i = 0; i < SCENE_OBJ.ALL.Count; i++) { SCENE_OBJ obj = SCENE_OBJ.ALL[i]; if (obj.canDestroy) { obj.pool.delete(obj); } } for (int i = 0; i < AudioObj.globalAudio.Count; i++) { AudioObj obj = AudioObj.globalAudio[i]; if (!obj.audioSrc.isPlaying) { obj.deleteFromScene(); } } if (Explode.pool.live != null) { for (int i = 0; i < Explode.pool.live.Count; i++) { Explode obj = Explode.pool.live[i]; if (!obj.src.isPlaying) { obj.deleteFormScene(); } } } }
private IEnumerator DestroyMatchedTiles(List <Tile> matchedTiles) { Dictionary <string, int> countMatches = new Dictionary <string, int>(); for (int i = 0; i < MatchColor.Count; i++) { countMatches.Add(MatchColor[i], 0); } foreach (Tile matchedTile in matchedTiles) { int runningCount; if (countMatches.TryGetValue(matchedTile.matchColor, out runningCount)) { runningCount += 1; countMatches[matchedTile.matchColor] = runningCount; } tiles[matchedTile.x, matchedTile.y] = null; if (matchedTile.matchColor == "green" || matchedTile.matchColor == "blue") { Warp warpGO = Instantiate(warp, new Vector3(matchedTile.x, matchedTile.y, 0), warp.transform.rotation); warpGO.TileToDestroy = matchedTile; } else { Explode explodeGO = Instantiate(explode, new Vector3(matchedTile.x, matchedTile.y, 0), explode.transform.rotation); explodeGO.TileToDestroy = matchedTile; } } yield return(new WaitForSeconds(1.2f)); scoreManager.ScoreMatches(countMatches); FillTiles(); }
public void CharacterJustSeparators() { var opts = new ExplodeOptions(new Delimiters()); var text = ",,,"; ExplodeResult sr = Explode.ExplodeString(text, opts); Assert.False(sr.WereAnyCellsTextDelimited); List <string> sl = sr.Cells.ToStringList(); Assert.Equal(4, sl.Count); Assert.Equal("", sl[0]); Assert.Equal("", sl[1]); Assert.Equal("", sl[2]); Assert.Equal("", sl[3]); sl = sr.Cells.RawTextToStringList(); Assert.Equal(4, sl.Count); Assert.Equal("", sl[0]); Assert.Equal("", sl[1]); Assert.Equal("", sl[2]); Assert.Equal("", sl[3]); }
public void SetWall(Explode _explode) { this.Team = Unit.ETeam.None; m_fCurrentHp = m_fMaxHp; this.SetFace(m_normalWall); this.SetExplode(_explode); }
public void InsideDoubleTextDelimitersEnablesStrictPositioningDisabledAsLastField() { var opts = new ExplodeOptions(new Delimiters()); opts.AllowInsideDoubleTextDelimiters = true; opts.StrictTextDelimiterPositioning = true; var text = @"one,""t""""wo"""; ExplodeResult sr = Explode.ExplodeString(text, opts); Assert.True(sr.WereAnyCellsTextDelimited); List <string> sl = sr.Cells.ToStringList(); Assert.Equal(2, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("t\"wo", sl[1]); sl = sr.Cells.RawTextToStringList(); Assert.Equal(2, sl.Count); Assert.Equal("one", sl[0]); Assert.Equal("\"t\"\"wo\"", sl[1]); }
// Use this for initialization void Start() { if (Explodable) { ExplodeScript = gameObject.GetComponent <Explode>(); } }
void UseSkillEnd() { Explode tempExplode = explodeList.Dequeue(); ObjectPoolManager.Instance.ExplodeQueue.Enqueue(tempExplode); tempExplode.gameObject.SetActive(false); }
// Use to instantiate the class vars and other properties private void init() { // Set vel based on movement type rb2 = GetComponent <Rigidbody2D>(); rb2.gravityScale = 0; health = GetComponent <BaseHealth>(); explode = GetComponent <Explode>(); }
public IEnumerator OnExplode(Explode.Data explodeData) { BuildingExplosion.<OnExplode>c__Iterator14A <OnExplode>c__Iterator14A = new BuildingExplosion.<OnExplode>c__Iterator14A(); <OnExplode>c__Iterator14A.explodeData = explodeData; <OnExplode>c__Iterator14A.<$>explodeData = explodeData; <OnExplode>c__Iterator14A.<>f__this = this; return <OnExplode>c__Iterator14A; }
public Missile(Game game, GameLogic gameLogic) : base(game) { RefGameLogic = gameLogic; LifeTimer = new Timer(game); Explosion = new Explode(game); LoadContent(); }
public void SetPlayer(int _iFaceNum, Explode _explode) { if (_iFaceNum < m_playerFaces.Count) { this.SetFace(m_playerFaces[_iFaceNum]); } this.SetExplode(_explode); }
public TankShot(Game game, SoundEffect hitSound) : base(game) { LifeTimer = new Timer(game); Explosion = new Explode(game); HitSound = hitSound; LoadContent(); }
public PlayerUnit(int _iFaceNum, Explode _explode) { this.Team = Unit.ETeam.Player; if (_iFaceNum < m_playerFaces.Count) { this.SetFace(m_playerFaces[_iFaceNum]); } this.SetExplode(_explode); }
void Launch() { GameObject clone = (GameObject)Instantiate(missile); clone.transform.position = transform.position; clone.transform.rotation = transform.rotation; clone.transform.parent = missileContainer.transform; currentMissile = clone; explode = clone.GetComponent<Explode> (); }
void Start() { body2D = GetComponent <Rigidbody2D>(); renderer2D = GetComponent <SpriteRenderer>(); animator = GetComponent <Animator>(); controller = GetComponent <PlayerSubmarineController>(); health = GetComponent <BaseHealth>(); explode = GetComponent <Explode>(); }
protected virtual void explode() { Explode.create(transform.position, false); if (data != null && data.value > 0) { Scrap.create(transform.position, data.value); } Destroy(gameObject); }
public void SetEnemy(int _iFaceNum, Explode _explode) { //this.Team = Unit.ETeam.Enemy; if (_iFaceNum < m_enemyFaces.Count) { this.SetFace(m_enemyFaces[_iFaceNum]); } this.SetExplode(_explode); }
public void Demolish(bool explode, bool delay) { setSelected(false); if (explode) { Explode.create(transform.position, delay); } Destroy(gameObject); }
private void EmergencyCase() { Explode += () => CrashStatus = true; if (Explode != null) { Explode.Invoke(); } Explode -= () => CrashStatus = true; }
public void OnExplode(Explode.Data explodeData) { if (this._owner) { BuildingExplosion component = this._owner.GetComponent<BuildingExplosion>(); if (component) { component.OnExplodeFoundationTier(explodeData, this); } } }
void OnTriggerEnter2D(Collider2D target) { targ = target; explode = targ.GetComponent<Explode>(); if (target.gameObject.tag == "Player") { print ("AnimationEvent"); animator.SetInteger ("AnimState", 1); if(attackSound) AudioSource.PlayClipAtPoint(attackSound, transform.position); } }
// Update is called once per frame void Update() { if (targ != null) { explode = targ.GetComponent<Explode> (); if (readyToAttack) { print ("explode"); if(explode != null){ explode.onExplode(); } } } }
public void OnExplodeFoundationTier(Explode.Data explodeData, FoundationChunkTier tier) { FoundationHealth component = base.GetComponent<FoundationHealth>(); if (component) { component.LocalizedTierHit(new LocalizedHitData { _damage = explodeData.explode.damage * this.GetDamageRatio(explodeData.distance, explodeData.explode.radius), _position = explodeData.explode.transform.position, _distortRatio = 2.5f }, tier); } }
//---------------------------------------------------------------// //---------------------------------------------------------------// //---------------------MonoBehavior Functions---------------------// //---------------------------------------------------------------// void Start() { //Load bubble materials bMat[1] = Resources.Load("RedBubble", typeof(Material)) as Material; bMat[2] = Resources.Load("GreenBubble", typeof(Material)) as Material; bMat[3] = Resources.Load("BlueBubble", typeof(Material)) as Material; bMat[4] = Resources.Load("HazardBubble", typeof(Material)) as Material; bMat[5] = Resources.Load("RainbowBubble", typeof(Material)) as Material; //Load rainbow animator controller rAni = Resources.Load ("Master Bubble",typeof(RuntimeAnimatorController)) as RuntimeAnimatorController; //Load scripts cube = GameObject.FindGameObjectWithTag ("Player"); if (Player.isAlive) { player = cube.GetComponent<Player> (); } explode = gameObject.GetComponent<Explode> (); }
void Start() { controller = GetComponent<PlayerController> (); exploder = GetComponent<Explode> (); }
void Awake() { _boxCollider = gameObject.GetComponent<BoxCollider2D> (); _explodeScript = gameObject.GetComponent<Explode> (); }